| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 36 | #[\Override] |
||
| 37 | public function get(string $name): object { |
||
| 38 | if (isset($this->instances[$name])) { |
||
| 39 | return $this->instances[$name]; |
||
| 40 | } |
||
| 41 | foreach ($this->getFqcnList() as $fqcn) { |
||
| 42 | if ($fqcn === $name || $fqcn::getProviderId() === $name) { |
||
| 43 | $instance = \OCP\Server::get($fqcn); |
||
| 44 | $instance->setAppConfig(\OCP\Server::get(\OCP\IAppConfig::class)); |
||
| 45 | $this->instances[$name] = $instance; |
||
| 46 | return $instance; |
||
| 47 | } |
||
| 48 | } |
||
| 49 | throw new InvalidProviderException("Provider <$name> does not exist"); |
||
| 50 | } |
||
| 52 |