Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
887bab2
tests: every test can fail for what it tests
dg Nov 15, 2026
868c50c
tests: the rules of the Symfony preset are said as what it adds to PE…
dg Nov 15, 2026
47e95d9
workers: a worker that does not answer in time points to --jobs 1, a …
dg Nov 15, 2026
da052ff
indentation: a match arm is asked of PhpSyntax, whose infer() now ste…
dg Nov 15, 2026
f09b24b
opened 1.5-dev
dg Nov 7, 2026
3860e8f
console: the run over the files of a project is RunExecutor, which ch…
dg Nov 7, 2026
aeeb9a6
engine: a run keeps its violations only counted
dg Nov 7, 2026
182ba9b
cli: upgrade today, the code upgraded to the versions the project req…
dg Nov 7, 2026
78248ff
upgrade today: the upgrading data a library of the project needs inst…
dg Nov 7, 2026
3ab3b5c
upgrading: every section of upgrading data is laid as a layer of its own
dg Nov 7, 2026
cebff6b
added rule unseenReferences
dg Nov 7, 2026
5d9ee1f
cli: upgrade estimate says what an upgrade to the target changes, cha…
dg Nov 7, 2026
4533c22
upgrade estimate: says what refuses each target and what the raise wo…
dg Nov 7, 2026
9f58a51
cli: upgrade plan orders the estimate into steps, which --save writes…
dg Nov 7, 2026
2ce5666
cli: upgrade run makes the steps of the plan, upgrade abort takes the…
dg Nov 7, 2026
4ed734f
upgrade run: raises the constraints with Composer and goes on in a ne…
dg Nov 7, 2026
a60108a
upgrade run: waits while the fixes leave tasks for a human
dg Nov 7, 2026
fcec784
upgrade run: --commit makes a commit per topic once its step passed, …
dg Nov 7, 2026
0e8274d
upgrade today: --max-warnings, so that CI fails where more warnings a…
dg Nov 7, 2026
de96d10
cli: upgrade tasks lists what the fixes of the saved plan leave for a…
dg Nov 7, 2026
7d27179
cli: upgrade status says where the saved plan stands and what a run k…
dg Nov 7, 2026
e600a58
cli: the hidden option --profile writes where the time of a run went,…
dg Nov 7, 2026
6d85b77
indentation: a comment at the level of the body before a continuing b…
kukulich Nov 17, 2026
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 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"nette/neon": "^4.0",
"nette/schema": "^1.4 || ^2.0",
"nette/utils": "^4.1",
"phpsyntax/phpsyntax": "^1.0",
"phpsyntax/phpsyntax": "^1.0.1",
"phpstan/phpdoc-parser": "^2.4",
"composer/semver": "^3.4"
},
Expand Down Expand Up @@ -50,7 +50,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
"dev-master": "1.5-dev"
}
}
}
3 changes: 3 additions & 0 deletions docs/dresscode.annotated.neon
Original file line number Diff line number Diff line change
Expand Up @@ -582,3 +582,6 @@ upgrading: # what a newer PHP writes or retired
forbiddenMembers: {} # a member that may not be used
attributeForAnnotation: {} # an attribute written for an annotation; a namespace mask with `\*`
attributeForMember: {} # an attribute written for a member the class declares by convention
unseen: # what an upgrade cannot see, reported where it stands
classNameString: reported # the string `'Acme\Old'` naming a class the maps rename or forbid. Also: keep
dynamicAccess: reported # `$object->$method()`, `new $class`, `call_user_func($callback)`. Also: keep
36 changes: 24 additions & 12 deletions docs/internals.md

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions docs/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ final readonly class Config extends DressCode\Profile
final class Catalogue
public const Version = 4
public const CoreSections = ['file', 'indentation', 'braces', 'blankLines', 'multiline', 'spacing', 'naming', 'casing', 'qualification', 'imports', 'classes', 'functions', 'types', 'controlFlow', 'expressions', 'literals', 'comments', 'phpdoc', 'hygiene', 'mistakes', 'upgrading']
public const Lexicon = ['required' => 'always there', 'forbidden' => 'never there', 'optional' => null, 'none' => null, 'sameLine' => null, 'nextLine' => null, 'above' => null, 'lineStart' => null, 'lineEnd' => null, 'perLine' => null, 'fill' => null, 'apart' => null, 'attached' => null, 'closingApart' => null, 'aligned' => null, 'collapsed' => null, 'expanded' => null, 'first' => null, 'last' => null, 'lastStatementSetApart' => null, 'spaces' => null, 'tabs' => null, 'bare' => null, 'imported' => null, 'backslashed' => null, 'self' => null, 'declared' => null, 'lowercase' => null, 'uppercase' => null, 'canonical' => null, 'alphabetical' => null, 'short' => null, 'long' => null, 'separated' => null, 'combined' => null, 'grouped' => null, 'joined' => null, 'PascalCase' => null, 'camelCase' => null, 'snake_case' => null, 'UPPER_CASE' => null, 'Pascal_Snake_Case' => null, 'constant' => null, 'property' => null, 'traitUse' => null]
public const Lexicon = ['required' => 'always there', 'forbidden' => 'never there', 'optional' => null, 'none' => null, 'sameLine' => null, 'nextLine' => null, 'above' => null, 'lineStart' => null, 'lineEnd' => null, 'perLine' => null, 'fill' => null, 'apart' => null, 'attached' => null, 'closingApart' => null, 'aligned' => null, 'collapsed' => null, 'expanded' => null, 'first' => null, 'last' => null, 'lastStatementSetApart' => null, 'spaces' => null, 'tabs' => null, 'bare' => null, 'imported' => null, 'backslashed' => null, 'self' => null, 'declared' => null, 'lowercase' => null, 'uppercase' => null, 'canonical' => null, 'alphabetical' => null, 'short' => null, 'long' => null, 'separated' => null, 'combined' => null, 'grouped' => null, 'joined' => null, 'PascalCase' => null, 'camelCase' => null, 'snake_case' => null, 'UPPER_CASE' => null, 'Pascal_Snake_Case' => null, 'constant' => null, 'property' => null, 'traitUse' => null, 'reported' => 'reported where it stands']
public const ProjectSection = 'project'
public static function fromRules(list<class-string<DressCode\Rule>> $rules): DressCode\Config\Catalogue
public function find(string $path): ?DressCode\Decision
Expand All @@ -302,7 +302,11 @@ final readonly class Layer
public readonly ?string $name
public readonly ?string $package
public readonly ?string $decision
public function __construct(DressCode\Config\LayerKind $kind, ?string $name = null, ?string $package = null, ?string $decision = null)
public readonly ?string $library
public readonly ?string $since
public readonly ?string $from
public function __construct(DressCode\Config\LayerKind $kind, ?string $name = null, ?string $package = null, ?string $decision = null, ?string $library = null, ?string $since = null, ?string $from = null)
public function withSection(string $library, string $since, ?string $from): DressCode\Config\Layer
public function describe(): string
public function formatReference(): string
public function isProject(): bool
Expand Down Expand Up @@ -332,7 +336,7 @@ final class ConfigurationException extends Exception implements Stringable, Thro

