Skip to content

Commit

Permalink
Merge pull request #1056 from spiral/singleton-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Jan 11, 2024
1 parent a33113d commit 1b448b7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/BootloadManager/AbstractBootloadManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
namespace Spiral\Boot\BootloadManager;

use Spiral\Boot\BootloadManagerInterface;
use Spiral\Core\Container;
use Spiral\Core\Attribute\Singleton;
use Spiral\Core\ScopeInterface;

/**
* Provides ability to bootload service providers.
*/
abstract class AbstractBootloadManager implements BootloadManagerInterface, Container\SingletonInterface
#[Singleton]
abstract class AbstractBootloadManager implements BootloadManagerInterface
{
public function __construct(
private readonly ScopeInterface $scope,
Expand Down
5 changes: 3 additions & 2 deletions src/BootloadManager/ClassesRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

use Spiral\Boot\BootloadManagerInterface;
use Spiral\Boot\Exception\BootloaderAlreadyBootedException;
use Spiral\Core\Container;
use Spiral\Core\Attribute\Singleton;

/**
* @internal
* @psalm-import-type TClass from BootloadManagerInterface
*/
final class ClassesRegistry implements Container\SingletonInterface
#[Singleton]
final class ClassesRegistry
{
/** @var TClass[] */
private array $classes = [];
Expand Down
5 changes: 3 additions & 2 deletions src/BootloadManager/Initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
use Spiral\Boot\BootloadManager\Checker\ClassExistsChecker;
use Spiral\Boot\BootloadManager\Checker\ConfigChecker;
use Spiral\Boot\BootloadManagerInterface;
use Spiral\Core\Attribute\Singleton;
use Spiral\Core\BinderInterface;
use Spiral\Core\Container;
use Spiral\Core\ResolverInterface;

/**
* @internal
* @psalm-import-type TClass from BootloadManagerInterface
* @psalm-import-type TFullBinding from BootloaderInterface
*/
class Initializer implements InitializerInterface, Container\SingletonInterface
#[Singleton]
class Initializer implements InitializerInterface
{
protected ?BootloaderCheckerInterface $checker = null;

Expand Down

0 comments on commit 1b448b7

Please sign in to comment.