X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fconfig%2FResource%2FDirectoryResource.php;h=07280b4b877f2b4222a6e7f697280bb76c4ac760;hp=ebc930c090742ec309c0ee6549e57b77ade76100;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/symfony/config/Resource/DirectoryResource.php b/vendor/symfony/config/Resource/DirectoryResource.php index ebc930c09..07280b4b8 100644 --- a/vendor/symfony/config/Resource/DirectoryResource.php +++ b/vendor/symfony/config/Resource/DirectoryResource.php @@ -26,11 +26,17 @@ class DirectoryResource implements SelfCheckingResourceInterface, \Serializable * * @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 +48,7 @@ class DirectoryResource implements SelfCheckingResourceInterface, \Serializable } /** - * {@inheritdoc} + * @return string The file path to the resource */ public function getResource() {