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\DependencyInjection\Config;
14 use Symfony\Component\Config\Resource\ResourceInterface;
15 use Symfony\Component\Config\ResourceCheckerInterface;
16 use Symfony\Component\DependencyInjection\ContainerInterface;
19 * @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
21 class ContainerParametersResourceChecker implements ResourceCheckerInterface
23 /** @var ContainerInterface */
26 public function __construct(ContainerInterface $container)
28 $this->container = $container;
34 public function supports(ResourceInterface $metadata)
36 return $metadata instanceof ContainerParametersResource;
42 public function isFresh(ResourceInterface $resource, $timestamp)
44 foreach ($resource->getParameters() as $key => $value) {
45 if (!$this->container->hasParameter($key) || $this->container->getParameter($key) !== $value) {