Download the PHP package lane4hub/classversion without Composer
On this page you can find all versions of the php package lane4hub/classversion. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lane4hub/classversion
More information about lane4hub/classversion
Files in lane4hub/classversion
Package classversion
Short Description ClassVersion enables loading classes with the same name from specific subdirectories associated with respective version labels
License MIT
Homepage https://github.com/lane4hub/version
Informations about the package classversion
Lane4 Digital ClassVersion
ClassVersion enables loading classes with the same name from specific subdirectories associated with respective version labels.
Description for example code
This code implements a dynamic loading system for classes, allowing different versions of a class to be loaded from corresponding subdirectories. The main functionality is provided by the ClassVersion and ClassVersionConfig classes. Here is a step-by-step explanation:
- Class Version Configuration:
- The
$classVersions
variable defines a mapping of subdirectories (subDirectory
) to available version labels (version1
,version2
).
- The
- Configuration Initialization:
- A
ClassVersionConfig
object is created and initialized with the version configuration$classVersions
.
- A
- ClassVersion Instance:
- An instance of
ClassVersion
is created, working with the previously defined configuration.
- An instance of
- Loading Classes:
ClassVersion
enables loading classes in different versions:$classVersion(YourClass::class)
: Loads the default version of the classYourClass
.$classVersion(YourClass::class, 'version1')
: Loads versionversion1
of the classYourClass
.$classVersion(YourClass::class, 'version2')
: Loads versionversion2
of the classYourClass
.
Code Benefits
This approach allows different versions of a class to be dynamically loaded without directly referencing the implementations in the code. This is particularly useful in projects that require versioning, such as API versions or experimental implementations of classes.
Example Code
Quickstart Composer
Quickstart GitHub
GitHub Repository Contents
- Source Files:
src
tests
- Support:
- Docker Compose
.env
pre-commit-hook.sh
Makefile
: Simply runmake
in the terminal.
- Documentation:
README.md
The structure of the Dockerfile
for building the PHP image is more comprehensive than necessary for this tool, as the resulting PHP image is used in various Lane4 tools.
We also ensure that our images are as small as possible and that no unnecessary files remain on your system during repeated 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