binding value conflict handling
This commit is contained in:
@@ -121,11 +121,9 @@ class BindingContainer
|
||||
$key &&
|
||||
$this->data->hasContext($className, $key)
|
||||
) {
|
||||
// @todo For v7.6. Uncomment, then remove the return statement below.
|
||||
/*$binding = $this->data->getContext($className, $key);
|
||||
$binding = $this->data->getContext($className, $key);
|
||||
|
||||
$notMatching =
|
||||
$type &&
|
||||
$type instanceof ReflectionNamedType &&
|
||||
!$type->isBuiltin() &&
|
||||
$binding->getType() === Binding::VALUE &&
|
||||
@@ -133,15 +131,12 @@ class BindingContainer
|
||||
|
||||
if (!$notMatching) {
|
||||
return $binding;
|
||||
}*/
|
||||
|
||||
return $this->data->getContext($className, $key);
|
||||
}
|
||||
}
|
||||
|
||||
$dependencyClassName = null;
|
||||
|
||||
if (
|
||||
$type &&
|
||||
$type instanceof ReflectionNamedType &&
|
||||
!$type->isBuiltin()
|
||||
) {
|
||||
|
||||
@@ -646,7 +646,7 @@ class BindingContainerTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertTrue($container->hasByParam($class3, $param3));
|
||||
}
|
||||
|
||||
/*public function testTypedParamWithScalarBound1(): void
|
||||
public function testTypedParamWithScalarBound1(): void
|
||||
{
|
||||
$container = BindingContainerBuilder::create()
|
||||
->inContext(Class0::class, function (ContextualBinder $binder): void {
|
||||
@@ -681,5 +681,5 @@ class BindingContainerTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$this->assertEquals(Binding::VALUE, $binding->getType());
|
||||
$this->assertInstanceOf(Class1::class, $binding->getValue());
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user