AbstractServiceProvider

Base class for the service providers used to register classes in the container.


Description Description

See the documentation of the original class this one is based on (https://container.thephpleague.com/3.x/service-providers) for basic usage details. What this class adds is:

  • The add_with_auto_arguments method that allows to register classes without having to specify the injection method arguments.
  • The share_with_auto_arguments method, sibling of the above.
  • Convenience add and share methods that are just proxies for the same methods in $this->getContainer().

Source Source

File: src/Internal/DependencyManagement/AbstractServiceProvider.php


			

Top ↑

Methods Methods

  • add — Register an entry in the container.
  • add_with_auto_arguments — Register a class in the container and use reflection to guess the injection method arguments.
  • get_class — Gets the class of a parameter.
  • reflect_class_or_callable — Check if a combination of class name and concrete is valid for registration.
  • share — Register a shared entry in the container (`get` always returns the same instance).
  • share_with_auto_arguments — Register a class in the container and use reflection to guess the injection method arguments.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.