ConsoleFacade::getContainerStats()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Console;
6
7
use Gacela\Console\Domain\AllAppModules\AppModule;
8
use Gacela\Console\Domain\CommandArguments\CommandArguments;
9
use Gacela\Framework\AbstractFacade;
10
11
/**
12
 * @extends AbstractFacade<ConsoleFactory>
13
 */
14
final class ConsoleFacade extends AbstractFacade
15
{
16
    public function sanitizeFilename(string $filename): string
17
    {
18
        return $this->getFactory()
19
            ->createFilenameSanitizer()
0 ignored issues
show
Bug introduced by
The method createFilenameSanitizer() does not exist on Gacela\Framework\AbstractFactory. It seems like you code against a sub-type of Gacela\Framework\AbstractFactory such as GacelaTest\Benchmark\FileCache\ModuleC\FactoryC or GacelaTest\Benchmark\FileCache\ModuleE\FactoryE or GacelaTest\Benchmark\Fil...\ModuleG\ModuleGFactory or GacelaTest\Benchmark\FileCache\ModuleA\FactoryA or GacelaTest\Feature\Frame...ileCache\Module\Factory or Gacela\Console\ConsoleFactory or GacelaTest\Benchmark\FileCache\ModuleB\FactoryB or GacelaTest\Benchmark\FileCache\ModuleD\FactoryD or GacelaTest\Benchmark\FileCache\ModuleF\Factory. ( Ignorable by Annotation )

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

19
            ->/** @scrutinizer ignore-call */ createFilenameSanitizer()
Loading history...
20
            ->sanitize($filename);
21
    }
22
23
    public function parseArguments(string $desiredNamespace): CommandArguments
24
    {
25
        return $this->getFactory()
26
            ->createCommandArgumentsParser()
0 ignored issues
show
Bug introduced by
The method createCommandArgumentsParser() does not exist on Gacela\Framework\AbstractFactory. It seems like you code against a sub-type of Gacela\Framework\AbstractFactory such as GacelaTest\Benchmark\FileCache\ModuleC\FactoryC or GacelaTest\Benchmark\FileCache\ModuleE\FactoryE or GacelaTest\Benchmark\Fil...\ModuleG\ModuleGFactory or GacelaTest\Benchmark\FileCache\ModuleA\FactoryA or GacelaTest\Feature\Frame...ileCache\Module\Factory or Gacela\Console\ConsoleFactory or GacelaTest\Benchmark\FileCache\ModuleB\FactoryB or GacelaTest\Benchmark\FileCache\ModuleD\FactoryD or GacelaTest\Benchmark\FileCache\ModuleF\Factory. ( Ignorable by Annotation )

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

26
            ->/** @scrutinizer ignore-call */ createCommandArgumentsParser()
Loading history...
27
            ->parse($desiredNamespace);
28
    }
29
30
    public function generateFileContent(
31
        CommandArguments $commandArguments,
32
        string $filename,
33
        bool $withShortName = false,
34
    ): string {
35
        return $this->getFactory()
36
            ->createFileContentGenerator()
0 ignored issues
show
Bug introduced by
The method createFileContentGenerator() does not exist on Gacela\Framework\AbstractFactory. It seems like you code against a sub-type of Gacela\Framework\AbstractFactory such as GacelaTest\Benchmark\FileCache\ModuleC\FactoryC or GacelaTest\Benchmark\FileCache\ModuleE\FactoryE or GacelaTest\Benchmark\Fil...\ModuleG\ModuleGFactory or GacelaTest\Benchmark\FileCache\ModuleA\FactoryA or GacelaTest\Feature\Frame...ileCache\Module\Factory or Gacela\Console\ConsoleFactory or GacelaTest\Benchmark\FileCache\ModuleB\FactoryB or GacelaTest\Benchmark\FileCache\ModuleD\FactoryD or GacelaTest\Benchmark\FileCache\ModuleF\Factory. ( Ignorable by Annotation )

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

36
            ->/** @scrutinizer ignore-call */ createFileContentGenerator()
Loading history...
37
            ->generate($commandArguments, $filename, $withShortName);
38
    }
39
40
    /**
41
     * @return list<AppModule>
42
     */
43
    public function findAllAppModules(string $filter = ''): array
44
    {
45
        return $this->getFactory()
46
            ->createAllAppModulesFinder()
0 ignored issues
show
Bug introduced by
The method createAllAppModulesFinder() does not exist on Gacela\Framework\AbstractFactory. It seems like you code against a sub-type of Gacela\Framework\AbstractFactory such as GacelaTest\Benchmark\FileCache\ModuleC\FactoryC or GacelaTest\Benchmark\FileCache\ModuleE\FactoryE or GacelaTest\Benchmark\Fil...\ModuleG\ModuleGFactory or GacelaTest\Benchmark\FileCache\ModuleA\FactoryA or GacelaTest\Feature\Frame...ileCache\Module\Factory or Gacela\Console\ConsoleFactory or GacelaTest\Benchmark\FileCache\ModuleB\FactoryB or GacelaTest\Benchmark\FileCache\ModuleD\FactoryD or GacelaTest\Benchmark\FileCache\ModuleF\Factory. ( Ignorable by Annotation )

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

46
            ->/** @scrutinizer ignore-call */ createAllAppModulesFinder()
Loading history...
47
            ->findAllAppModules($filter);
48
    }
49
50
    /**
51
     * @return array{
52
     *     registered_services: int,
53
     *     frozen_services: int,
54
     *     factory_services: int,
55
     *     bindings: int,
56
     *     cached_dependencies: int,
57
     *     memory_usage: string
58
     * }
59
     */
60
    public function getContainerStats(): array
61
    {
62
        return $this->getFactory()->getContainerStats();
0 ignored issues
show
Bug introduced by
The method getContainerStats() does not exist on Gacela\Framework\AbstractFactory. Did you maybe mean getContainer()? ( Ignorable by Annotation )

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

62
        return $this->getFactory()->/** @scrutinizer ignore-call */ getContainerStats();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
63
    }
64
65
    /**
66
     * @param class-string $className
67
     *
68
     * @return list<string>
69
     */
70
    public function getContainerDependencyTree(string $className): array
71
    {
72
        return $this->getFactory()->getContainerDependencyTree($className);
0 ignored issues
show
Bug introduced by
The method getContainerDependencyTree() does not exist on Gacela\Framework\AbstractFactory. Did you maybe mean getContainer()? ( Ignorable by Annotation )

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

72
        return $this->getFactory()->/** @scrutinizer ignore-call */ getContainerDependencyTree($className);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
73
    }
74
}
75