Completed
Pull Request — master (#3)
by Jacob
02:35
created

MetadataWarmer::warmUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace As3\Bundle\ModlrBundle\CacheWarmer;
4
5
use As3\Modlr\Metadata\Cache\CacheWarmer;
6
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
7
8
/**
9
 * Symfony cache warmer wrapper for model metadata.
10
 *
11
 * @author  Jacob Bare <[email protected]>
12
 */
13
class MetadataWarmer implements CacheWarmerInterface
14
{
15
    /**
16
     * The Modlr cache warmer.
17
     *
18
     * @var CacheWarmer
19
     */
20
    protected $warmer;
21
22
    /**
23
     * Constructor.
24
     *
25
     * @param   CacheWarmer     $warmer
26
     */
27
    public function __construct(CacheWarmer $warmer)
28
    {
29
        $this->warmer = $warmer;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function warmUp($cacheDir)
36
    {
37
        $this->warmer->warm();
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function isOptional()
44
    {
45
        return false;
46
    }
47
}
48