Completed
Pull Request — develop (#14)
by Michael
02:56 queued 52s
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 2
Bugs 0 Features 1
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 2
b 0
f 1
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
class JsonSchemaCacheWarmer implements CacheWarmerInterface
17
{
18
    /**
19
     * @var CachedSchemaStorage
20
     */
21
    private $cachedSchemaStorage;
22
23 1
    public function __construct(CachedSchemaStorage $cachedSchemaStorage)
24
    {
25 1
        $this->cachedSchemaStorage = $cachedSchemaStorage;
26 1
    }
27
28 1
    public function isOptional()
29
    {
30 1
        return true;
31
    }
32
33
    /**
34
     * @param string $cacheDir The cache directory
35
     */
36
    public function warmUp($cacheDir)
37
    {
38
        $this->cachedSchemaStorage->initializeCache();
39
    }
40
}
41