cycle / docs

Cycle ORM Documentation
https://cycle-orm.dev/docs
110 stars 38 forks source link

Proxy configuration snippet is inaccurate #63

Open the-toster opened 4 years ago

the-toster commented 4 years ago

Example of ORM configuration to use ProxyFactory from here https://github.com/cycle/docs/blob/2f15cdb4bba7f8c45c5c807bc461420a3f890828/advanced/promise.md#proxies-and-promises

actually looks like this for me:

use Cycle\ORM\Promise\ConflictResolver;
use Cycle\ORM\Promise\Declaration\Extractor;
use Cycle\ORM\Promise\Printer;
use Cycle\ORM\Promise\Traverser;
use Doctrine\Instantiator\Instantiator;
// ....
$traverser = new Traverser();
$extractor = new Extractor(
    new Extractor\Constants(),
    new Extractor\Properties(),
    new Extractor\Methods($traverser)
);
$orm = $orm->withPromiseFactory(new \Cycle\ORM\Promise\ProxyFactory(
    $extractor,
    new Printer($extractor, $traverser, new ConflictResolver()),
    new Instantiator()
));