Skip to content

Commit 33eb419

Browse files
authored
Merge pull request PHP-DI#755 from alexkuc/fix-752
Update docs (php-definitions: static methods)
2 parents dc320bd + dd35ce2 commit 33eb419

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/php-definitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ return [
213213

214214
Please note:
215215

216-
- `factory([FooFactory::class, 'build'])`: if `build()` is a **static** method then the object will not be created: `FooFactory::build()` will be called statically (as one would expect)
216+
- `factory([FooFactory::class, 'build'])`: if `build()` is a **static** method then `FooFactory::build()` will be called statically (the static method is responsible for returning an object or returning a value)
217217
- you can set any container entry name in the array, e.g. `DI\factory(['foo_bar_baz', 'build'])` (or alternatively: `DI\factory('foo_bar_baz::build')`), allowing you to configure `foo_bar_baz` and its dependencies like any other object
218218
- as a factory can be any PHP callable, you can use invokable objects, too: `DI\factory(InvokableFooFactory::class)` (or alternatively: `DI\factory('invokable_foo_factory')`, if it's defined in the container)
219219
- all closures will be considered by PHP-DI as *factories*, even if they are nested into other definitions like `create()`, `env()`, etc. (read more in the [Nesting definitions](#nesting-definitions) section)

0 commit comments

Comments
 (0)