Download the PHP package newclass/onus without Composer
On this page you can find all versions of the php package newclass/onus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download newclass/onus
More information about newclass/onus
Files in newclass/onus
Download newclass/onus
More information about newclass/onus
Files in newclass/onus
Please rate this library. Is it a good library?
Informations about the package onus
README
What is Onus?
Onus is a PHP Dependency Injection manager.
Installation
The best way to install is to use the composer by command:
composer require newclass/onus
composer install
Use example
use Onus\ClassLoader;
use Onus\MetadataClass;
use Onus\MetadataMethod;
$cl=new ClassLoader();
$metadataClass=new MetadataClass('standalone',StandaloneClass::class); //StandaloneClass is your custom class.
$metadataClass->addMethod('__construct')
->addArgument(MetadataMethod::PRIMITIVE_TYPE,'value1')
->addArgument(MetadataMethod::PRIMITIVE_TYPE,'value2');
$metadataClass->addMethod('setParam3')
->addArgument(MetadataMethod::STATIC_TYPE,StandaloneClass::class.'::DATA');
$cl->register($metadataClass);
$metadataClass=new MetadataClass('dependency',DependencyClass::class); //DependencyClass is your custom class.
$metadataClass->addMethod('setStandalone')
->addArgument(MetadataMethod::REFERENCE_TYPE,'standalone');
$metadataClass->addMethod('enableFlag');
$cl->register($metadataClass);
$dependencyClass=$cl->get('dependency');
$param1=$dependencyClass->getParam1(); //return "value1"
$param2=$dependencyClass->getParam2(); //return "value2"
$param3=$dependencyClass->getParam3(); //return data1
$flag=$dependencyClass->isFlag(); //return true
All versions of onus with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4.0
The package newclass/onus contains the following files
Loading the files please wait ....