@@ -428,42 +428,6 @@ $alsoBetween = $container->build(Between::class, [
428
428
The above two validators would be different instances, with their own
429
429
configuration.
430
430
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
-
467
431
## Factories
468
432
469
433
All factory interfaces were moved to a ` Factory ` subnamespace. Additionally, the
0 commit comments