Issues (14)

src/Command/AbstractCommand.php (1 issue)

Labels
Severity
1
<?php
2
3
/*
4
 * This file is part of CacheTool.
5
 *
6
 * (c) Samuel Gordalina <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CacheTool\Command;
13
14
use Symfony\Component\Console\Command\Command;
15
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
16
use Symfony\Component\DependencyInjection\ContainerInterface;
17
18
abstract class AbstractCommand extends Command implements ContainerAwareInterface
19
{
20
    /**
21
     * @var ContainerInterface
22
     */
23
    protected $container;
24
25
    /**
26
     * @return CacheTool
0 ignored issues
show
The type CacheTool\Command\CacheTool was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
     */
28 14
    protected function getCacheTool()
29
    {
30 14
        return $this->container->get('cachetool');
31
    }
32
33
    /**
34
     * @param  string $extension
35
     */
36 14
    protected function ensureExtensionLoaded($extension)
37
    {
38 14
        if (!$this->getCacheTool()->extension_loaded($extension)) {
39
            throw new \Exception("Extension `{$extension}` is not loaded");
40
        }
41 12
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 14
    public function setContainer(ContainerInterface $container = null)
47
    {
48 14
        $this->container = $container;
49 14
    }
50
}
51