Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 33 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
6 changes: 1 addition & 5 deletions AntipinCS/Sniffs/Functions/ParameterTypeDeclarationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
20 changes: 10 additions & 10 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -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