Completed
Push — master ( a70ca2...b8c2a5 )
by Daniel
14:22
created

MethodRouterCacheWarmer::warmUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
3
namespace Cmobi\RabbitmqBundle\Routing\CacheWarmer;
4
5
use Cmobi\RabbitmqBundle\Routing\MethodRouter;
6
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
7
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
8
9
10
class MethodRouterCacheWarmer implements CacheWarmerInterface
11
{
12
    protected $router;
13
14
    public function __construct(MethodRouter $router)
15
    {
16
        $this->router = $router;
17
    }
18
19
    public function warmUp($cacheDir)
20
    {
21
        if ($this->router instanceof WarmableInterface) {
22
            $this->router->warmUp($cacheDir);
23
        }
24
    }
25
26
    public function isOptional()
27
    {
28
        return true;
29
    }
30
}
31