8000 fix Autowiring tests of #18144 by HeahDude · Pull Request #18436 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

fix Autowiring tests of #18144 #18436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6281
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection\Config;

use Symfony\Component\Config\Resource\SelfCheckingResourceInterface;
use Symfony\Component\DependencyInjection\Compiler\AutowirePass;

class AutowireServiceResource implements SelfCheckingResourceInterface, \Serializable
{
Expand All @@ -32,7 +33,19 @@ public function isFresh($timestamp)
return false;
}

return @filemtime($this->filePath) <= $timestamp;
// has the file *not* been modified? Definitely fresh
if (@filemtime($this->filePath) <= $timestamp) {
return true;
}

try {
$reflectionClass = new \ReflectionClass($this->class);
} catch (\ReflectionException $e) {
// the class does not exist anymore!
return false;
}

return (array) $this === (array) AutowirePass::createResourceForClass($reflectionClass);
}

public function __toString()
Expand Down
0