Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/build_scoped_rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none

# fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none

- uses: "ramsey/composer-install@v3"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis_no_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none

- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compat_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none

- run: composer create-project "rector/rector-compat-tests:dev-main" .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ['8.2']
php_version: ['8.3']
directory:
- 'e2e/applied-auto-import'
- 'e2e/applied-polyfill-php80'
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/e2e_command_with_option.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none

- uses: "ramsey/composer-install@v3"
Expand Down Expand Up @@ -60,4 +60,3 @@ jobs:
../../bin/rector some_file.php --output-format=json
php ../../bin/rector some_file.php --output-format json
php ../../bin/rector some_file.php --output-format=json

2 changes: 1 addition & 1 deletion .github/workflows/e2e_with_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ['8.2']
php_version: ['8.3']
directory:
- 'e2e/applied-rule-removed-node-with-cache'
- 'e2e/timeout-file-not-cached'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_with_no_diffs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ['8.2']
php_version: ['8.3']
directory:
- 'e2e/applied-rule-removed-node-no-diffs'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packages_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none

- run: composer config minimum-stability dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan_printer_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php-versions: ['8.2']
php-versions: ['8.3']

runs-on: ${{ matrix.os }}
timeout-minutes: 3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
# PHP 8.2 is required, so Rector's code is PHP 8.2 compatible even after refactoring
php-version: 8.2
# PHP 8.3 is required, so Rector's code is PHP 8.3 compatible even after refactoring
php-version: 8.3
coverage: none

- run: composer install --no-progress --ansi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php-versions: ['8.2', '8.3', '8.4', '8.5']
php-versions: ['8.3', '8.4', '8.5']

runs-on: ${{ matrix.os }}
timeout-minutes: 3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly_pull_requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none

