| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | 38 | final public function add(string $name, object $object): self |
|
| 42 | { |
||
| 43 | // ensure factories are persisted |
||
| 44 | 38 | if ($object instanceof Factory) { |
|
| 45 | 2 | $object = $object->persist(); |
|
| 46 | } |
||
| 47 | |||
| 48 | // ensure all objects are wrapped in a auto-refreshing proxy |
||
| 49 | 38 | $this->objects[$name] = PersistenceManager::proxy($object)->withAutoRefresh(); |
|
| 50 | |||
| 51 | 38 | return $this; |
|
| 52 | } |
||
| 65 |