di: Fall back to autoloader when class is not in container
Currently there’s a need to declare everything that is repetitive if we need to set a single class without an interface into container:
\App\ConsoleCommand\CreateUser::class => \App\ConsoleCommand\CreateUser::class,
In such cases we can try to fall back to class autoloading.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (18 by maintainers)
Yes. I used:
Ok, I also think that we can ignore this, because these are fractions of microseconds.
Ok, I’ll check it too.
@samdark I just created benchmarks for method
Container::has(). See #90.Test N1
Method
Containter::has()implementation (current):Bench results:
Test N2
Method
Containter::has()implementation (proposed):Bench results:
has()is rarely used by itself. Usually it’sget().