diff --git a/.gitattributes b/.gitattributes index a9c1856..ec99f8c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,8 +3,8 @@ /.gitignore export-ignore /.php-cs-fixer.php export-ignore /.github export-ignore -/README.md export-ignore -/phpunit.xml export-ignore -/phpstan.neon export-ignore +/example export-ignore /tests export-ignore -/example export-ignore \ No newline at end of file +/phpstan.neon export-ignore +/phpunit.xml export-ignore +/README.md export-ignore \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2d0fe09..e429fb3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,13 +6,13 @@ on: jobs: tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: - php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # required for "git tag" presence for MonorepoBuilder split and ChangelogLinker git tags resolver; default is 1 - run: git fetch --depth=100000 origin # see https://github.com/shivammathur/setup-php @@ -26,14 +26,14 @@ jobs: tests_lowest_dependencies: name: Lowest dependencies - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: git fetch --depth=100000 origin # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 7.1 + php-version: '7.1' extensions: xml coverage: none - run: composer update --no-progress --prefer-lowest @@ -41,14 +41,14 @@ jobs: test_coverage: name: Coverage - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: git fetch --depth=100000 origin # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 7.1 + php-version: '7.1' extensions: xml, xdebug coverage: xdebug - run: composer install --no-progress @@ -59,13 +59,13 @@ jobs: php-cs-fixer: name: PHP CS Fixer - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: '8.2' extensions: xml coverage: none - run: composer install --no-progress @@ -73,12 +73,12 @@ jobs: phpstan: name: PHPStan - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: '8.2' coverage: none - run: composer install --no-progress - run: composer phpstan \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3bca77e..be929f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /vendor/ +/.idea/ /.*.cache /tests-report-html/ /composer.lock diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index cd1256f..750f3ae 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -11,10 +11,23 @@ '@PSR12:risky' => true, '@PhpCsFixer' => true, '@PhpCsFixer:risky' => true, + '@PHP71Migration' => true, + '@PHP71Migration:risky' => true, 'array_syntax' => ['syntax' => 'short'], 'php_unit_test_class_requires_covers' => false, - 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'backtick_to_shell_exec' => true, + 'blank_line_before_statement' => [ + 'statements' => ['declare', 'return', 'case'], + ], + 'comment_to_phpdoc' => false, + 'declare_equal_normalize' => ['space' => 'single'], + 'global_namespace_import' => true, + 'linebreak_after_opening_tag' => true, 'native_function_invocation' => false, + 'no_unset_on_property' => false, + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'phpdoc_to_comment' => false, + 'self_static_accessor' => true, ]) ->setFinder($finder) ; \ No newline at end of file diff --git a/README.md b/README.md index 6562946..5cd8b93 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![CI](https://img.shields.io/github/workflow/status/ddebin/atom-generator/CI?style=for-the-badge) +![CI](https://img.shields.io/github/actions/workflow/status/ddebin/atom-generator/main.yaml?style=for-the-badge) [![Codecov](https://img.shields.io/codecov/c/github/ddebin/atom-generator?logo=codecov&style=for-the-badge)](https://codecov.io/gh/ddebin/atom-generator) ![PHP from Packagist](https://img.shields.io/packagist/php-v/ddebin/atom-generator?logo=php&style=for-the-badge) [![Packagist Version](https://img.shields.io/packagist/v/ddebin/atom-generator?style=for-the-badge)](https://packagist.org/packages/ddebin/atom-generator) diff --git a/composer.json b/composer.json index fdb36f9..e39ee9c 100644 --- a/composer.json +++ b/composer.json @@ -45,11 +45,11 @@ } }, "scripts": { - "coverage": "phpunit --coverage-clover=clover.xml", - "php-cs-fixer": "php-cs-fixer fix --allow-risky=yes", - "php-cs-fixer-dry-run": "php-cs-fixer fix --dry-run --allow-risky=yes", - "phpstan": "phpstan analyse -l max -c phpstan.neon src tests", - "phpunit": "phpunit", + "coverage": "@php phpunit --coverage-clover=clover.xml", + "php-cs-fixer": "@php php-cs-fixer fix --allow-risky=yes", + "php-cs-fixer-dry-run": "@php php-cs-fixer fix --dry-run --allow-risky=yes", + "phpstan": "@php phpstan analyse -l max -c phpstan.neon src tests example .php-cs-fixer.php", + "phpunit": "@php phpunit", "test": [ "@php-cs-fixer-dry-run", "@phpstan", diff --git a/example/feed.php b/example/feed.php index 55b634b..35190ee 100644 --- a/example/feed.php +++ b/example/feed.php @@ -1,5 +1,7 @@