Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit ef7d0e1

Browse files
committed
Removed migration note about has()
- As this patch makes it obsolete.
1 parent 6a83199 commit ef7d0e1

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

doc/book/migration.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -428,42 +428,6 @@ $alsoBetween = $container->build(Between::class, [
428428
The above two validators would be different instances, with their own
429429
configuration.
430430

431-
### has() no longer checks abstract factories by default
432-
433-
In v2, `has()` would also check abstract factories to see if any would match the
434-
service. Depending on the number of abstract factories present, this can be an
435-
expensive operation. As a result, in v3, we no longer check abstract factories
436-
*by default*.
437-
438-
However, you *can* tell the Service Manager to check them by passing an optional
439-
second argument to the method; a boolean is expected, and a `true` value
440-
indicates that abstract factories should be checked:
441-
442-
```php
443-
$container = new ServiceManager([
444-
'factories' => [
445-
'MyClass' => 'MyClass',
446-
],
447-
'abstract_factories' => [
448-
'AbstractFactoryThatAlwaysResolves',
449-
],
450-
]);
451-
```
452-
453-
Assuming that `AbstractFactoryThatAlwaysResolves` will resolve any service
454-
(don't ever do this!), the following behavior is expected:
455-
456-
```php
457-
$has = $container->has('MyClass'); // always true; factory is defined
458-
// for the service.
459-
$has = $container->has('AnotherClass'); // false; no factory is defined
460-
// for the service, and not
461-
// looking in abstract factories.
462-
$has = $container->has('AnotherClass', true); // true; no factory is defined for
463-
// the service, but we indicated
464-
// we'd look in abstract factories.
465-
```
466-
467431
## Factories
468432

469433
All factory interfaces were moved to a `Factory` subnamespace. Additionally, the

0 commit comments

Comments
 (0)