diff --git a/src/Service/Addon/AddonContainer.php b/src/Service/Addon/AddonContainer.php index 5ce2aa214c..2205f3e158 100644 --- a/src/Service/Addon/AddonContainer.php +++ b/src/Service/Addon/AddonContainer.php @@ -29,21 +29,21 @@ final class AddonContainer implements ContainerInterface private function __construct(Container $container, array $allowedServices) { - $this->container = $container; + $this->container = $container; $this->allowedServices = $allowedServices; } /** - * Finds an entry of the container by its identifier and returns it. - * - * @param string $id Identifier of the entry to look for. - * - * @throws \Psr\Container\NotFoundExceptionInterface No entry was found for **this** identifier. - * @throws \Psr\Container\ContainerExceptionInterface Error while retrieving the entry. - * - * @return mixed Entry. - */ - public function get(string $id) + * Finds an entry of the container by its identifier and returns it. + * + * @param string $id Identifier of the entry to look for. + * + * @throws \Psr\Container\NotFoundExceptionInterface No entry was found for **this** identifier. + * @throws \Psr\Container\ContainerExceptionInterface Error while retrieving the entry. + * + * @return mixed Entry. + */ + public function get(string $id) { if ($this->has($id)) { return $this->container->create($id); @@ -58,17 +58,17 @@ final class AddonContainer implements ContainerInterface } /** - * Returns true if the container can return an entry for the given identifier. - * Returns false otherwise. - * - * `has($id)` returning true does not mean that `get($id)` will not throw an exception. - * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`. - * - * @param string $id Identifier of the entry to look for. - * - * @return bool - */ - public function has(string $id): bool + * Returns true if the container can return an entry for the given identifier. + * Returns false otherwise. + * + * `has($id)` returning true does not mean that `get($id)` will not throw an exception. + * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`. + * + * @param string $id Identifier of the entry to look for. + * + * @return bool + */ + public function has(string $id): bool { return in_array($id, $this->allowedServices); } diff --git a/src/Service/Addon/AddonManager.php b/src/Service/Addon/AddonManager.php index 03fbc421ec..4062753c7e 100644 --- a/src/Service/Addon/AddonManager.php +++ b/src/Service/Addon/AddonManager.php @@ -37,7 +37,7 @@ final class AddonManager foreach ($this->addons as $addon) { // @TODO Here we can filter or deny dependencies from addons - $dependencies[$addon->getId()] = $addon->getRequiredDependencies(); + $dependencies[$addon->getId()] = $addon->getRequiredDependencies(); } return $dependencies; diff --git a/tests/Unit/Service/Addon/AddonProxyTest.php b/tests/Unit/Service/Addon/AddonProxyTest.php index cac13aa291..858a23e8dc 100644 --- a/tests/Unit/Service/Addon/AddonProxyTest.php +++ b/tests/Unit/Service/Addon/AddonProxyTest.php @@ -17,7 +17,6 @@ use Friendica\Service\Addon\Addon; use Friendica\Service\Addon\AddonProxy; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; -use Psr\Log\LoggerInterface; /** * Helper interface to combine AddonBootstrap and DependencyProvider.