Issues (12)

src/console.php (1 issue)

Labels
Severity
1
#!/usr/bin/env php
2
<?php
3
4
/**
5
 * Gitlab webhookd
6
 *
7
 * @author  James Zhu <[email protected]>
8
 * @license MIT https://mit-license.org/
9
 */
10
11
declare(strict_types=1);
12
13
require __DIR__ . '/vendor/autoload.php';
14
15
use Symfony\Component\Config\FileLocator;
16
use Symfony\Component\Console\Application;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
19
20
$container = new ContainerBuilder();
21
22
$loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/config'));
23
$loader->load('services.php');
24
25
$application = new Application();
26
$application->setCommandLoader($container->get('console.command_loader'));
0 ignored issues
show
It seems like $container->get('console.command_loader') can also be of type null; however, parameter $commandLoader of Symfony\Component\Consol...ion::setCommandLoader() does only seem to accept Symfony\Component\Consol...\CommandLoaderInterface, maybe add an additional type check? ( Ignorable by Annotation )

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

26
$application->setCommandLoader(/** @scrutinizer ignore-type */ $container->get('console.command_loader'));
Loading history...
27
$application->run();
28