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
4 changes: 2 additions & 2 deletions .github/workflows/build_scoped_rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
# 1. copy files to $NESTED_DIRECTORY directory Exclude the scoped/nested directories to prevent rsync from copying in a loop
- run: rsync --exclude rector-build -av * rector-build --quiet

- run: rm -rf rector-build/rules-tests rector-build/templates rector-build/tests rector-build/bin/generate-changelog.php rector-build/bin/validate-phpstan-version.php rector-build/vendor/tracy/tracy/examples rector-build/vendor/symfony/console/Tester rector-build/vendor/symfony/console/Event rector-build/vendor/symfony/console/EventListener rector-build/vendor/tracy/tracy/examples rector-build/vendor/tracy/tracy/src/Bridges rector-build/vendor/tracy/tracy/src/Tracy/Bar rector-build/vendor/tracy/tracy/src/Tracy/Session rector-build/vendor/symfony/service-contracts/Test
- run: rm -rf rector-build/rules-tests rector-build/templates rector-build/tests rector-build/scripts/validate-phpstan-version.php rector-build/vendor/tracy/tracy/examples rector-build/vendor/symfony/console/Tester rector-build/vendor/symfony/console/Event rector-build/vendor/symfony/console/EventListener rector-build/vendor/tracy/tracy/examples rector-build/vendor/tracy/tracy/src/Bridges rector-build/vendor/tracy/tracy/src/Tracy/Bar rector-build/vendor/tracy/tracy/src/Tracy/Session rector-build/vendor/symfony/service-contracts/Test

# 2. downgrade rector
- run: php -d memory_limit=-1 bin/rector process rector-build/bin rector-build/config rector-build/src rector-build/rules rector-build/vendor --config build/config/config-downgrade.php --ansi --no-diffs
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:

- run: cp -a rector-prefixed-downgraded/. remote-repository

- run: rm -rf remote-repository/bin/add-phpstan-self-replace.php remote-repository/bin/test-fixture-stats.php remote-repository/bin/check-before-after-same-fixtures.php remote-repository/bin/no-php-file-in-fixtures.php
- run: rm -rf remote-repository/scripts/add-phpstan-self-replace.php remote-repository/scripts/test-fixture-stats.php remote-repository/scripts/check-before-after-same-fixtures.php remote-repository/scripts/no-php-file-in-fixtures.php

# 7. setup git
-
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,23 @@ jobs:

-
name: 'Compatible PHPStan versions'
run: php bin/validate-phpstan-version.php
run: php scripts/validate-phpstan-version.php

-
name: 'Finalize classes'
run: vendor/bin/swiss-knife finalize-classes src tests --dry-run

-
name: 'Check before/after test fixture on no-changes'
run: php bin/check-before-after-same-fixtures.php
run: php scripts/check-before-after-same-fixtures.php

-
name: 'Check fixture classes are different to nodes'
run: php scripts/avoid-short-node-names-in-fixtures.php

-
name: 'Check no "*.php" files in rules Fixture directory'
run: php bin/no-php-file-in-fixtures.php
run: php scripts/no-php-file-in-fixtures.php

-
name: 'Detect composer dependency issues'
Expand Down
2 changes: 1 addition & 1 deletion build/build-rector-scoped.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ note "Starts"
note "Downloading php-scoper.phar"
wget https://github.com/humbug/php-scoper/releases/download/0.18.17/php-scoper.phar -N --no-verbose

php "$BUILD_DIRECTORY/bin/add-phpstan-self-replace.php"
php "$BUILD_DIRECTORY/scripts/add-phpstan-self-replace.php"

note "Remove PHPStan to avoid duplicating it"

Expand Down
3 changes: 0 additions & 3 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
// ensure use version ^3.2.0
->ignoreErrorsOnPackage('composer/pcre', [ErrorType::UNUSED_DEPENDENCY])

// use din /bin, but only local script
->ignoreErrorsOnPackage('nette/robot-loader', [ErrorType::DEV_DEPENDENCY_IN_PROD])

