Skip to content

Commit ed1f8df

Browse files
Merge branch '3.1'
* 3.1: [PhpUnitBridge] Fix undefined variable Compatibility with Twig 1.27 Remove extra line in doc-block comment [VarDumper] Fix dumping Twig source in stack traces Enhance GAE compat by removing some realpath() [DependencyInjection] Remove old code in XML loader bumped Symfony version to 3.1.7 updated VERSION for 3.1.6 updated CHANGELOG for 3.1.6 bumped Symfony version to 2.8.14 updated VERSION for 2.8.13 updated CHANGELOG for 2.8.13 bumped Symfony version to 2.7.21 updated VERSION for 2.7.20 update CONTRIBUTORS for 2.7.20 updated CHANGELOG for 2.7.20 [SecurityBundle] Fix twig-bridge lowest dep
2 parents 80af51a + 6a2e115 commit ed1f8df

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Resource/DirectoryResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class DirectoryResource implements SelfCheckingResourceInterface, \Serializable
3131
*/
3232
public function __construct($resource, $pattern = null)
3333
{
34-
$this->resource = realpath($resource);
34+
$this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false);
3535
$this->pattern = $pattern;
3636

3737
if (false === $this->resource || !is_dir($this->resource)) {

Resource/FileResource.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ class FileResource implements SelfCheckingResourceInterface, \Serializable
3434
*/
3535
public function __construct($resource)
3636
{
37-
$this->resource = realpath($resource);
38-
39-
if (false === $this->resource && file_exists($resource)) {
40-
$this->resource = $resource;
41-
}
37+
$this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false);
4238

4339
if (false === $this->resource) {
4440
throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $resource));

0 commit comments

Comments
 (0)