mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 04:39:37 +03:00
Added phpstan-symfony plugin to improve inspections on getArgument and getOption
This commit is contained in:
parent
b8fa234dbb
commit
934d266880
7 changed files with 27 additions and 9 deletions
7
bin/cli
7
bin/cli
|
@ -3,5 +3,8 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
$run = require __DIR__ . '/../config/run.php';
|
||||
$run(true);
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
/** @var Application $app */
|
||||
$app = require __DIR__ . '/../config/cli-app.php';
|
||||
$app->run();
|
||||
|
|
|
@ -66,7 +66,8 @@
|
|||
"eaglewu/swoole-ide-helper": "dev-master",
|
||||
"infection/infection": "^0.21.0",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
"phpstan/phpstan": "^0.12.64",
|
||||
"phpstan/phpstan": "^0.12.92",
|
||||
"phpstan/phpstan-symfony": "^0.12.41",
|
||||
"phpunit/php-code-coverage": "^9.2",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"roave/security-advisories": "dev-master",
|
||||
|
|
12
config/cli-app.php
Normal file
12
config/cli-app.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Symfony\Component\Console\Application as CliApp;
|
||||
|
||||
return (static function () {
|
||||
/** @var ContainerInterface $container */
|
||||
$container = include __DIR__ . '/container.php';
|
||||
return $container->get(CliApp::class);
|
||||
})();
|
|
@ -6,7 +6,7 @@ use Doctrine\ORM\EntityManager;
|
|||
use Doctrine\ORM\Tools\Console\ConsoleRunner;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return (function () {
|
||||
return (static function () {
|
||||
/** @var ContainerInterface $container */
|
||||
$container = include __DIR__ . '/container.php';
|
||||
$em = $container->get(EntityManager::class);
|
||||
|
|
|
@ -4,12 +4,11 @@ declare(strict_types=1);
|
|||
|
||||
use Mezzio\Application;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Symfony\Component\Console\Application as CliApp;
|
||||
|
||||
return function (bool $isCli = false): void {
|
||||
return static function (): void {
|
||||
/** @var ContainerInterface $container */
|
||||
$container = include __DIR__ . '/container.php';
|
||||
$app = $container->get($isCli ? CliApp::class : Application::class);
|
||||
$app = $container->get(Application::class);
|
||||
|
||||
$app->run();
|
||||
};
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
includes:
|
||||
- vendor/phpstan/phpstan-symfony/extension.neon
|
||||
parameters:
|
||||
checkMissingIterableValueType: false
|
||||
checkGenericClassInNonGenericObjectType: false
|
||||
ignoreErrors:
|
||||
- '#If condition is always false#'
|
||||
symfony:
|
||||
console_application_loader: 'config/cli-app.php'
|
||||
|
|
|
@ -2,5 +2,4 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
$run = require __DIR__ . '/../config/run.php';
|
||||
$run();
|
||||
(require __DIR__ . '/../config/run.php')();
|
||||
|
|
Loading…
Reference in a new issue