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

- run: mkdir nested-dir
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 @@ -44,7 +44,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

# composer install cache - https://github.com/ramsey/composer-install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/downgraded_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
-
uses: "shivammathur/setup-php@v2"
with:
php-version: 8.2
php-version: 8.3
coverage: none

# invoke patches
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
-
uses: "shivammathur/setup-php@v2"
with:
php-version: 8.2
php-version: 8.3
coverage: none

# fix coding standard, so code looks nice
Expand Down
2 changes: 1 addition & 1 deletion bin/ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class ECSAutoloadIncluder
/**
* @var string[]
*/
private const POSSIBLE_AUTOLOAD_PATHS = [
private const array POSSIBLE_AUTOLOAD_PATHS = [
// after split package
__DIR__ . '/../vendor',
// dependency
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
"bin/ecs"
],
"require": {
"php": ">=8.2",
"php": ">=8.3",
"composer/pcre": "^3.3.2",
"composer/xdebug-handler": "^3.0.5",
"friendsofphp/php-cs-fixer": "^3.89",
"illuminate/container": "^12.35",
"friendsofphp/php-cs-fixer": "^3.92.4",
"illuminate/container": "12.39",
"nette/utils": "^4.0.7",
"sebastian/diff": "^6.0.2",
"squizlabs/php_codesniffer": "^4.0",
"symfony/console": "^6.4.24",
"symfony/finder": "^7.3.0",
"symplify/coding-standard": "^13.0.0",
"symplify/coding-standard": "^13.0",
"symplify/easy-parallel": "^11.2.2",
"webmozart/assert": "^1.12"
},
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
level: 8

# reportUnmatchedIgnoredErrors: false
reportUnmatchedIgnoredErrors: false

# requires exact closure types
checkMissingCallableSignature: true
Expand Down
5 changes: 1 addition & 4 deletions src/Application/EasyCodingStandardApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@

final readonly class EasyCodingStandardApplication
{
/**
* @var string
*/
private const ARGV = 'argv';
private const string ARGV = 'argv';

public function __construct(
private EasyCodingStandardStyle $easyCodingStandardStyle,
Expand Down
11 changes: 3 additions & 8 deletions src/Application/Version/StaticVersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@ final class StaticVersionResolver
{
/**
* @api
* @var string
*/
public const PACKAGE_VERSION = '@package_version@';
public const string PACKAGE_VERSION = '@package_version@';

/**
* @api
* @var string
*/
public const RELEASE_DATE = '@release_date@';
public const string RELEASE_DATE = '@release_date@';

/**
* @var int
*/
private const SUCCESS_CODE = 0;
private const int SUCCESS_CODE = 0;

/**
* @api
Expand Down
10 changes: 2 additions & 8 deletions src/Caching/ChangedFilesDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@
*/
final readonly class ChangedFilesDetector
{
/**
* @var string
*/
private const CONFIGURATION_HASH_KEY = 'configuration_hash';
private const string CONFIGURATION_HASH_KEY = 'configuration_hash';

/**
* @var string
*/
private const FILE_HASH = 'file_hash';
private const string FILE_HASH = 'file_hash';

public function __construct(
private FileHashComputer $fileHashComputer,
Expand Down
4 changes: 3 additions & 1 deletion src/Config/ECSConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Symplify\EasyCodingStandard\Config;

use Illuminate\Container\Container;
use Override;
use PHP_CodeSniffer\Sniffs\Sniff;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
use PhpCsFixer\Fixer\FixerInterface;
Expand All @@ -30,7 +31,7 @@ final class ECSConfig extends Container
/**
* @var string[]
*/
private const AUTOTAG_INTERFACES = [Sniff::class, FixerInterface::class, OutputFormatterInterface::class];
private const array AUTOTAG_INTERFACES = [Sniff::class, FixerInterface::class, OutputFormatterInterface::class];

public static function configure(): ECSConfigBuilder
{
Expand Down Expand Up @@ -254,6 +255,7 @@ public function boot(): void
/**
* @param string $abstract
*/
#[Override]
public function singleton($abstract, mixed $concrete = null): void
{
parent::singleton($abstract, $concrete);
Expand Down
6 changes: 3 additions & 3 deletions src/Configuration/EditorConfig/EndOfLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

final class EndOfLine
{
public const Posix = 'lf';
public const string Posix = 'lf';

public const Legacy = 'cr';
public const string Legacy = 'cr';

public const Windows = 'crlf';
public const string Windows = 'crlf';
}
4 changes: 2 additions & 2 deletions src/Configuration/EditorConfig/IndentStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

final class IndentStyle
{
public const Space = 'space';
public const string Space = 'space';

public const Tab = 'tab';
public const string Tab = 'tab';
}
6 changes: 3 additions & 3 deletions src/Configuration/EditorConfig/QuoteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
*/
final class QuoteType
{
public const Single = 'single';
public const string Single = 'single';

public const Double = 'double';
public const string Double = 'double';

public const Auto = 'auto';
public const string Auto = 'auto';
}
2 changes: 2 additions & 0 deletions src/Console/Command/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Symplify\EasyCodingStandard\Console\Command;

use Override;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symplify\EasyCodingStandard\Application\EasyCodingStandardApplication;
Expand All @@ -24,6 +25,7 @@ public function __construct(
parent::__construct();
}

#[Override]
protected function configure(): void
{
$this->setName('check');
Expand Down
2 changes: 2 additions & 0 deletions src/Console/Command/ScriptsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Symplify\EasyCodingStandard\Console\Command;

use Override;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
Expand All @@ -17,6 +18,7 @@ public function __construct(
parent::__construct();
}

#[Override]
protected function configure(): void
{
$this->setName('scripts');
Expand Down
2 changes: 2 additions & 0 deletions src/Console/Command/WorkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Clue\React\NDJson\Decoder;
use Clue\React\NDJson\Encoder;
use Override;
use React\EventLoop\StreamSelectLoop;
use React\Socket\ConnectionInterface;
use React\Socket\TcpConnector;
Expand Down Expand Up @@ -34,6 +35,7 @@ public function __construct(
parent::__construct();
}

#[Override]
protected function configure(): void
{
$this->setName('worker');
Expand Down
3 changes: 3 additions & 0 deletions src/Console/EasyCodingStandardConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Symplify\EasyCodingStandard\Console;

use Composer\XdebugHandler\XdebugHandler;
use Override;
use PHP_CodeSniffer\Config as PHP_CodeSniffer;
use PhpCsFixer\Console\Application as PhpCsFixer;
use Symfony\Component\Console\Application;
Expand Down Expand Up @@ -48,6 +49,7 @@ public function __construct(
$this->setDefaultCommand('check');
}

#[Override]
public function doRun(InputInterface $input, OutputInterface $output): int
{
// @fixes https://github.com/rectorphp/rector/issues/2205
Expand All @@ -74,6 +76,7 @@ public function doRun(InputInterface $input, OutputInterface $output): int
return $exitCode;
}

#[Override]
protected function getDefaultInputDefinition(): InputDefinition
{
$inputDefinition = parent::getDefaultInputDefinition();
Expand Down
15 changes: 3 additions & 12 deletions src/Console/ExitCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,9 @@

final class ExitCode
{
/**
* @var int
*/
public const SUCCESS = Command::SUCCESS;
public const int SUCCESS = Command::SUCCESS;

/**
* @var int
*/
public const FAILURE = Command::FAILURE;
public const int FAILURE = Command::FAILURE;

/**
* @var int
*/
public const CHANGED_CODE_OR_FOUND_ERRORS = 2;
public const int CHANGED_CODE_OR_FOUND_ERRORS = 2;
}
12 changes: 4 additions & 8 deletions src/Console/Formatter/ColorConsoleDiffFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,24 @@
final readonly class ColorConsoleDiffFormatter
{
/**
* @var string
* @see https://regex101.com/r/ovLMDF/1
*/
private const PLUS_START_REGEX = '#^(\+.*)#';
private const string PLUS_START_REGEX = '#^(\+.*)#';

/**
* @var string
* @see https://regex101.com/r/xwywpa/1
*/
private const MINUT_START_REGEX = '#^(\-.*)#';
private const string MINUT_START_REGEX = '#^(\-.*)#';

/**
* @var string
* @see https://regex101.com/r/CMlwa8/1
*/
private const AT_START_REGEX = '#^(@.*)#';
private const string AT_START_REGEX = '#^(@.*)#';

/**
* @var string
* @see https://regex101.com/r/qduj2O/1
*/
private const NEWLINES_REGEX = "#\n\r|\n#";
private const string NEWLINES_REGEX = "#\n\r|\n#";

private string $template;

Expand Down
5 changes: 1 addition & 4 deletions src/Console/Output/ConsoleOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@

final readonly class ConsoleOutputFormatter implements OutputFormatterInterface
{
/**
* @var string
*/
public const NAME = 'console';
public const string NAME = 'console';

public function __construct(
private EasyCodingStandardStyle $easyCodingStandardStyle,
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Output/GitlabOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Symplify\EasyCodingStandard\Console\Output;

use function array_map as map;
use function array_merge as merge;
use SebastianBergmann\Diff\Chunk;
use SebastianBergmann\Diff\Line;
use SebastianBergmann\Diff\Parser as DiffParser;
Expand All @@ -14,8 +16,6 @@
use Symplify\EasyCodingStandard\ValueObject\Configuration;
use Symplify\EasyCodingStandard\ValueObject\Error\ErrorAndDiffResult;
use Symplify\EasyCodingStandard\ValueObject\Error\FileDiff;
use function array_map as map;
use function array_merge as merge;

/**
* Generates a JSON file containing the Gitlab-supported variant of
Expand Down
5 changes: 1 addition & 4 deletions src/Console/Output/JsonOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
*/
final readonly class JsonOutputFormatter implements OutputFormatterInterface
{
/**
* @var string
*/
private const FILES = 'files';
private const string FILES = 'files';

public function __construct(
private EasyCodingStandardStyle $easyCodingStandardStyle,
Expand Down
4 changes: 1 addition & 3 deletions src/Console/Style/EasyCodingStandardStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ final class EasyCodingStandardStyle extends SymfonyStyle
{
/**
* To fit in Linux/Windows terminal windows to prevent overflow.
*
* @var int
*/
private const BULGARIAN_CONSTANT = 8;
private const int BULGARIAN_CONSTANT = 8;

public function __construct(
InputInterface $input,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class ConflictingCheckersCompilerPass
*
* @var string[][]
*/
private const CONFLICTING_CHECKER_GROUPS = [
private const array CONFLICTING_CHECKER_GROUPS = [
[StandaloneLineConstructorParamFixer::class, StandaloneLinePromotedPropertyFixer::class],
['SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff', YodaStyleFixer::class],
[LowerCaseConstantSniff::class, UpperCaseConstantSniff::class],
Expand Down
Loading