Skip to content

Commit

Permalink
Merge branch 'mehdihasanpour-Fix--Refactor' into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
philipobenito committed Mar 13, 2024
2 parents 983e12b + e9838da commit 141d0d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct(

public function add(string $id, $concrete = null): DefinitionInterface
{
$concrete = $concrete ?? $id;
$concrete ??= $id;

if (true === $this->defaultToShared) {
return $this->addShared($id, $concrete);
Expand All @@ -74,7 +74,7 @@ public function add(string $id, $concrete = null): DefinitionInterface

public function addShared(string $id, $concrete = null): DefinitionInterface
{
$concrete = $concrete ?? $id;
$concrete ??= $id;
return $this->definitions->addShared($id, $concrete);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Definition/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Definition implements ArgumentResolverInterface, DefinitionInterface
*/
public function __construct(string $id, $concrete = null)
{
$concrete = $concrete ?? $id;
$concrete ??= $id;
$this->alias = $id;
$this->concrete = $concrete;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ReflectionContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function has($id): bool

public function call(callable $callable, array $args = [])
{
if (is_string($callable) && strpos($callable, '::') !== false) {
if (is_string($callable) && str_contains($callable, '::')) {
$callable = explode('::', $callable);
}

Expand Down

0 comments on commit 141d0d6

Please sign in to comment.