| Total Complexity | 6 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | trait LocalStorage |
||
| 9 | { |
||
| 10 | /** @var array $storage Holds previously resolved dependencies with singleton scope */ |
||
| 11 | protected $storage = []; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Try to read the requested dependency from the storage |
||
| 15 | * |
||
| 16 | * @param string $name Dependency name. |
||
| 17 | * @return mixed Retrieved value or null if not previously stored. |
||
| 18 | */ |
||
| 19 | protected function fromLocal(string $name) { |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Save the dependency to the storage. |
||
| 25 | * |
||
| 26 | * @param Bean $bean Dependency to be stored. |
||
| 27 | * @return mixed Stored value from the supplied bean. |
||
| 28 | */ |
||
| 29 | protected function toLocal(Bean $bean) { |
||
| 38 | } |
||
| 39 | } |