Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"php": ">=8.4.23",
"d11wtq/boris": "~1.0",
"filp/whoops": "~2.11",
"illuminate/collections": "^13",
"illuminate/conditionable": "^13",
"illuminate/contracts": "^13",
"illuminate/macroable": "^13",
"illuminate/reflection": "^13",
"ircmaxell/password-compat": "~1.0",
"laravel/serializable-closure": "^1.2",
"monolog/monolog": "^3.10",
Expand Down
35 changes: 35 additions & 0 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class Container implements ArrayAccess, ContainerContract {
*/
protected array $instances = [];

/**
* The registered scoped instances.
*/
protected array $scopedInstances = [];

/**
* The registered type aliases.
*/
Expand Down Expand Up @@ -375,6 +380,36 @@ public function singletonIf($abstract, $concrete = null): void
}
}

/**
* Register a scoped binding in the container.
*
* @param \Closure|string $abstract
* @param \Closure|string|null $concrete
* @return void
*/
public function scoped($abstract, $concrete = null): void
{
if (! in_array($abstract, $this->scopedInstances, true)) {
$this->scopedInstances[] = $abstract;
}

$this->singleton($abstract, $concrete);
}

/**
* Register a scoped binding if it hasn't already been registered.
*
* @param \Closure|string $abstract
* @param \Closure|string|null $concrete
* @return void
*/
public function scopedIf($abstract, $concrete = null): void
{
if (! $this->bound($abstract)) {
$this->scoped($abstract, $concrete);
}
}

/**
* Wrap a Closure such that it is shared.
*
Expand Down
14 changes: 0 additions & 14 deletions src/Illuminate/Contracts/Auth/Authenticatable.php

This file was deleted.

14 changes: 0 additions & 14 deletions src/Illuminate/Contracts/Auth/Guard.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Illuminate/Contracts/Auth/UserProvider.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Illuminate/Contracts/Bus/Dispatcher.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Illuminate/Contracts/Bus/QueueingDispatcher.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Illuminate/Contracts/Cache/Factory.php

This file was deleted.

22 changes: 0 additions & 22 deletions src/Illuminate/Contracts/Cache/Repository.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/Illuminate/Contracts/Cache/Store.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Illuminate/Contracts/Config/Repository.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/Illuminate/Contracts/Container/BindingResolutionException.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/Illuminate/Contracts/Container/CircularDependencyException.php

This file was deleted.

31 changes: 0 additions & 31 deletions src/Illuminate/Contracts/Container/Container.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/Illuminate/Contracts/Container/ContextualBindingBuilder.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Illuminate/Contracts/Cookie/Factory.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Illuminate/Contracts/Cookie/QueueingFactory.php

This file was deleted.

31 changes: 0 additions & 31 deletions src/Illuminate/Contracts/Database/ModelIdentifier.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Illuminate/Contracts/Encryption/DecryptException.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Illuminate/Contracts/Encryption/EncryptException.php

This file was deleted.

12 changes: 0 additions & 12 deletions src/Illuminate/Contracts/Encryption/Encrypter.php

This file was deleted.

26 changes: 0 additions & 26 deletions src/Illuminate/Contracts/Encryption/StringEncrypter.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Illuminate/Contracts/Events/Dispatcher.php

This file was deleted.

Loading
Loading