settings icon indicating copy to clipboard operation
settings copied to clipboard

chore(deps-dev): update rector/rector requirement from 1.0.2 to 1.0.4

Open dependabot[bot] opened this issue 2 years ago • 4 comments

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:

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
  • 6e04d0e Rector 1.0.4
  • d59efe6 Updated Rector to commit a16a04d0bc90df11918efd4b7fc117a9e3dcc1c3
  • e004423 Updated Rector to commit 8e022d170a2e88d66e12631536f298de8b22d42d
  • f81fa92 Updated Rector to commit a43f37190db97fb8807cb08f4e7171a338625387
  • d36c8ad Updated Rector to commit 0348124a5535b99712da4debc136d2e73647b97a
  • b352c84 Updated Rector to commit 0348124a5535b99712da4debc136d2e73647b97a
  • 6e65fef Updated Rector to commit 88648d1e6fe18bcc67ea76ebdc76c1d1e6d1fe6f
  • 81fd362 Updated Rector to commit 91ed251a8c450a776ec4b739c735b4bd6f9bf8d5
  • a210882 Updated Rector to commit e5037921c408b717756a3997e8111ae3729aef08
  • 77aab2e Updated 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 rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will 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 version will 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 dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

dependabot[bot] avatar Apr 08 '24 08:04 dependabot[bot]

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

kenjis avatar Apr 08 '24 10:04 kenjis

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).

MGatner avatar Apr 10 '24 11:04 MGatner

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?

MGatner avatar Apr 10 '24 11:04 MGatner

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.

kenjis avatar Apr 12 '24 02:04 kenjis

Superseded by #127.

dependabot[bot] avatar May 10 '24 08:05 dependabot[bot]