projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull merge.
[yaffs-website]
/
vendor
/
symfony
/
config
/
Resource
/
DirectoryResource.php
diff --git
a/vendor/symfony/config/Resource/DirectoryResource.php
b/vendor/symfony/config/Resource/DirectoryResource.php
index ebc930c090742ec309c0ee6549e57b77ade76100..b1786397d18655ebba9a165385c237a106749d9f 100644
(file)
--- 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;
/**
private $pattern;
/**
- * Constructor.
- *
* @param string $resource The file path to the resource
* @param string|null $pattern A pattern to restrict monitored files
* @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)
{
*/
public function __construct($resource, $pattern = null)
{
- $this->resource =
$resource
;
+ $this->resource =
realpath($resource) ?: (file_exists($resource) ? $resource : false)
;
$this->pattern = $pattern;
$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()
{
*/
public function getResource()
{