Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c05c38f

Browse filesBrowse files
committed
bug #18436 fix Autowiring tests of #18144 (HeahDude)
This PR was merged into the 3.1-dev branch. Discussion ---------- fix Autowiring tests of #18144 | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | Tests pass? | yes | Fixed issue | symfony/symfony#18422 (comment) | License | MIT Commits ------- 0cbf04a [DI] fix Autowiring tests of #18144
2 parents 0a4a24f + cbcff2d commit c05c38f
Copy full SHA for c05c38f

File tree

Expand file treeCollapse file tree

1 file changed

+14
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-1
lines changed

‎Config/AutowireServiceResource.php

Copy file name to clipboardExpand all lines: Config/AutowireServiceResource.php
+14-1Lines changed: 14 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,19 @@ 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+
return (array) $this === (array) AutowirePass::createResourceForClass($reflectionClass);
3649
}
3750

3851
public function __toString()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.