Completed
Push — travis_trusty ( e78e49...6f0d6f )
by André
54:54 queued 34:46
created

ConfigResolverCleanup::isOptional()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
/**
4
 * File containing the ConfigResolverCleanup class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 *
9
 * @version //autogentag//
10
 */
11
namespace eZ\Bundle\EzPublishCoreBundle\Cache\Warmer;
12
13
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
14
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
15
16
/**
17
 * This cache warmer ensures that ConfigResolver is correctly reset after cache warmup process.
18
 * @link https://jira.ez.no/browse/EZP-25098
19
 */
20
class ConfigResolverCleanup implements CacheWarmerInterface
21
{
22
    use ContainerAwareTrait;
23
24
    public function isOptional()
25
    {
26
        return false;
27
    }
28
29
    public function warmUp($cacheDir)
30
    {
31
        $this->container->set('ezpublish.config.resolver.core', null);
0 ignored issues
show
Documentation introduced by
null is of type null, but the function expects a object.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
32
        $this->container->set('ezpublish.config.resolver.chain', null);
0 ignored issues
show
Documentation introduced by
null is of type null, but the function expects a object.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
33
    }
34
}
35