docs/en/index.rst
This library provides a way of avoiding usage of constructors when instantiating PHP classes.
The suggested installation method is via composer_:
.. code-block:: console
$ composer require doctrine/instantiator
The instantiator is able to create new instances of any class without using the constructor or any API of the class itself:
.. code-block:: php
<?php
use Doctrine\Instantiator\Instantiator;
use App\Entities\User;
$instantiator = new Instantiator();
$user = $instantiator->instantiate(User::class);
Doctrine Coding Standard_object calisthenics_master.The PHPUnit version to be used is the one installed as a dev- dependency via composer:
.. code-block:: console
$ ./vendor/bin/phpunit
Accepted coverage for new contributions is 80%. Any contribution not satisfying this requirement won’t be merged.
This library was migrated from ocramius/instantiator_, which has been
donated to the doctrine organization, and which is now deprecated in
favour of this package.
.. _composer: https://getcomposer.org/ .. _CONTRIBUTING.md: CONTRIBUTING.md .. _ocramius/instantiator: https://github.com/Ocramius/Instantiator .. _Doctrine Coding Standard: https://github.com/doctrine/coding-standard .. _object calisthenics: http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php