Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix wrong copy/paste
  • Loading branch information
chbruyand committed May 29, 2015
commit 41715cdd1e93bd3040cb9d65e250000c83365dd1
10 changes: 10 additions & 0 deletions src/Symfony/Component/Config/Resource/FileExistenceResource.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* This file is part of the Symfony package.
*
Expand All @@ -7,7 +8,9 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Config\Resource;

/**
* FileExistenceResource represents a resource stored on the filesystem.
* Freshness is only evaluated against resource creation or deletion.
Expand All @@ -19,7 +22,9 @@
class FileExistenceResource implements ResourceInterface, \Serializable
{
private $resource;

private $exists;

/**
* Constructor.
*
Expand All @@ -30,34 +35,39 @@ public function __construct($resource)
$this->resource = $resource;
$this->exists = file_exists($resource);
}

/**
* {@inheritdoc}
*/
public function __toString()
{
return (string) $this->resource;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do the string casting in the constructor already.

}

/**
* {@inheritdoc}
*/
public function getResource()
{
return $this->resource;
}

/**
* {@inheritdoc}
*/
public function isFresh($timestamp)
{
return file_exists($this->resource) === $this->exists;
}

/**
* {@inheritdoc}
*/
public function serialize()
{
return serialize(array($this->resource, $this->exists));
}

/**
* {@inheritdoc}
*/
Expand Down