1# Instantiator 2 3This library provides a way of avoiding usage of constructors when instantiating PHP classes. 4 5[![Build Status](https://travis-ci.org/doctrine/instantiator.svg?branch=master)](https://travis-ci.org/doctrine/instantiator) 6[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/instantiator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master) 7[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/instantiator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master) 8[![Dependency Status](https://www.versioneye.com/package/php--doctrine--instantiator/badge.svg)](https://www.versioneye.com/package/php--doctrine--instantiator) 9 10[![Latest Stable Version](https://poser.pugx.org/doctrine/instantiator/v/stable.png)](https://packagist.org/packages/doctrine/instantiator) 11[![Latest Unstable Version](https://poser.pugx.org/doctrine/instantiator/v/unstable.png)](https://packagist.org/packages/doctrine/instantiator) 12 13## Installation 14 15The suggested installation method is via [composer](https://getcomposer.org/): 16 17```sh 18php composer.phar require "doctrine/instantiator:~1.0.3" 19``` 20 21## Usage 22 23The instantiator is able to create new instances of any class without using the constructor or any API of the class 24itself: 25 26```php 27$instantiator = new \Doctrine\Instantiator\Instantiator(); 28 29$instance = $instantiator->instantiate(\My\ClassName\Here::class); 30``` 31 32## Contributing 33 34Please read the [CONTRIBUTING.md](CONTRIBUTING.md) contents if you wish to help out! 35 36## Credits 37 38This library was migrated from [ocramius/instantiator](https://github.com/Ocramius/Instantiator), which 39has been donated to the doctrine organization, and which is now deprecated in favour of this package. 40