Skip to content

Commit

Permalink
Update Providers.php
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Oct 9, 2024
1 parent 04a7c0d commit 98506c3
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/List/Providers.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use Ghostwriter\Container\Interface\ListInterface;
use Ghostwriter\Container\Interface\ServiceProviderInterface;

use function array_key_exists;

final class Providers implements ListInterface
{
/**
Expand All @@ -19,6 +17,14 @@ public function __construct(
) {
}

/**
* @param array<class-string<ServiceProviderInterface>,bool> $list
*/
public static function new(array $list = []): self
{
return new self($list);
}

/**
* @param class-string<ServiceProviderInterface> $serviceProvider
*/
Expand All @@ -32,19 +38,11 @@ public function add(string $serviceProvider): void
*/
public function has(string $serviceProvider): bool
{
return array_key_exists($serviceProvider, $this->list);
return \array_key_exists($serviceProvider, $this->list);
}

public function unset(string $serviceProvider): void
{
unset($this->list[$serviceProvider]);
}

/**
* @param array<class-string<ServiceProviderInterface>,bool> $list
*/
public static function new(array $list = []): self
{
return new self($list);
}
}

0 comments on commit 98506c3

Please sign in to comment.