10000 fix Autowiring tests of #18144 · symfony/symfony@1e94811 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e94811

Browse files
committed
fix Autowiring tests of #18144
1 parent a9dcce1 commit 1e94811

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Config;
1313

1414
use Symfony\Component\Config\Resource\SelfCheckingResourceInterface;
15+
use Symfony\Component\DependencyInjection\Compiler\AutowirePass;
1516

1617
class AutowireServiceResource implements SelfCheckingResourceInterface, \Serializable
1718
{
@@ -32,7 +33,21 @@ public function isFresh($timestamp)
3233
return false;
3334
}
3435

35-
return @filemtime($this->filePath) <= $timestamp;
36+
// has the file *not* been modified? Definitely fresh
37+
if (@filemtime($this->filePath) <= $timestamp) {
38+
return true;
39+
}
40+
41+
try {
42+
$reflectionClass = new \ReflectionClass($this->class);
43+
} catch (\ReflectionException $e) {
44+
// the class does not exist anymore!
45+
return false;
46+
}
47+
48+
$newSelf = AutowirePass::createResourceForClass($reflectionClass);
49+
50+
return $this == $newSelf;
3651
}
3752

3853
public function __toString()

0 commit comments

Comments
 (0)
0