```php
final readonly class Application
public const Version = '1.4.0'
public const Version = '1.5-dev'
public function __construct(?resource $stdout = null, ?resource $stderr = null, ?resource $stdin = null, ?string $cwd = null, ?string $script = null, ?DressCode\Config $defaultConfig = null, ?bool $xdebug = null, ?bool $interactive = null)
public function run(list<string> $argv): int
```
Expand Down Expand Up @@ -673,7 +677,7 @@ final class RuleContext
public readonly string $path
public readonly DressCode\Style $style
public readonly string $phpVersion
public function report(PhpSyntax\Node|PhpSyntax\Token $at, string $message, ?string $decision = null, ?PhpSyntax\Trivia $trivia = null, int $lineInTrivia = 0, ?DressCode\Risk $risk = null, ?PhpSyntax\Token $follows = null, bool $byLine = false, bool $fixable = true, ?string $because = null): bool
public function report(PhpSyntax\Node|PhpSyntax\Token $at, string $message, ?string $decision = null, ?PhpSyntax\Trivia $trivia = null, int $lineInTrivia = 0, ?DressCode\Risk $risk = null, ?PhpSyntax\Token $follows = null, bool $byLine = false, bool $fixable = true, ?string $because = null, ?DressCode\Config\Layer $source = null): bool
public function isSilenced(PhpSyntax\Node|PhpSyntax\Token $at, ?string $decision = null, ?PhpSyntax\Trivia $trivia = null, int $lineInTrivia = 0): bool
/** @template T of object */
public function getAnalysis(class-string<T> $class): T
Expand Down Expand Up @@ -778,6 +782,7 @@ final class TestFailure extends Exception implements Stringable, Throwable
```php
final class UpgradingTester
public static function collectProblems(string $file, string $root, list<class-string<DressCode\Rule>> $packageRules = []): list<string>
public static function collectPackageProblems(string $root): list<string>
public static function runSample(string $code, string $root, array<string, mixed> $decisions = [], string $name = 'sample'): DressCode\FileResult
```

