mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-09 23:14:26 +02:00
Fix code style
This commit is contained in:
parent
525b1c6440
commit
d16614e06a
3 changed files with 23 additions and 24 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue