4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Config;
14 use Symfony\Component\Config\Resource\ResourceInterface;
17 * Interface for ResourceCheckers.
19 * When a ResourceCheckerConfigCache instance is checked for freshness, all its associated
20 * metadata resources are passed to ResourceCheckers. The ResourceCheckers
21 * can then inspect the resources and decide whether the cache can be considered
24 * @author Matthias Pigulla <mp@webfactory.de>
25 * @author Benjamin Klotz <bk@webfactory.de>
27 interface ResourceCheckerInterface
30 * Queries the ResourceChecker whether it can validate a given
33 * @param ResourceInterface $metadata The resource to be checked for freshness
35 * @return bool True if the ResourceChecker can handle this resource type, false if not
37 public function supports(ResourceInterface $metadata);
40 * Validates the resource.
42 * @param ResourceInterface $resource The resource to be validated
43 * @param int $timestamp The timestamp at which the cache associated with this resource was created
45 * @return bool True if the resource has not changed since the given timestamp, false otherwise
47 public function isFresh(ResourceInterface $resource, $timestamp);