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

Bump Rector v2 #48

Merged
merged 3 commits into from
Dec 12, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/downgraded_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:

- uses: "ramsey/composer-install@v2"

# downgrade /src to PHP 7.2
- run: vendor/bin/rector process src --config build/rector-downgrade-php-72.php --ansi
# downgrade /src to PHP 7.4
- run: vendor/bin/rector process src --config build/rector-downgrade-php-74.php --ansi
- run: vendor/bin/ecs check src --fix --ansi

# copy PHP 7.2 composer
- run: cp build/composer-php-72.json composer.json
# copy PHP 7.4 composer
- run: cp build/composer-php-74.json composer.json

# clear the dev files
- run: rm -rf build .github tests stubs ecs.php phpstan.neon phpunit.xml
Expand All @@ -42,7 +42,7 @@ jobs:
run: |
# separate a "git add" to add untracked (new) files too
git add --all
git commit -m "release PHP 7.2 downgraded"
git commit -m "release PHP 7.4 downgraded"

# force push tag, so there is only 1 version
git tag "${GITHUB_REF#refs/tags/}" --force
Expand Down
4 changes: 2 additions & 2 deletions build/composer-php-72.json → build/composer-php-74.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"license": "MIT",
"keywords": ["static analysis", "phpstan-extension"],
"require": {
"php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.9.3",
"php": "^7.4 || ^8.0",
"phpstan/phpstan": "^2.0",
"nette/utils": "^3.2 || ^4.0"
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
use Rector\Set\ValueObject\DowngradeLevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_72]);
$rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_74]);
};
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"keywords": ["static analysis", "phpstan-extension"],
"require": {
"php": "^8.2",
"phpstan/phpstan": "^1.10.67"
"phpstan/phpstan": "^2.0.3"
},
"require-dev": {
"phpstan/extension-installer": "^1.3",
"phpunit/phpunit": "^10.5",
"symplify/easy-coding-standard": "^12.1",
"rector/rector": "^1.0.4",
"phpstan/extension-installer": "^1.4",
"phpunit/phpunit": "^11.5",
"symplify/easy-coding-standard": "^12.4",
"rector/rector": "^2.0",
"tracy/tracy": "^2.10",
"tomasvotruba/unused-public": "^0.2"
"tomasvotruba/unused-public": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ parameters:
ignoreErrors:
- identifier: missingType.generics

# used in tests
- message: '#Public constant "TomasVotruba\\TypeCoverage\\(.*?)::ERROR_MESSAGE" is never#'

excludePaths:
- "*/Fixture/*"
- "*/Source/*"
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static function setUpBeforeClass(): void

/**
* @param string[] $filePaths
* @param mixed[] $expectedErrorsWithLines
* @param list<array{0: string, 1: int, 2?: string|null}> $expectedErrorsWithLines
*/
#[DataProvider('provideData')]
public function testRule(array $filePaths, array $expectedErrorsWithLines): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class DeclareCoverageRuleTest extends RuleTestCase
{
/**
* @param string[] $filePaths
* @param mixed[] $expectedErrorsWithLines
* @param list<array{0: string, 1: int, 2?: string|null}> $expectedErrorsWithLines
*/
#[DataProvider('provideData')]
public function testRule(array $filePaths, array $expectedErrorsWithLines): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class ParamTypeCoverageRuleTest extends RuleTestCase
{
/**
* @param string[] $filePaths
* @param mixed[] $expectedErrorsWithLines
* @param list<array{0: string, 1: int, 2?: string|null}> $expectedErrorsWithLines
*/
#[DataProvider('provideData')]
public function testRule(array $filePaths, array $expectedErrorsWithLines): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class PropertyTypeCoverageRuleTest extends RuleTestCase
{
/**
* @param string[] $filePaths
* @param mixed[] $expectedErrorsWithLines
* @param list<array{0: string, 1: int, 2?: string|null}> $expectedErrorsWithLines
*/
#[DataProvider('provideData')]
public function testRule(array $filePaths, array $expectedErrorsWithLines): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class ReturnTypeCoverageRuleTest extends RuleTestCase
{
/**
* @param string[] $filePaths
* @param mixed[] $expectedErrorsWithLines
* @param list<array{0: string, 1: int, 2?: string|null}> $expectedErrorsWithLines
*/
#[DataProvider('provideData')]
public function testRule(array $filePaths, array $expectedErrorsWithLines): void
Expand Down
Loading