1Introduction 2============ 3 4This library provides a way of avoiding usage of constructors when instantiating PHP classes. 5 6Installation 7============ 8 9The suggested installation method is via `composer`_: 10 11.. code-block:: console 12 13 $ composer require doctrine/instantiator 14 15Usage 16===== 17 18The instantiator is able to create new instances of any class without 19using the constructor or any API of the class itself: 20 21.. code-block:: php 22 23 <?php 24 25 use Doctrine\Instantiator\Instantiator; 26 use App\Entities\User; 27 28 $instantiator = new Instantiator(); 29 30 $user = $instantiator->instantiate(User::class); 31 32Contributing 33============ 34 35- Follow the `Doctrine Coding Standard`_ 36- The project will follow strict `object calisthenics`_ 37- Any contribution must provide tests for additional introduced 38 conditions 39- Any un-confirmed issue needs a failing test case before being 40 accepted 41- Pull requests must be sent from a new hotfix/feature branch, not from 42 ``master``. 43 44Testing 45======= 46 47The PHPUnit version to be used is the one installed as a dev- dependency 48via composer: 49 50.. code-block:: console 51 52 $ ./vendor/bin/phpunit 53 54Accepted coverage for new contributions is 80%. Any contribution not 55satisfying this requirement won’t be merged. 56 57Credits 58======= 59 60This library was migrated from `ocramius/instantiator`_, which has been 61donated to the doctrine organization, and which is now deprecated in 62favour of this package. 63 64.. _composer: https://getcomposer.org/ 65.. _CONTRIBUTING.md: CONTRIBUTING.md 66.. _ocramius/instantiator: https://github.com/Ocramius/Instantiator 67.. _Doctrine Coding Standard: https://github.com/doctrine/coding-standard 68.. _object calisthenics: http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php 69