Expand Down Expand Up @@ -862,6 +867,7 @@ final readonly class MemberMapEntry
public readonly DressCode\Upgrading\MemberPattern $pattern
public readonly T $value
public readonly string $decision
public readonly ?DressCode\Config\Layer $origin
```

## `DressCode\Upgrading\MemberMapGrammar`
Expand Down Expand Up @@ -966,8 +972,8 @@ final readonly class Values
public function find(string $path): ?DressCode\Value
public function readMap(string $path): array<mixed>
public function findWithdrawnNames(string $path): list<string>
public function findPackageEntries(string $path): array<string, true>
public function getEntryDecision(string $path, string $key): string
public function getEntryOrigin(string $path, string $key): ?DressCode\Config\Layer
public function isKept(string $path): bool
public function isSelected(string $path): bool
```
Expand All @@ -990,7 +996,8 @@ final readonly class Violation
public readonly ?int $offset
public readonly ?int $length
public readonly ?array{int, int} $originalLines
public function __construct(string $decision, string $message, int $line, ?int $column, DressCode\Severity $severity, string $fingerprint, bool $fixable = true, ?DressCode\Risk $risk = null, bool $refused = false, ?string $because = null, ?string $derivedFrom = null, ?int $offset = null, ?int $length = null, ?array{int, int} $originalLines = null)
public readonly ?DressCode\Config\Layer $source
public function __construct(string $decision, string $message, int $line, ?int $column, DressCode\Severity $severity, string $fingerprint, bool $fixable = true, ?DressCode\Risk $risk = null, bool $refused = false, ?string $because = null, ?string $derivedFrom = null, ?int $offset = null, ?int $length = null, ?array{int, int} $originalLines = null, ?DressCode\Config\Layer $source = null)
public function findSpanStart(string $text): ?array{int, int}
public function findSpanEnd(string $text): ?array{int, int}
public static function formatCode(string $code): string
Expand Down Expand Up @@ -1206,6 +1213,7 @@ final readonly class Violation
- `DressCode\Rules\Upgrading\ReplacedFunctionCallsRule`
- `DressCode\Rules\Upgrading\ReplacedFunctionsRule`
- `DressCode\Rules\Upgrading\ReplacedMembersRule`
- `DressCode\Rules\Upgrading\UnseenReferencesRule`
- `DressCode\Rules\Variables\NoGlobalStatementsRule`
- `DressCode\Rules\Variables\NoRepeatedAssignmentsRule`
- `DressCode\Rules\Variables\NoSeparateIssetsRule`
Expand Down
24 changes: 22 additions & 2 deletions docs/reference/decisions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Decisions

Generated by `composer reference` from the catalogue; do not edit. 445 decisions in 22 sections.
Generated by `composer reference` from the catalogue; do not edit. 447 decisions in 22 sections.

