ilya/creator

自动依赖关系解析。

2.0.0 2014-06-10 17:15 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:47:15 UTC


README

Build Status

Creator 是一个轻量级的反射 API 包装器,允许您轻松实例化类。

它将自动读取构造函数的依赖关系并将它们注入到新实例中。

use Creator\Creator;

class Foo {

    public function __construct(AnotherClass $foo, $bar = 42)
    {
       # something here
    }
  
}

# do not want to instantiate it manually? here is what you can do
$foo = Creator::make('Foo'); # => new instance of Foo 

附加信息

Creator 采用 MIT 许可证授权。