Comments (7)
For example https://symfony.com/doc/current/components/process.html
from instantiator.
This library provides a way of avoiding usage of constructors when instantiating PHP classes.
That's really all there is to it.
from instantiator.
I agree with @Ocramius here, the readme explains what the library does. If you're not sure what benefits this library will bring you, you don't need to use it: there are only a handful of use-cases where you want to instantiate objects without using the constructor.
from instantiator.
use-cases where you want to instantiate objects without using the constructor
@alcaeus for example?
from instantiator.
@higimo one of the use cases is what ORM/ODM does: Instantiating an empty object (which normally would not be possible due to required ctor arguments) to populate its properties through reflection. Effectively this allows the end-user to still use __construct
and not be limited by a library.
from instantiator.
@alcaeus why can't write this in the README?
from instantiator.
Mostly because this is very hacky behaviour that shouldn't be endorsed for a larger audience: authors of code that need this know the requirement very well, and also how to search for this library.
Examples include mocking objects, proxying libraries, ORMs, serialisers: all very advanced pieces of code.
from instantiator.
Related Issues (20)
- Extension HOT 2
- missing shebang in .travis.install.sh HOT 2
- Enable CI services HOT 1
- What about to add the capability to set properties with given set of values? HOT 9
- Unable to instanciate Symfony\Component\HttpFoundation\File\File HOT 7
- Verify compatibility with PHP 5.6.0 (stable, once released) HOT 3
- version 1.1.0 broke phpunit on PHP 5.4 ~ PHP 5.6 HOT 7
- Dependency problem HOT 4
- Strange fatal error in PHP 7.1 due to void return hint HOT 2
- Minimum PHP version change in minor is breaking dependents HOT 21
- PHP 7.1 in composer HOT 1
- doctrine/instantiator 1.0.1 requires php ~5.3 -> your PHP version (7.1.8) does not satisfy that HOT 4
- Requirement of PHP7.1 breaking other packages HOT 4
- Can't instantiate final class extending ArrayIterator HOT 18
- ext requirements HOT 1
- version 1.1.0 is breaking PHP < 7.1 HOT 4
- Add documentation
- Instantiator attempts to clone classes that are not cloneable HOT 6
- Promoted property causing Error HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instantiator.