diff --git a/application/Espo/Core/Binding/BindingContainer.php b/application/Espo/Core/Binding/BindingContainer.php index ad3e9c7eb0..f6c18a1098 100644 --- a/application/Espo/Core/Binding/BindingContainer.php +++ b/application/Espo/Core/Binding/BindingContainer.php @@ -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() ) { diff --git a/tests/unit/Espo/Core/Binding/BindingContainerTest.php b/tests/unit/Espo/Core/Binding/BindingContainerTest.php index a0a5f604f8..036d049ddc 100644 --- a/tests/unit/Espo/Core/Binding/BindingContainerTest.php +++ b/tests/unit/Espo/Core/Binding/BindingContainerTest.php @@ -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()); - }*/ + } }