Download the PHP package lane4hub/factory without Composer
On this page you can find all versions of the php package lane4hub/factory. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lane4hub/factory
More information about lane4hub/factory
Files in lane4hub/factory
Package factory
Short Description The Factory class serves as a flexible instantiation and access factory for classes, supporting optional versioning and dependency injection (DI).
License MIT
Homepage https://github.com/lane4hub/factory
Informations about the package factory
Lane4 Digital Factory
Purpose
The Factory
serves as a flexible instantiation and access factory for classes, supporting optional versioning and dependency injection (DI).
Description for Developers
The class provides methods to dynamically create instances of classes or retrieve them from a provided container. It supports:
- Class versioning through a
ClassVersionInterface
. - Dependency Injection via a
Psr\Container\ContainerInterface
. - Dynamic construction of classes with parameter support.
Key Methods
get($className, $version = null, ...$parameters)
: Creates an instance of the specified class, optionally with versioning and parameters.classVersion()
: Returns the currently configured versioning instance.setClassVersion($versionService)
: Sets a new versioning instance.container()
: Returns the current container.setContainer($container)
: Sets the container.
Notes
- If a container is provided, the instance is retrieved from the container if available.
- If no container is available or the class is not registered in the container, the instance is dynamically created using reflection.
- Setting a container or ClassVersion is only possible once.
Usage
The class provides a central point for instantiation and management of objects with optional versioning and dependency injection.
Example code without classVersioning and without DI container
Example code with classVersioning and without DI container
Example code with classVersioning and DI container
Quickstart Composer
Quickstart GitHub
Contents in the GitHub Repository
- Source Files:
- src
- tests
- Support:
- Docker Compose
- .env
- pre-commit-hook.sh
Makefile
Simply runmake
in the console
- Documentation:
- README.md
The DockerFile for creating the PHP image is built more extensively than necessary for this tool since the resulting PHP image is used in various Lane4 tools.
We also ensure that our images are as small as possible and leave no unnecessary files on your system during repeated image builds.
Jardis Framework
This tool is part of the development of our Domain-Driven Design framework Jardis
(Just a reliable domain integration system).
Jardis
consists of a collection of highly professional PHP software packages and concepts based on DDD, explicitly developed for the efficient and sustainable solution of complex business applications.
Our development is based on defined standards such as DDD and PSR, aiming to deliver the highest possible quality for functional and non-functional requirements.
For technical quality assurance, we use PhpStan Level 8, PhpCS, and generate full test coverage with PhpUnit.
Our software packages meet the following quality attributes:
- Analyzability
- Adaptability
- Extensibility
- Modularity
- Maintainability
- Testability
- Scalability
- High performance