diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85855e3..7d35142 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,34 +26,49 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} lint: + name: Lint runs-on: ubuntu-latest + env: + php_ver: '8.4' steps: - - name: Lint - run: echo "lint" + - uses: actions/checkout@v4 + - name: Validate composer.json and composer.lock + run: composer validate --strict + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ env.php_ver }} + #extensions: pdo_sqlite, sqlite3, mbstring + coverage: none + - name: Install dependencies + run: composer install --no-autoloader --no-progress && composer dump-autoload --classmap-authoritative --strict-psr --strict-ambiguous + - name: Run phpcs + run: php ./vendor/bin/phpcs + - name: Run phpstan + run: php ./vendor/bin/phpstan analyze + - name: Run phpcs-check-feature-completeness + run: php ./vendor/bin/phpcs-check-feature-completeness + - name: Run export-ignore + run: php ./vendor/bin/export-ignore test: runs-on: ubuntu-latest - # strategy: - # matrix: - # php-versions: ['8.2', '8.3', '8.4', '8.5'] - # coverage: [false] - # exclude: - # - php-versions: '8.4' - # coverage: false - # include: - # - php-versions: '8.4' - # coverage: true + strategy: + matrix: + php-versions: ['8.2', '8.3', '8.4', '8.5'] + coverage: [false] + exclude: + - php-versions: '8.4' + coverage: false + include: + - php-versions: '8.4' + coverage: true - # name: PHP ${{ matrix.php-versions }} on ${{ runner.os }} ${{ matrix.coverage && ' with code coverage' || '' }}" + name: "PHP ${{ matrix.php-versions }} ${{ matrix.coverage && 'with code coverage' || '' }}" # continue-on-error: ${{ matrix.coverage == true }} steps: - # - uses: actions/checkout@v4 - - # - name: Validate composer.json and composer.lock - # run: composer validate --strict - # - name: Cache Composer packages # id: composer-cache # uses: actions/cache@v3 @@ -63,11 +78,5 @@ jobs: # restore-keys: | # ${{ runner.os }}-php- - # - name: Install dependencies - # run: composer install --prefer-dist --no-progress - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - name: Run test suite run: echo "composer run-script test" diff --git a/AntipinCS/Sniffs/Functions/ParameterTypeDeclarationSniff.php b/AntipinCS/Sniffs/Functions/ParameterTypeDeclarationSniff.php index 1b9454e..9ca9be8 100644 --- a/AntipinCS/Sniffs/Functions/ParameterTypeDeclarationSniff.php +++ b/AntipinCS/Sniffs/Functions/ParameterTypeDeclarationSniff.php @@ -15,15 +15,11 @@ use PHP_CodeSniffer\Util\Tokens; use RuntimeException; -class ParameterTypeDeclarationSniff implements Sniff, \JsonSerializable +class ParameterTypeDeclarationSniff implements Sniff { private const RX_FQCN = '/^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*(\\\\[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)+$/'; - public function jsonSerialize(): array - { - return []; - } /** * A list of functions and methods to ignore. * diff --git a/phpstan.neon.dist b/phpstan.neon.dist index d62ebca..7eee67c 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,11 +1,11 @@ -parameters: - phpVersion: 80200 - level: 9 - paths: - - AntipinCS - excludePaths: - - var - - vendor - bootstrapFiles: - - vendor/autoload.php +parameters: + phpVersion: 80200 + level: 9 + paths: + - AntipinCS + excludePaths: + - var (?) + - vendor + bootstrapFiles: + - vendor/autoload.php - vendor/squizlabs/php_codesniffer/src/Util/Tokens.php \ No newline at end of file