Issues (3641)

Kernel/ClassResolver/Cache/AbstractProvider.php (1 issue)

1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace Spryker\Shared\Kernel\ClassResolver\Cache;
9
10
use Spryker\Shared\Kernel\ClassResolver\ResolverCache;
11
12
/**
13
 * @deprecated Use {@link \Spryker\Shared\Kernel\KernelConstants::RESOLVABLE_CLASS_NAMES_CACHE_ENABLED} instead.
14
 */
15
abstract class AbstractProvider implements ProviderInterface
16
{
17
    /**
18
     * @var \Spryker\Shared\Kernel\ClassResolver\ResolverCacheInterface
19
     */
20
    protected $cache;
21
22
    /**
23
     * @return \Spryker\Shared\Kernel\ClassResolver\Cache\StorageInterface
24
     */
25
    abstract protected function buildStorage();
26
27
    /**
28
     * @return \Spryker\Shared\Kernel\ClassResolver\ResolverCacheInterface
29
     */
30
    public function getCache()
31
    {
32
        if ($this->cache === null) {
33
            $this->cache = new ResolverCache(
0 ignored issues
show
Deprecated Code introduced by
The class Spryker\Shared\Kernel\ClassResolver\ResolverCache has been deprecated: Use {@link \Spryker\Shared\Kernel\KernelConstants::RESOLVABLE_CLASS_NAMES_CACHE_ENABLED} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

33
            $this->cache = /** @scrutinizer ignore-deprecated */ new ResolverCache(
Loading history...
34
                $this->buildStorage(),
35
            );
36
        }
37
38
        return $this->cache;
39
    }
40
}
41