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

JsonSchemaCacheWarmer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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