Component Container

Instructor uses Container and ComponentConfig classes to handle wiring of the key components of the library.

Container class

Instructor uses Container class to handle configuration of all components of the library. It is used to define components, the way to instantiate them and the dependencies between components.

Container class is responsible for instantiation of the components (and inject them with the configuration data).

ComponentConfig class

ComponentConfig class contains a configuration data of a single component.

Configurators

Instructor uses a set of ‘configurators’ to define the wiring of the submodules of the library.

Configurators are classes defining how to connect up a group of components with their dependencies and setting initial values of parameters.

See the source code for more details: https://github.com/cognesy/instructor-php/tree/main/src/Configs