Merge pull request #183 from pamil/run-static-analysis-sf6

This commit is contained in:
Kamil Kokot
2021-12-13 13:23:12 +00:00
committed by GitHub
6 changed files with 37 additions and 16 deletions

View File

@@ -42,20 +42,18 @@ jobs:
tools: composer:v2, flex tools: composer:v2, flex
- name: Validate composer.json - name: Validate composer.json
run: composer validate --no-check-lock run: composer validate --strict
- name: Remove analysis dependencies
run: composer remove --dev --no-update sylius-labs/coding-standard vimeo/psalm
if: matrix.symfony-version == '6.0.*'
- name: Install dependencies - name: Install dependencies
run: composer install --prefer-dist --no-progress run: composer install --prefer-dist --no-progress
env: env:
SYMFONY_REQUIRE: "${{ matrix.symfony-version }}" SYMFONY_REQUIRE: "${{ matrix.symfony-version }}"
- name: Run analysis - name: Run coding standard
run: composer analyse run: vendor/bin/ecs check --ansi --no-progress-bar src tests
if: matrix.symfony-version != '6.0.*'
- name: Run Psalm
run: vendor/bin/psalm src --no-progress --php-version="${{ matrix.php-version }}"
- name: Run tests - name: Run tests
run: composer test run: composer test

View File

@@ -24,7 +24,7 @@
"friends-of-behat/mink-extension": "^2.5", "friends-of-behat/mink-extension": "^2.5",
"friends-of-behat/page-object-extension": "^0.3.2", "friends-of-behat/page-object-extension": "^0.3.2",
"friends-of-behat/service-container-extension": "^1.1", "friends-of-behat/service-container-extension": "^1.1",
"sylius-labs/coding-standard": "^3.2", "sylius-labs/coding-standard": "^4.1.1",
"symfony/browser-kit": "^4.4 || ^5.1 || ^6.0", "symfony/browser-kit": "^4.4 || ^5.1 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.1 || ^6.0", "symfony/framework-bundle": "^4.4 || ^5.1 || ^6.0",
"symfony/process": "^4.4 || ^5.1 || ^6.0", "symfony/process": "^4.4 || ^5.1 || ^6.0",

View File

@@ -1,2 +0,0 @@
imports:
- { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' }

9
ecs.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(__DIR__ . '/vendor/sylius-labs/coding-standard/ecs.php');
};

View File

@@ -27,5 +27,12 @@
<file name="src/Mink/MinkParameters.php" /> <file name="src/Mink/MinkParameters.php" />
</errorLevel> </errorLevel>
</InvalidAttribute> </InvalidAttribute>
<!-- Workaround for https://github.com/vimeo/psalm/issues/7026 -->
<ReservedWord>
<errorLevel type="suppress">
<directory name="src" />
</errorLevel>
</ReservedWord>
</issueHandlers> </issueHandlers>
</psalm> </psalm>

View File

@@ -78,7 +78,8 @@ CON
*/ */
public function workingSymfonyApplicationWithExtension(): void public function workingSymfonyApplicationWithExtension(): void
{ {
$this->thereIsConfiguration(<<<'CON' $this->thereIsConfiguration(
<<<'CON'
default: default:
extensions: extensions:
FriendsOfBehat\SymfonyExtension: FriendsOfBehat\SymfonyExtension:
@@ -89,7 +90,9 @@ CON
$this->standardSymfonyAutoloaderConfigured(); $this->standardSymfonyAutoloaderConfigured();
$this->thereIsFile('src/Kernel.php', <<<'CON' $this->thereIsFile(
'src/Kernel.php',
<<<'CON'
<?php <?php
declare(strict_types=1); declare(strict_types=1);
@@ -140,7 +143,9 @@ class Kernel extends HttpKernel
CON CON
); );
$this->thereIsFile('src/Controller.php', <<<'CON' $this->thereIsFile(
'src/Controller.php',
<<<'CON'
<?php <?php
declare(strict_types=1); declare(strict_types=1);
@@ -168,7 +173,9 @@ final class Controller
CON CON
); );
$this->thereIsFile('src/Counter.php', <<<'CON' $this->thereIsFile(
'src/Counter.php',
<<<'CON'
<?php <?php
declare(strict_types=1); declare(strict_types=1);
@@ -192,7 +199,9 @@ final class Counter
CON CON
); );
$this->thereIsFile('config/default.yaml', <<<'YML' $this->thereIsFile(
'config/default.yaml',
<<<'YML'
services: services:
App\Controller: App\Controller:
arguments: arguments: