Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Add PHP 8.4 to test matrix and update to PHPStan v2 #26

Closed
wants to merge 4 commits into from
Closed
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
1 change: 1 addition & 0 deletions .build/php-cs-rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
;

return (new PhpCsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setRiskyAllowed(true)
->setCacheFile(__DIR__ . '/.php-cs-fixer.cache')
->setRules([
Expand Down
1 change: 0 additions & 1 deletion .build/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ parameters:
paths:
- ../src
excludePaths:
- ../src/Compatibility
- ../src/Compiler.php
10 changes: 5 additions & 5 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ jobs:
php:
- "8.2"
- "8.3"
- "8.4"
dependencies:
- "lowest"
- "highest"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP
uses: "shivammathur/setup-php@v2"
Expand All @@ -33,15 +34,15 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependencies }}
restore-keys: |
${{ runner.os }}-php-

- name: Composer install
uses: "ramsey/composer-install@v1"
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"
Expand All @@ -51,10 +52,9 @@ jobs:

- name: Run test suite
run: composer run-script test-with-coverage
if: ${{ matrix.php != '8.1' }}

- name: Upload test reports artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.php }}-${{ matrix.dependencies }}
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tagged-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP
uses: "shivammathur/setup-php@v2"
Expand All @@ -24,15 +24,15 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Composer install
uses: "ramsey/composer-install@v1"
uses: ramsey/composer-install@v3

- name: Get latest release version number
id: get_version
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Written by **Armin Vieweg** <<https://v.ieweg.de>>

## Requirements

- PHP 8.2 or 8.3
- PHP 8.2, 8.3 or 8.4
- Enabled PHP extensions: iconv, json

If you are looking for older PHP version support, you can check out and use those tags:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"require-dev": {
"seld/phar-utils": "^1.2",
"phpstan/phpstan": "^1.11",
"jangregor/phpstan-prophecy": "^1.0",
"phpstan/phpstan": "^2.0",
"jangregor/phpstan-prophecy": "^2.0",
"friendsofphp/php-cs-fixer": "^3.59",
"phpunit/phpunit": "^10.5"
},
Expand Down
46 changes: 24 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/Contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ Also, each build will run on the following combinations of PHP version and Compo
- PHP 8.2, Highest
- PHP 8.3, Lowest
- PHP 8.3, Highest
- PHP 8.4, Lowest
- PHP 8.4, Highest

*Note:* "Highest" is the default behaviour of Composer.
"Lowest" is when you run Composer update with ``--prefer-lowest``
Expand Down
1 change: 0 additions & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ protected function executing(Input $input, Output $output): int

$finderConfigPath = null;
if (!empty($input->getOption('finder-config'))) {
/** @var string $finderConfigPath */
$finderConfigPath = $input->getOption('finder-config');
$finderConfigPath = $realPath . '/' . $finderConfigPath;
$finder = FinderUtility::loadCustomFinderInstance($finderConfigPath, $finderOptions);
Expand Down
3 changes: 1 addition & 2 deletions src/EditorConfig/Rules/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class Validator
{
/**
* @var Declaration[]
* @var array<string, Declaration>
*/
private array $editorConfig;

Expand Down Expand Up @@ -108,7 +108,6 @@ private function hasRuleSet(string $ruleName): bool
{
return !in_array($ruleName, $this->skippingRules, true)
&& isset($this->editorConfig[$ruleName])
&& $this->editorConfig[$ruleName] instanceof Declaration
&& ($this->editorConfig[$ruleName]->getValue() || $this->editorConfig[$ruleName]->getStringValue());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CommandGitUnavailableFilesTest extends AbstractTestCase

public function setUp(): void
{
$this->workspacePath = sys_get_temp_dir() . '/current_editorconfig_cli_test';
$this->workspacePath = realpath(sys_get_temp_dir()) . '/current_editorconfig_cli_test';

parent::setUp();

Expand Down