chore(deps-dev): update rector/rector requirement from 1.0.2 to 1.0.4
Updates the requirements on rector/rector to permit the latest version.
Release notes
Sourced from rector/rector's releases.
Released Rector 1.0.4
New Features and Changes :partying_face:
- [Php84] Add ExplicitNullableParamTypeRector (#5724)
- [Transform] Adds ArrayDimFetchToMethodCallRector rule (#5723), Thanks
@peterfox!- Add support for getOneOrNullResult() method in ChildDoctrineRepositoryClassTypeRector (#5747)
- Add boolean and support to RemoveDeadInstanceOfRector (#5748)
- [DeadCode] Add new rule - ReduceAlwaysFalseIfOrRector (https://github.com/rectorphp/rector-src/commit/0dd1a43904e7d12c76e810b1bbd87d99a0f835c3)
- [CodeQuality] Add new rule - ExplicitReturnNullRector (#5753)
- [CodeQuality] Transform type|void docblock to type|null as well on ExplicitReturnNullRector after add return null (https://github.com/rectorphp/rector-src/commit/576198cf701684dd85ed42530bcb8c54b6c41a02)
- [CodeQuality] Add Function_ support on ExplicitReturnNullRector (#5762)
- [CodeQuality] Add Goto_ possible return null on SilentVoidResolver under Do_ (#5773)
- Add
rectortest suite tophpunit.xmlorphpunit.xml.dist(#5717), Thanks@ghostwriter!- [Php82] Add VariableInStringInterpolationFixerRector (#5781)
- [DeadCode] Add RemoveUselessReadOnlyTagRector (https://github.com/rectorphp/rector-src/commit/ef333de3d58a4649558971b19f4814fd92823abe)
Bugfixes :bug:
- [php84] Clean up contains null check type on ExplicitNullableParamTypeRector (#5726)
- Fixes for ArrayDimFetchToMethodCallRector (#5727), Thanks
@peterfox!- Update ArrayDimFetchToMethodCall to use ObjectType (#5728), Thanks
@peterfox!- [Configuration] Do not sets, skip, rules on empty array on RectorConfigBuilder (#5731)
- [Php81] Skip $this::class on trait on NullToStrictStringFuncCallArgRector (#5732)
- [Dep] Temporary pin to use nikic/php-parser 4.18.0 (#5733)
- Handle readonly class with attrs (#5736), Thanks
@tugmaks!- [Scoper] Handle use nette/utils on php < 7.4 on 6th param on preg_replace_callback() (https://github.com/rectorphp/rector-src/commit/fd9e17209bc91983324f07902980d9957c232673)
- [Renaming][AutoImport] Handle after change annotation to attribute with rename on AnnotationToAttributeRector + RenameClassRector with auto import (#5741)
- [Php80] Skip var property usage on ClassPropertyAssignToConstructorPromotionRector (#5744)
- [Php80] Use identical compare on PromotedPropertyCandidateResolver (#5745)
- Fix ChildDoctrineRepositoryClassTypeRector for generic type (#5746)
- [DeadCode] Skip From docblock on ReduceAlwaysFalseIfOrRector (https://github.com/rectorphp/rector-src/commit/f32dff3ddb3bb8062fced070984017352f2b653a)
- [CodeQuality] Skip if else return on ExplicitReturnNullRector (#5755)
- [CodeQuality] No need to re-update doc when already union null doc on ExplicitReturnNullRector (#5757)
- [CodeQuality] Skip __construct() method on ExplicitReturnNullRector (#5758)
- [CodeQuality] Move Yield_ and YieldFrom check to SilentVoidResolver (#5759)
- [CodeQuality] Skip do { } while always returned on ExplicitReturnNullRector (https://github.com/rectorphp/rector-src/commit/cae06912ed7d7274d900fdc996448f100be2ed34)
- [CodeQuality] Allow transform return; to return null; when there is other return with Expr on ExplicitReturnNullRector (#5761)
- [AutoImport] Allow auto import same namespace with sub use with docblock short name (https://github.com/rectorphp/rector-src/commit/e3e741edd3ca55fc2c24c040f43c8974bda7e953)
- [CodeQuality] Handle do { } while maybe returned on ExplicitReturnNullRector (#5766)
- More fixture on Do_ maybe returned (#5767)
- [DeadCode] Fix array callable with constructor args (#5770), Thanks
@hogejiro!- [TypeDeclaration] Ensure always return with Expr on maybe continued in next stmt on SilentVoidResolver (#5771)
- [Scope] Fix resolve Scope from fluent call (#5743)
- Clean up scope skip scope check on ExprScopeFromStmtNodeVisitor (#5776)
- [NodeCollector] Fix non-string value on ArrayCallableMethodMatcher::resolveClassContextType() (#5780)
- [Printer] Apply configurable multiline on Fluent Method Call on print after method call created/re-printed (#5779)
- [TypeDeclaration] Handle initialized on getter on ReturnTypeFromStrictTypedPropertyRector (#5784)
- [TypeDeclaration] Handle in inner function on ReturnTypeFromStrictTernaryRector (#5785)
... (truncated)
Commits
6e04d0eRector 1.0.4d59efe6Updated Rector to commit a16a04d0bc90df11918efd4b7fc117a9e3dcc1c3e004423Updated Rector to commit 8e022d170a2e88d66e12631536f298de8b22d42df81fa92Updated Rector to commit a43f37190db97fb8807cb08f4e7171a338625387d36c8adUpdated Rector to commit 0348124a5535b99712da4debc136d2e73647b97ab352c84Updated Rector to commit 0348124a5535b99712da4debc136d2e73647b97a6e65fefUpdated Rector to commit 88648d1e6fe18bcc67ea76ebdc76c1d1e6d1fe6f81fd362Updated Rector to commit 91ed251a8c450a776ec4b739c735b4bd6f9bf8d5a210882Updated Rector to commit e5037921c408b717756a3997e8111ae3729aef0877aab2eUpdated Rector to commit 3f1ccb3ea131997a435fc2211620e968c6732220- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
I don't know why psalm does not know these common functions. It worked with CI 4.4, but does not work with CI 4.5.
Run vendor/bin/psalm
Warning: "findUnusedBaselineEntry" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedBaselineEntry" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Target PHP version: 7.4 (inferred from composer.json).
Scanning files...
Analyzing files...
░░░░░░░░░░░░░░░
Error: src/Commands/ClearSettings.php:20:9: UndefinedFunction: Function CodeIgniter\Settings\Commands\service does not exist (see https://psalm.dev/021)
Error: src/Config/Services.php:33:40: UndefinedFunction: Function CodeIgniter\Settings\Config\config does not exist (see https://psalm.dev/021)
Error: src/Database/Migrations/2021-07-04-041948_CreateSettingsTable.php:15:26: UndefinedFunction: Function CodeIgniter\Settings\Database\Migrations\config does not exist (see https://psalm.dev/021)
Error: src/Database/Migrations/2021-11-14-143905_AddContextColumn.php:15:26: UndefinedFunction: Function CodeIgniter\Settings\Database\Migrations\config does not exist (see https://psalm.dev/021)
Error: src/Handlers/DatabaseHandler.php:41:26: UndefinedFunction: Function CodeIgniter\Settings\Handlers\config does not exist (see https://psalm.dev/021)
Error: src/Handlers/DatabaseHandler.php:42:26: UndefinedFunction: Function CodeIgniter\Settings\Handlers\db_connect does not exist (see https://psalm.dev/021)
Error: src/Helpers/setting_helper.php:17:20: UndefinedFunction: Function service does not exist (see https://psalm.dev/021)
Error: src/Settings.php:168:19: UndefinedFunction: Function CodeIgniter\Settings\config does not exist (see https://psalm.dev/021)
Error: tests/DatabaseHandlerTest.php:39:29: UndefinedFunction: Function Tests\config does not exist (see https://psalm.dev/021)
Error: tests/DatabaseHandlerTest.php:64:38: UndefinedFunction: Function Tests\config does not exist (see https://psalm.dev/021)
Error: tests/DatabaseHandlerTest.php:76:38: UndefinedFunction: Function Tests\config does not exist (see https://psalm.dev/021)
Error: tests/HelperTest.php:20:9: UndefinedFunction: Function Tests\helper does not exist (see https://psalm.dev/021)
Error: tests/HelperTest.php:40:27: UndefinedFunction: Function Tests\service does not exist (see https://psalm.dev/021)
Error: tests/HelperTest.php:46:9: UndefinedFunction: Function Tests\service does not exist (see https://psalm.dev/021)
Error: tests/HelperTest.php:53:9: UndefinedFunction: Function Tests\service does not exist (see https://psalm.dev/021)
Error: tests/HelperTest.php:57:28: UndefinedFunction: Function Tests\service does not exist (see https://psalm.dev/021)
Error: tests/SettingsTest.php:16:29: UndefinedFunction: Function Tests\config does not exist (see https://psalm.dev/021)
Error: tests/SettingsTest.php:29:29: UndefinedFunction: Function Tests\config does not exist (see https://psalm.dev/021)
Error: tests/SettingsTest.php:32:21: UndefinedFunction: Function Tests\service does not exist (see https://psalm.dev/021)
Error: tests/SettingsTest.php:40:27: UndefinedFunction: Function Tests\config does not exist (see https://psalm.dev/021)
Error: tests/SettingsTest.php:45:27: UndefinedFunction: Function Tests\config does not exist (see https://psalm.dev/021)
Error: tests/_support/TestCase.php:27:29: UndefinedFunction: Function Tests\Support\config does not exist (see https://psalm.dev/021)
------------------------------
22 errors found
------------------------------
68 other issues found.
You can display them with --show-info=true
------------------------------
Psalm can automatically fix 31 of these issues.
Run Psalm again with
--alter --issues=MissingReturnType --dry-run
to see what it can fix.
------------------------------
Checks took 4.50 seconds and used 294.952MB of memory
Psalm was able to infer types for 88.4565% of the codebase
Error: Process completed with exit code 2.
https://github.com/codeigniter4/settings/actions/runs/8596658779/job/23553692236?pr=125
(Added) I found the solution: https://github.com/codeigniter4/shield/pull/1089
It's odd that Psalm was pulling the lowest possible version instead of using the runtime:
Target PHP version: 7.4 (inferred from composer.json).
Set the php version Psalm should assume when checking and/or fixing the project. If this attribute is not set, Psalm uses the declaration in composer.json if one is present. It will check against the earliest version of PHP that satisfies the declared php dependency
This can be overridden on the command-line using the --php-version= flag which takes the highest precedence over both the phpVersion setting and the version derived from composer.json.
Maybe instead of using the config file we should set it via the command line flag in Actions so it can be run as a matrix?
I don't know why UndefinedFunction occurs when the Target PHP version is 7.4. But at least, CI v4.5.0 requires 8.1 and PHP 7.4 does not work. So the Psalm's behavior may also be unpredictable.
I sent #126 for now.
I don't see much need to run Psalm on multiple PHP versions. PHPStan runs on all versions.
Superseded by #127.