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

MetadataWarmer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A warmUp() 0 4 1
A isOptional() 0 4 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