X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fconfig%2FResource%2FDirectoryResource.php;h=b1786397d18655ebba9a165385c237a106749d9f;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=ebc930c090742ec309c0ee6549e57b77ade76100;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/config/Resource/DirectoryResource.php b/vendor/symfony/config/Resource/DirectoryResource.php index ebc930c09..b1786397d 100644 --- a/vendor/symfony/config/Resource/DirectoryResource.php +++ b/vendor/symfony/config/Resource/DirectoryResource.php @@ -22,15 +22,19 @@ class DirectoryResource implements SelfCheckingResourceInterface, \Serializable private $pattern; /** - * Constructor. - * * @param string $resource The file path to the resource * @param string|null $pattern A pattern to restrict monitored files + * + * @throws \InvalidArgumentException */ public function __construct($resource, $pattern = null) { - $this->resource = $resource; + $this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false); $this->pattern = $pattern; + + if (false === $this->resource || !is_dir($this->resource)) { + throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist.', $resource)); + } } /** @@ -42,7 +46,7 @@ class DirectoryResource implements SelfCheckingResourceInterface, \Serializable } /** - * {@inheritdoc} + * @return string The file path to the resource */ public function getResource() {