|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of the Symfony framework. |
|
|
5 |
* |
|
|
6 |
* (c) Fabien Potencier <fabien@symfony.com> |
|
|
7 |
* |
|
|
8 |
* This source file is subject to the MIT license that is bundled |
|
|
9 |
* with this source code in the file LICENSE. |
|
|
10 |
*/ |
|
|
11 |
|
|
|
12 |
namespace Symfony\Bundle\AsseticBundle\Config; |
|
|
13 |
|
|
|
14 |
use Assetic\Factory\Resource\ResourceInterface as AsseticResourceInterface; |
|
|
15 |
use Symfony\Component\Config\Resource\ResourceInterface as SymfonyResourceInterface; |
|
|
16 |
|
|
|
17 |
/** |
|
|
18 |
* Turns an Assetic resource into a Symfony one. |
|
|
19 |
* |
|
|
20 |
* @author Kris Wallsmith <kris@symfony.com> |
|
|
21 |
*/ |
|
|
22 |
class AsseticResource implements SymfonyResourceInterface |
|
|
23 |
{ |
|
|
24 |
private $resource; |
|
|
25 |
|
|
|
26 |
public function __construct(AsseticResourceInterface $resource) |
|
|
27 |
{ |
|
|
28 |
$this->resource = $resource; |
|
|
29 |
} |
|
|
30 |
|
|
|
31 |
public function __toString() |
|
|
32 |
{ |
|
|
33 |
return (string) $this->resource; |
|
|
34 |
} |
|
|
35 |
|
|
|
36 |
public function isFresh($timestamp) |
|
|
37 |
{ |
|
|
38 |
return $this->resource->isFresh($timestamp); |
|
|
39 |
} |
|
|
40 |
|
|
|
41 |
/** |
|
|
42 |
* Returns the Assetic resource. |
|
|
43 |
* |
|
|
44 |
* @return AsseticResourceInterface The wrapped Assetic resource |
|
|
45 |
*/ |
|
|
46 |
public function getResource() |
|
|
47 |
{ |
|
|
48 |
return $this->resource; |
|
|
49 |
} |
|
|
50 |
} |