Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 8, 2024

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 🥳

  • [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 (rectorphp/rector-src@0dd1a43)
  • [CodeQuality] Add new rule - ExplicitReturnNullRector (#5753)
  • [CodeQuality] Transform type|void docblock to type|null as well on ExplicitReturnNullRector after add return null (rectorphp/rector-src@576198c)
  • [CodeQuality] Add Function_ support on ExplicitReturnNullRector (#5762)
  • [CodeQuality] Add Goto_ possible return null on SilentVoidResolver under Do_ (#5773)
  • Add rector test suite to phpunit.xml or phpunit.xml.dist (#5717), Thanks @​ghostwriter!
  • [Php82] Add VariableInStringInterpolationFixerRector (#5781)
  • [DeadCode] Add RemoveUselessReadOnlyTagRector (rectorphp/rector-src@ef333de)

Bugfixes 🐛

  • [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() (rectorphp/rector-src@fd9e172)
  • [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 (rectorphp/rector-src@f32dff3)
  • [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 (rectorphp/rector-src@cae0691)
  • [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 (rectorphp/rector-src@e3e741e)
  • [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)

Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version.
- [Release notes](https://github.com/rectorphp/rector/releases)
- [Commits](rectorphp/rector@1.0.2...1.0.4)

---
updated-dependencies:
- dependency-name: rector/rector
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file php Pull requests that update Php code labels Apr 8, 2024
@kenjis
Copy link
Member

kenjis commented Apr 8, 2024

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: codeigniter4/shield#1089

@MGatner
Copy link
Member

MGatner commented Apr 10, 2024

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
Copy link
Member

MGatner commented Apr 10, 2024

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?

kenjis added a commit to kenjis/codeigniter4-settings that referenced this pull request Apr 12, 2024
@kenjis kenjis mentioned this pull request Apr 12, 2024
1 task
@kenjis
Copy link
Member

kenjis commented Apr 12, 2024

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.

Copy link
Contributor Author

dependabot bot commented on behalf of github May 10, 2024

Superseded by #127.

@dependabot dependabot bot closed this May 10, 2024
@dependabot dependabot bot deleted the dependabot/composer/rector/rector-1.0.4 branch May 10, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants