Skip to content

Commit

Permalink
Add doctrine instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin v / vvval committed May 28, 2019
1 parent a316457 commit 3aed6e8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
35 changes: 0 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,3 @@
[![Build Status](https://travis-ci.org/cycle/proxy-factory.svg?branch=master)](https://travis-ci.org/cycle/proxy-factory)
[![Codecov](https://codecov.io/gh/cycle/proxy-factory/branch/master/graph/badge.svg)](https://codecov.io/gh/cycle/proxy-factory/)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cycle/proxy-factory/badges/quality-score.png)](https://scrutinizer-ci.com/g/cycle/proxy-factory/)


## Usage
```php
use Cycle\ORM\ORMInterface;
use Cycle\ORM\Promise\Factory;
use Cycle\ORM\Promise\ReferenceInterface;

class Example
{
/** @var Factory */
private $factory;

/** @var ORMInterface */
private $orm;

public function __construct(Factory $factory, ORMInterface $orm)
{
$this->factory = $factory;
$this->orm = $orm;
}

/**
* @param string $role
* @param array $scope
*
* @return ReferenceInterface|null
* @throws \Cycle\ORM\Promise\ProxyFactoryException
*/
public function promise(string $role, array $scope): ?ReferenceInterface
{
return $this->factory->promise($this->orm, $role, $scope);
}
}
```
2 changes: 1 addition & 1 deletion src/Visitor/AddMagicDebugInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(string $resolverProperty, string $resolveMethod, arr
public function leaveNode(Node $node)
{
if ($node instanceof Node\Stmt\Class_) {
$method = new Builder\Method('__debugInfo');
$method = new Builder\Method('__debuginfo');
$method->makePublic();
$method->addStmt(Expressions::resolveIntoVar('entity', 'this', $this->resolverProperty, $this->resolveMethod));
$method->addStmt($this->buildExpression());
Expand Down

0 comments on commit 3aed6e8

Please sign in to comment.