->ignoreErrorsOnPaths([
__DIR__ . '/stubs',
__DIR__ . '/tests',
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"E2e\\Parallel\\Reflection\\Resolver\\": [
"e2e/parallel-reflection-resolver/src/",
"e2e/no-parallel-reflection-resolver/src"
]
],
"Rector\\Scripts\\": "scripts/src"
},
"classmap": [
"stubs",
Expand Down
1 change: 1 addition & 0 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
__DIR__ . '/tests',
__DIR__ . '/utils',
__DIR__ . '/config',
__DIR__ . '/scripts',
__DIR__ . '/build/build-preload.php',
])
->withSkip([
Expand Down
2 changes: 1 addition & 1 deletion full_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bin/rector process src/functions/node_helper.php -c build/config/config-downgrad

rsync --exclude rector-build -av * rector-build --quiet

rm -rf rector-build/rules-tests rector-build/templates rector-build/tests rector-build/bin/validate-phpstan-version.php rector-build/vendor/tracy/tracy/examples rector-build/vendor/symfony/console/Tester rector-build/vendor/symfony/console/Event rector-build/vendor/symfony/console/EventListener rector-build/vendor/tracy/tracy/examples rector-build/vendor/tracy/tracy/src/Bridges rector-build/vendor/tracy/tracy/src/Tracy/Bar rector-build/vendor/tracy/tracy/src/Tracy/Session rector-build/vendor/symfony/service-contracts/Test
rm -rf rector-build/rules-tests rector-build/templates rector-build/tests rector-build/scripts/validate-phpstan-version.php rector-build/vendor/tracy/tracy/examples rector-build/vendor/symfony/console/Tester rector-build/vendor/symfony/console/Event rector-build/vendor/symfony/console/EventListener rector-build/vendor/tracy/tracy/examples rector-build/vendor/tracy/tracy/src/Bridges rector-build/vendor/tracy/tracy/src/Tracy/Bar rector-build/vendor/tracy/tracy/src/Tracy/Session rector-build/vendor/symfony/service-contracts/Test

php -d memory_limit=-1 bin/rector process rector-build/bin rector-build/config rector-build/src rector-build/rules rector-build/vendor --config build/config/config-downgrade.php --ansi --no-diffs

Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ parameters:
- tests
- rules-tests
- utils
- scripts
- e2e/e2eTestRunnerWithCache.php
- e2e/e2eTestRunner.php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiv

use stdClass;

class NullableType
final class FlipInstanceNullableType
{
public function run()
{
Expand Down Expand Up @@ -32,7 +32,7 @@ namespace Rector\Tests\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiv

use stdClass;

class NullableType
final class FlipInstanceNullableType
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadContinueRector\Fixture;

class Do_
final class ContinueInsideDo
{
public function run()
{
Expand All @@ -19,7 +19,7 @@ class Do_

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadContinueRector\Fixture;

class Do_
final class ContinueInsideDo
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadContinueRector\Fixture;

class Foreach_
final class ContinueInsideForeach
{
public function run($values)
{
Expand All @@ -19,7 +19,7 @@ class Foreach_

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadContinueRector\Fixture;

class Foreach_
final class ContinueInsideForeach
{
public function run($values)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadContinueRector\Fixture;

class While_
final class InsideWhile
{
public function run()
{
Expand All @@ -19,7 +19,7 @@ class While_

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadContinueRector\Fixture;

class While_
final class InsideWhile
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadLoopRector\Fixture;

class Do_
final class EmptyDo
{
public function run()
{
Expand All @@ -18,7 +18,7 @@ class Do_

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadLoopRector\Fixture;

class Do_
final class EmptyDo
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadLoopRector\Fixture;

class Foreach_
final class EmptyForeach
{
public function run($values)
{
Expand All @@ -17,7 +17,7 @@ class Foreach_

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadLoopRector\Fixture;

class Foreach_
final class EmptyForeach
{
public function run($values)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadLoopRector\Fixture;

class While_
final class EmptyWhile
{
public function run()
{
Expand All @@ -17,7 +17,7 @@ class While_

namespace Rector\Tests\DeadCode\Rector\For_\RemoveDeadLoopRector\Fixture;

class While_
final class EmptyWhile
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector\Fixture;

class Identical
final class SplitOrIdentical
{
public function canDrive(Car $newCar)
{
Expand All @@ -22,7 +22,7 @@ class Identical

namespace Rector\Tests\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector\Fixture;

class Identical
final class SplitOrIdentical
{
public function canDrive(Car $newCar)
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\EarlyReturn\Rector\If_\RemoveAlwaysElseRector\Fixture;

class ElseIf_
final class IfReturn
{
public function run()
{
Expand All @@ -24,7 +24,7 @@ class ElseIf_

namespace Rector\Tests\EarlyReturn\Rector\If_\RemoveAlwaysElseRector\Fixture;

class ElseIf_
final class IfReturn
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\EarlyReturn\Rector\If_\RemoveAlwaysElseRector\Fixture;

class Throw_
final class SplitAfterThrow
{
public function run()
{
Expand All @@ -21,7 +21,7 @@ class Throw_

namespace Rector\Tests\EarlyReturn\Rector\If_\RemoveAlwaysElseRector\Fixture;

class Throw_
final class SplitAfterThrow
{
public function run()
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromo

use DateTimeInterface;

class NullableType
final class MergeWithNullableType
{
private ?DateTimeInterface $time;

Expand All @@ -22,7 +22,7 @@ namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromo

use DateTimeInterface;

class NullableType
final class MergeWithNullableType
{
public function __construct(private ?DateTimeInterface $time = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

$composerJsonFileContents = FileSystem::read(__DIR__ . '/../composer.json');

$installedPackageResolver = new InstalledPackageResolver(__DIR__ . '/..');
$installedPackageResolver = new InstalledPackageResolver(__DIR__ . '/rector-src');
$phpstanVersion = $installedPackageResolver->resolvePackageVersion('phpstan/phpstan');

$composerJson = Json::decode($composerJsonFileContents, forceArrays: true);
Expand Down
Loading