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.3
php-version: 8.4
coverage: none

- run: mkdir nested-dir
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/buid_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
-
uses: "shivammathur/setup-php@v2"
with:
php-version: 8.3
php-version: 8.4
coverage: none

# invoke patches
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.3
php-version: 8.4
coverage: none

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

- run: mkdir nested-dir
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Guidance for Claude Code when working in this repository.

**Symplify EasyCodingStandard (ECS)** — a unified runner for PHP-CS-Fixer and PHP_CodeSniffer. Users configure rules through a fluent PHP API (`ECSConfig::configure()->with...()`) instead of dealing with each tool's native config format.

- PHP `>=8.3`
- PHP `>=8.4`
- Entry binary: `bin/ecs`
- PSR-4: `Symplify\EasyCodingStandard\``src/`
- Tests PSR-4: `Symplify\EasyCodingStandard\Tests\``tests/`
Expand Down
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@
"bin/ecs"
],
"require": {
"php": ">=8.3",
"php": ">=8.4",
"composer/pcre": "^3.3.2",
"composer/xdebug-handler": "^3.0.5",
"entropy/entropy": "dev-main",
"friendsofphp/php-cs-fixer": "^3.95.1|^4.0",
"entropy/entropy": "^0.3",
"friendsofphp/php-cs-fixer": "^3.95.5",
"illuminate/container": "12.39.*",
"nette/utils": "4.0.8",
"sebastian/diff": "^6.0|^7.0",
"nette/utils": "^4.1",
"sebastian/diff": "^9.0",
"squizlabs/php_codesniffer": "^4.0.1",
"symfony/console": "^6.4.24",
"symfony/finder": "^7.4",
"symplify/coding-standard": "^13.0",
"symplify/easy-parallel": "^11.2.2",
"webmozart/assert": "^2.3"
"symplify/coding-standard": "^13.1",
"symplify/easy-parallel": "^11.2",
"webmozart/assert": "^2.4"
},
"require-dev": {
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^2.1.54",
"phpstan/phpstan": "^2.2",
"phpstan/phpstan-phpunit": "^2.0.16",
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^12.5.4",
"phpunit/phpunit": "^13.0",
"rector/jack": "^1.0",
"rector/rector": "^2.4",
"rector/type-perfect": "^2.1",
"symplify/phpstan-extensions": "^12.0",
"symplify/phpstan-rules": "^14.11",
"symplify/vendor-patches": "^11.5",
"tomasvotruba/class-leak": "^2.1",
"tomasvotruba/class-leak": "^2.1.6",
"tomasvotruba/type-coverage": "^2.1",
"tomasvotruba/unused-public": "^2.1|^3.0",
"tracy/tracy": "^2.11|^3.0"
"tomasvotruba/unused-public": "^2.2",
"tracy/tracy": "^2.12"
},
"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 @@ -6,6 +6,9 @@ parameters:
# requires exact closure types
checkMissingCallableSignature: true

# symplify - see https://github.com/symplify/phpstan-rules#usage
pathStrings: true

paths:
- src
- tests
Expand Down
7 changes: 7 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ConstFetch\RemovePhpVersionIdCheckRector;
use Rector\Php84\Rector\Class_\DeprecatedAnnotationToDeprecatedAttributeRector;

return RectorConfig::configure()
->withPhpSets()
Expand All @@ -28,4 +29,10 @@

// conditional checks
RemovePhpVersionIdCheckRector::class,

DeprecatedAnnotationToDeprecatedAttributeRector::class => [
// avoid runtime reporting in output, only for the user
__DIR__ . '/src/ValueObject/Option.php',
__DIR__ . '/src/ValueObject/Set/SetList.php',
],
]);
8 changes: 1 addition & 7 deletions src/Configuration/ConfigInitializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ public function __construct(
public function areSomeCheckersRegistered(): bool
{
$fileProcessors = $this->fileProcessorCollector->getFileProcessors();
foreach ($fileProcessors as $fileProcessor) {
if ($fileProcessor->getCheckers()) {
return true;
}
}

return false;
return array_any($fileProcessors, fn ($fileProcessor): bool => $fileProcessor->getCheckers() !== []);
}

public function createConfig(string $projectDirectory): void
Expand Down
6 changes: 4 additions & 2 deletions src/Configuration/ECSConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ public function withSkip(array $skip): self
*/
public function withRootFiles(): self
{
$rootPhpFilesFinder = (new Finder())->files()
$rootPhpFilesFinder = new Finder()
->files()
->in(getcwd())
->depth(0)
->name('*.php');
Expand Down Expand Up @@ -887,7 +888,8 @@ private function applyEditorConfigSettings(): void
*
* @see \Symplify\EasyCodingStandard\DependencyInjection\CompilerPass\RemoveMutualCheckersCompilerPass
*/
$editorConfig = (new EditorConfigFactory())->load();
$editorConfig = new EditorConfigFactory()
->load();

if ($editorConfig->indentStyle !== null) {
$this->indentation = match ($editorConfig->indentStyle) {
Expand Down
11 changes: 4 additions & 7 deletions src/Skipper/Matcher/FileInfoMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ public function __construct(
*/
public function doesFileInfoMatchPatterns(SplFileInfo | string $fileInfo, array $filePatterns): bool
{
foreach ($filePatterns as $filePattern) {
if ($this->doesFileInfoMatchPattern($fileInfo, $filePattern)) {
return true;
}
}

return false;
return array_any(
$filePatterns,
fn (string $filePattern): bool => $this->doesFileInfoMatchPattern($fileInfo, $filePattern)
);
}

/**
Expand Down
Loading
Loading