Completed
Push — develop ( 718564...9c3bcc )
by Wachter
06:08
created

JsonSchemaCacheWarmer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 62.5%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 28
ccs 5
cts 8
cp 0.625
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isOptional() 0 4 1
A warmUp() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
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 Sulu\Bundle\ValidationBundle\JsonSchema;
13
14
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
15
16
/**
17
 * Cache warmer for CachedSchemaStorage.
18
 */
19
class JsonSchemaCacheWarmer implements CacheWarmerInterface
20
{
21
    /**
22
     * @var CachedSchemaStorageInterface
23
     */
24
    private $cachedSchemaStorage;
25
26 1
    public function __construct(CachedSchemaStorageInterface $cachedSchemaStorage)
27
    {
28 1
        $this->cachedSchemaStorage = $cachedSchemaStorage;
29 1
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 1
    public function isOptional()
35
    {
36 1
        return true;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function warmUp($cacheDir)
43
    {
44
        $this->cachedSchemaStorage->initializeCache();
45
    }
46
}
47