- uses: "ramsey/composer-install@v3"
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ git clone git@github.com:<your-name>/rector-src.git
cd rector-src
```

2. We use PHP 8.2 and composer
2. We use PHP 8.3 and composer

Install dependencies and verify your local environment:

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-cli-alpine
FROM php:8.3-cli-alpine

WORKDIR /etc/rector

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Head to [`rectorphp/rector`](http://github.com/rectorphp/rector) for documentati

## Building `rectorphp/rector`

Code of this repository requires PHP 8.2. For `rector/rector` package the builder downgrades code to PHP 7.4+.
Code of this repository requires PHP 8.3. For `rector/rector` package the builder downgrades code to PHP 7.4+.

<br>

Expand Down
14 changes: 4 additions & 10 deletions build/build-preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@

final class PreloadBuilder
{
/**
* @var string
*/
private const PRELOAD_FILE_TEMPLATE = <<<'CODE_SAMPLE'
private const string PRELOAD_FILE_TEMPLATE = <<<'CODE_SAMPLE'
<?php

declare(strict_types=1);
Expand Down Expand Up @@ -75,18 +72,15 @@ function isPHPStanTestPreloaded(): bool
}
CODE_SAMPLE;

/**
* @var int
*/
private const PRIORITY_LESS_FILE_POSITION = -1;
private const int PRIORITY_LESS_FILE_POSITION = -1;

/**
* These files are parent to another files, so they have to be included first
* See https://github.com/rectorphp/rector/issues/6709 for more
*
* @var string[]
*/
private const HIGH_PRIORITY_FILES = [
private const array HIGH_PRIORITY_FILES = [
// nikic/php-parser
'Node.php',
'NodeAbstract.php',
Expand Down Expand Up @@ -131,7 +125,7 @@ function isPHPStanTestPreloaded(): bool
*
* @var string[]
*/
private const IN_USE_CLASS_FILES = [
private const array IN_USE_CLASS_FILES = [
'Node/Expr/ArrayItem.php',
'Node/Expr/ClosureUse.php',
'Node/Scalar/EncapsedStringPart.php',
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"migration"
],
"require": {
"php": "^8.2",
"php": "^8.3",
"clue/ndjson-react": "^1.3",
"composer/pcre": "^3.3.2",
"composer/semver": "^3.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Tests\CodingStyle\ClassNameImport\ShortNameResolver;

use Iterator;
use Override;
use PHPUnit\Framework\Attributes\DataProvider;
use Rector\CodingStyle\ClassNameImport\ShortNameResolver;
use Rector\Testing\PHPUnit\AbstractLazyTestCase;
Expand All @@ -16,6 +17,7 @@ final class ShortNameResolverTest extends AbstractLazyTestCase

private TestingParser $testingParser;

#[Override]
protected function setUp(): void
{
parent::setUp();
Expand Down
2 changes: 2 additions & 0 deletions rules-tests/Naming/Naming/PropertyNamingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Tests\Naming\Naming;

use Iterator;
use Override;
use PHPStan\Type\ObjectType;
use PHPUnit\Framework\Attributes\DataProvider;
use Rector\Naming\Naming\PropertyNaming;
Expand All @@ -15,6 +16,7 @@ final class PropertyNamingTest extends AbstractLazyTestCase
{
private PropertyNaming $propertyNaming;

#[Override]
protected function setUp(): void
{
parent::setUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Tests\Naming\Naming\UseImportsResolver;

use Iterator;
use Override;
use PhpParser\Node\Stmt\Property;
use PhpParser\Node\Stmt\Use_;
use PHPUnit\Framework\Attributes\DataProvider;
Expand All @@ -24,6 +25,7 @@ final class UseImportsResolverTest extends AbstractLazyTestCase

private BetterNodeFinder $betterNodeFinder;

#[Override]
protected function setUp(): void
{
parent::setUp();
Expand Down
9 changes: 3 additions & 6 deletions rules/Arguments/NodeAnalyzer/ArgumentAddingScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@
{
/**
* @api
* @var string
*/
public const SCOPE_PARENT_CALL = 'parent_call';
public const string SCOPE_PARENT_CALL = 'parent_call';

/**
* @api
* @var string
*/
public const SCOPE_METHOD_CALL = 'method_call';
public const string SCOPE_METHOD_CALL = 'method_call';

/**
* @api
* @var string
*/
public const SCOPE_CLASS_METHOD = 'class_method';
public const string SCOPE_CLASS_METHOD = 'class_method';

public function __construct(
private NodeNameResolver $nodeNameResolver
Expand Down
5 changes: 1 addition & 4 deletions rules/Arguments/ValueObject/ReplaceArgumentDefaultValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

final readonly class ReplaceArgumentDefaultValue implements ReplaceArgumentDefaultValueInterface
{
/**
* @var string
*/
public const ANY_VALUE_BEFORE = '*ANY_VALUE_BEFORE*';
public const string ANY_VALUE_BEFORE = '*ANY_VALUE_BEFORE*';

/**
* @param int<0, max> $position
Expand Down
10 changes: 2 additions & 8 deletions rules/Assert/Enum/AssertClassName.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@

final class AssertClassName
{
/**
* @var string
*/
public const WEBMOZART = 'Webmozart\Assert\Assert';
public const string WEBMOZART = 'Webmozart\Assert\Assert';

/**
* @var string
*/
public const BEBERLEI = 'Assert\Assertion';
public const string BEBERLEI = 'Assert\Assertion';
}
6 changes: 2 additions & 4 deletions rules/Carbon/NodeFactory/CarbonCallFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@
final class CarbonCallFactory
{
/**
* @var string
* @see https://regex101.com/r/LLMrFw/1
*/
private const PLUS_MINUS_COUNT_REGEX = '#(?<operator>\+|-)(\\s+)?(?<count>\\d+)(\s+)?(?<unit>seconds|second|sec|minutes|minute|min|hours|hour|days|day|weeks|week|months|month|years|year)#';
private const string PLUS_MINUS_COUNT_REGEX = '#(?<operator>\+|-)(\\s+)?(?<count>\\d+)(\s+)?(?<unit>seconds|second|sec|minutes|minute|min|hours|hour|days|day|weeks|week|months|month|years|year)#';

/**
* @var string
* @see https://regex101.com/r/IhxHTO/1
*/
private const STATIC_DATE_REGEX = '#now|yesterday|today|tomorrow#';
private const string STATIC_DATE_REGEX = '#now|yesterday|today|tomorrow#';

public function createFromDateTimeString(
FullyQualified $carbonFullyQualified,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
final class DateFuncCallToCarbonRector extends AbstractRector
{
private const TIME_UNITS = [
private const array TIME_UNITS = [
['weeks', 604800],
['days', 86400],
['hours', 3600],
Expand Down
5 changes: 1 addition & 4 deletions rules/CodeQuality/NodeAnalyzer/LocalPropertyAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@

final readonly class LocalPropertyAnalyzer
{
/**
* @var string
*/
private const LARAVEL_COLLECTION_CLASS = 'Illuminate\Support\Collection';
private const string LARAVEL_COLLECTION_CLASS = 'Illuminate\Support\Collection';

public function __construct(
private SimpleCallableNodeTraverser $simpleCallableNodeTraverser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
*/
final class ThrowWithPreviousExceptionRector extends AbstractRector
{
/**
* @var int
*/
private const DEFAULT_EXCEPTION_ARGUMENT_POSITION = 2;
private const int DEFAULT_EXCEPTION_ARGUMENT_POSITION = 2;

public function __construct(
private readonly ReflectionProvider $reflectionProvider
Expand Down
8 changes: 2 additions & 6 deletions rules/CodeQuality/Rector/Concat/JoinStringConcatRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@
*/
final class JoinStringConcatRector extends AbstractRector
{
/**
* @var int
*/
private const LINE_BREAK_POINT = 100;
private const int LINE_BREAK_POINT = 100;

/**
* @var string
* @see https://regex101.com/r/VaXM1t/1
* @see https://stackoverflow.com/questions/4147646/determine-if-utf-8-text-is-all-ascii
*/
private const ASCII_REGEX = '#[^\x00-\x7F]#';
private const string ASCII_REGEX = '#[^\x00-\x7F]#';

public function getRuleDefinition(): RuleDefinition
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
*/
final class ForRepeatedCountToOwnVariableRector extends AbstractRector
{
/**
* @var string
*/
private const COUNTER_NAME = 'counter';
private const string COUNTER_NAME = 'counter';

public function getRuleDefinition(): RuleDefinition
{
Expand Down
2 changes: 1 addition & 1 deletion rules/CodeQuality/Rector/FuncCall/SetTypeToCastRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class SetTypeToCastRector extends AbstractRector
/**
* @var array<string, class-string<Cast>>
*/
private const TYPE_TO_CAST = [
private const array TYPE_TO_CAST = [
'array' => Array_::class,
'bool' => Bool_::class,
'boolean' => Bool_::class,
Expand Down
Loading