A decision writing a construct of a newer PHP takes effect where every version of the target has it, the target being the oldest version the code runs on; one about a deprecation reports and fixes whatever the target, the code
meeting the deprecation wherever it runs on the version that made it.
Expand Down Expand Up @@ -47,7 +47,7 @@ meeting the deprecation wherever it runs on the version that made it.

**mistakes** (24): [consecutivePhpdocs](#mistakesconsecutivephpdocs), [continueInSwitch](#mistakescontinueinswitch), [countOfUncountable](#mistakescountofuncountable), [debugOutput](#mistakesdebugoutput), [debugOutputFunctions](#mistakesdebugoutputfunctions), [errorSuppression](#mistakeserrorsuppression), [exceptionWhereThrowableBelongs](#mistakesexceptionwherethrowablebelongs), [finalParent](#mistakesfinalparent), [globalStatement](#mistakesglobalstatement), [invisibleCharacter](#mistakesinvisiblecharacter), [looseNumberComparison](#mistakesloosenumbercomparison), [neverReturnType.anonymousFunction](#mistakesneverreturntypeanonymousfunction), [neverReturnType.function](#mistakesneverreturntypefunction), [neverReturnType.method](#mistakesneverreturntypemethod), [readonlyProperty](#mistakesreadonlyproperty), [repeatedAssignment](#mistakesrepeatedassignment), [staticSetState](#mistakesstaticsetstate), [strictArgument](#mistakesstrictargument), [thisOutsideObject](#mistakesthisoutsideobject), [trailingWhitespaceInString](#mistakestrailingwhitespaceinstring), [unimplementedAbstractMethod](#mistakesunimplementedabstractmethod), [unreachableCatch](#mistakesunreachablecatch), [__debugInfoReturningNull](#mistakes__debuginforeturningnull), [__serialize](#mistakes__serialize)

**upgrading** (56): [api.attributeForAnnotation](#upgradingapiattributeforannotation), [api.attributeForMember](#upgradingapiattributeformember), [api.forbiddenClasses](#upgradingapiforbiddenclasses), [api.forbiddenConstants](#upgradingapiforbiddenconstants), [api.forbiddenFunctions](#upgradingapiforbiddenfunctions), [api.forbiddenMembers](#upgradingapiforbiddenmembers), [api.replacedCalls](#upgradingapireplacedcalls), [api.replacedClasses](#upgradingapireplacedclasses), [api.replacedFunctions](#upgradingapireplacedfunctions), [api.replacedMembers](#upgradingapireplacedmembers), [classes.Override](#upgradingclassesoverride), [classes.SensitiveParameter](#upgradingclassessensitiveparameter), [classes.SensitiveParameterNames](#upgradingclassessensitiveparameternames), [classes.Stringable](#upgradingclassesstringable), [declarations.deprecatedClass](#upgradingdeclarationsdeprecatedclass), [declarations.deprecatedFunction](#upgradingdeclarationsdeprecatedfunction), [declarations.deprecatedMember](#upgradingdeclarationsdeprecatedmember), [functions.arrayFirstLast](#upgradingfunctionsarrayfirstlast), [functions.arraySearchFunctions](#upgradingfunctionsarraysearchfunctions), [functions.array_is_list](#upgradingfunctionsarray_is_list), [functions.clamp](#upgradingfunctionsclamp), [functions.get_debug_type](#upgradingfunctionsget_debug_type), [functions.json_validate](#upgradingfunctionsjson_validate), [functions.roundingMode](#upgradingfunctionsroundingmode), [functions.substringFunctions](#upgradingfunctionssubstringfunctions), [packages](#upgradingpackages), [php.backticks](#upgradingphpbackticks), [php.caseSemicolon](#upgradingphpcasesemicolon), [php.constructorReturnValue](#upgradingphpconstructorreturnvalue), [php.csvEscapeArgument](#upgradingphpcsvescapeargument), [php.deprecatedApi](#upgradingphpdeprecatedapi), [php.deprecatedArgument](#upgradingphpdeprecatedargument), [php.dollarBraceInterpolation](#upgradingphpdollarbraceinterpolation), [php.dynamicProperty](#upgradingphpdynamicproperty), [php.floatArrayKey](#upgradingphpfloatarraykey), [php.implicitNullable](#upgradingphpimplicitnullable), [php.nullArgument](#upgradingphpnullargument), [php.nullArrayKey](#upgradingphpnullarraykey), [php.reservedNames](#upgradingphpreservednames), [php.returnInFinally](#upgradingphpreturninfinally), [php.sleepAndWakeup](#upgradingphpsleepandwakeup), [phpdoc.deprecated](#upgradingphpdocdeprecated), [phpdoc.readonly](#upgradingphpdocreadonly), [syntax.cloneWith](#upgradingsyntaxclonewith), [syntax.dynamicClassConstant](#upgradingsyntaxdynamicclassconstant), [syntax.firstClassCallables](#upgradingsyntaxfirstclasscallables), [syntax.match](#upgradingsyntaxmatch), [syntax.newInInitializer](#upgradingsyntaxnewininitializer), [syntax.nullsafe](#upgradingsyntaxnullsafe), [syntax.octalPrefix](#upgradingsyntaxoctalprefix), [syntax.pipe](#upgradingsyntaxpipe), [syntax.pipeMinCalls](#upgradingsyntaxpipemincalls), [syntax.promotedProperties](#upgradingsyntaxpromotedproperties), [syntax.readonlyClasses](#upgradingsyntaxreadonlyclasses), [syntax.spreadForArrayMerge](#upgradingsyntaxspreadforarraymerge), [syntax.throwExpression](#upgradingsyntaxthrowexpression)
**upgrading** (58): [api.attributeForAnnotation](#upgradingapiattributeforannotation), [api.attributeForMember](#upgradingapiattributeformember), [api.forbiddenClasses](#upgradingapiforbiddenclasses), [api.forbiddenConstants](#upgradingapiforbiddenconstants), [api.forbiddenFunctions](#upgradingapiforbiddenfunctions), [api.forbiddenMembers](#upgradingapiforbiddenmembers), [api.replacedCalls](#upgradingapireplacedcalls), [api.replacedClasses](#upgradingapireplacedclasses), [api.replacedFunctions](#upgradingapireplacedfunctions), [api.replacedMembers](#upgradingapireplacedmembers), [classes.Override](#upgradingclassesoverride), [classes.SensitiveParameter](#upgradingclassessensitiveparameter), [classes.SensitiveParameterNames](#upgradingclassessensitiveparameternames), [classes.Stringable](#upgradingclassesstringable), [declarations.deprecatedClass](#upgradingdeclarationsdeprecatedclass), [declarations.deprecatedFunction](#upgradingdeclarationsdeprecatedfunction), [declarations.deprecatedMember](#upgradingdeclarationsdeprecatedmember), [functions.arrayFirstLast](#upgradingfunctionsarrayfirstlast), [functions.arraySearchFunctions](#upgradingfunctionsarraysearchfunctions), [functions.array_is_list](#upgradingfunctionsarray_is_list), [functions.clamp](#upgradingfunctionsclamp), [functions.get_debug_type](#upgradingfunctionsget_debug_type), [functions.json_validate](#upgradingfunctionsjson_validate), [functions.roundingMode](#upgradingfunctionsroundingmode), [functions.substringFunctions](#upgradingfunctionssubstringfunctions), [packages](#upgradingpackages), [php.backticks](#upgradingphpbackticks), [php.caseSemicolon](#upgradingphpcasesemicolon), [php.constructorReturnValue](#upgradingphpconstructorreturnvalue), [php.csvEscapeArgument](#upgradingphpcsvescapeargument), [php.deprecatedApi](#upgradingphpdeprecatedapi), [php.deprecatedArgument](#upgradingphpdeprecatedargument), [php.dollarBraceInterpolation](#upgradingphpdollarbraceinterpolation), [php.dynamicProperty](#upgradingphpdynamicproperty), [php.floatArrayKey](#upgradingphpfloatarraykey), [php.implicitNullable](#upgradingphpimplicitnullable), [php.nullArgument](#upgradingphpnullargument), [php.nullArrayKey](#upgradingphpnullarraykey), [php.reservedNames](#upgradingphpreservednames), [php.returnInFinally](#upgradingphpreturninfinally), [php.sleepAndWakeup](#upgradingphpsleepandwakeup), [phpdoc.deprecated](#upgradingphpdocdeprecated), [phpdoc.readonly](#upgradingphpdocreadonly), [syntax.cloneWith](#upgradingsyntaxclonewith), [syntax.dynamicClassConstant](#upgradingsyntaxdynamicclassconstant), [syntax.firstClassCallables](#upgradingsyntaxfirstclasscallables), [syntax.match](#upgradingsyntaxmatch), [syntax.newInInitializer](#upgradingsyntaxnewininitializer), [syntax.nullsafe](#upgradingsyntaxnullsafe), [syntax.octalPrefix](#upgradingsyntaxoctalprefix), [syntax.pipe](#upgradingsyntaxpipe), [syntax.pipeMinCalls](#upgradingsyntaxpipemincalls), [syntax.promotedProperties](#upgradingsyntaxpromotedproperties), [syntax.readonlyClasses](#upgradingsyntaxreadonlyclasses), [syntax.spreadForArrayMerge](#upgradingsyntaxspreadforarraymerge), [syntax.throwExpression](#upgradingsyntaxthrowexpression), [unseen.classNameString](#upgradingunseenclassnamestring), [unseen.dynamicAccess](#upgradingunseendynamicaccess)

**namespaces** (2): [constants](#namespacesconstants), [functions](#namespacesfunctions)

Expand Down Expand Up @@ -4120,6 +4120,7 @@ A class that may not be used, with what to do instead (`Acme\Legacy\Db: "use the
- The standards: perCs `keep`, psr12 `keep`, nette `keep`, symfony `keep`, laravel `keep`
- Rule `DressCode\Rules\Upgrading\ForbiddenSymbolsRule`, stage Structure
- Read by rule `DressCode\Rules\Upgrading\NoDeprecatedClassesRule`, which this decision does not turn on
- Read by rule `DressCode\Rules\Upgrading\UnseenReferencesRule`, which this decision does not turn on

### upgrading.api.forbiddenConstants

Expand Down Expand Up @@ -4176,6 +4177,7 @@ A class written instead of another one, both fully qualified (`Acme\Old\Mailer:
- The standards: perCs `keep`, psr12 `keep`, nette `keep`, symfony `keep`, laravel `keep`
- Rule `DressCode\Rules\Upgrading\ReplacedClassesRule`, stage Structure
- Read by rule `DressCode\Rules\Upgrading\NoDeprecatedClassesRule`, which this decision does not turn on
- Read by rule `DressCode\Rules\Upgrading\UnseenReferencesRule`, which this decision does not turn on
- Modifies comments
- May have risky fixes, made once the decision is named in `fixRisky` or with `--fix-risky`

Expand Down Expand Up @@ -4707,6 +4709,24 @@ A class whose every property is readonly.
- Needs PHP >=8.0
- May have risky fixes, made once the decision is named in `fixRisky` or with `--fix-risky`

### upgrading.unseen.classNameString

A string holding the name of a class `replacedClasses` or `forbiddenClasses` names, which no rename of the class reaches.

- By default `keep`
- Takes: `reported` (reported where it stands: the string `'Acme\Old'` naming a class the maps rename or forbid); `keep`
- The standards: perCs `keep`, psr12 `keep`, nette `keep`, symfony `keep`, laravel `keep`
- Rule `DressCode\Rules\Upgrading\UnseenReferencesRule`, stage Structure

### upgrading.unseen.dynamicAccess

A member, a class or a function reached by a name the code computes, which no map of upgrading data matches.

- By default `keep`
- Takes: `reported` (reported where it stands: `$object->$method()`, `new $class`, `call_user_func($callback)`); `keep`
- The standards: perCs `keep`, psr12 `keep`, nette `keep`, symfony `keep`, laravel `keep`
- Rule `DressCode\Rules\Upgrading\UnseenReferencesRule`, stage Structure

## namespaces

### namespaces.constants
Expand Down
Loading