Skip to content

refactor: upgrade to use phpstan 2 and rector 2 - #9322

Merged
paulbalandan merged 3 commits into
codeigniter4:developfrom
samsonasik:refactor-upgrade-phpstan-2-rector-2
Dec 15, 2024
Merged

refactor: upgrade to use phpstan 2 and rector 2#9322
paulbalandan merged 3 commits into
codeigniter4:developfrom
samsonasik:refactor-upgrade-phpstan-2-rector-2

Conversation

@samsonasik

Copy link
Copy Markdown
Member

Description

This PR upgrade to use PHPStan 2 and Rector 2.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@samsonasik

Copy link
Copy Markdown
MemberAuthor

/cc @ddevsr

@samsonasik
samsonasik marked this pull request as draft December 14, 2024 21:32
@samsonasik

Copy link
Copy Markdown
MemberAuthor

phpstan-codeigniter seems stil require phpstan v1, so in there should be updated first:

 Problem 1
- Root composer.json requires codeigniter/phpstan-codeigniter ^1.4 -> satisfiable by codeigniter/phpstan-codeigniter[v1.4.0, ..., v1.5.1].
- codeigniter/phpstan-codeigniter[v1.4.0, ..., v1.4.2.70400] require phpstan/phpstan ^1.10 -> found phpstan/phpstan[1.10.0, ..., 1.12.12] but it conflicts with your root composer.json require (^2.0).

@samsonasik

Copy link
Copy Markdown
MemberAuthor

Ok, bump to use phpstan-codeigniter 1.5.1 is the way 9b6d9bf

@samsonasik

Copy link
Copy Markdown
MemberAuthor

install seems got codeigniter ^4.5 conflict notice:

Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires codeigniter/phpstan-codeigniter ^1.5.1 -> satisfiable by codeigniter/phpstan-codeigniter[v1.5.1].
- codeigniter/phpstan-codeigniter v1.5.1 requires codeigniter4/framework ^4.5 -> found codeigniter4/framework[v4.5.0, ..., v4.5.5] but these were not loaded, likely because it conflicts with another require.

ref https://github.com/codeigniter4/CodeIgniter4/actions/runs/12333325314/job/34422197398?pr=9322

@paulbalandan@kenjis any idea?

@paulbalandan

Copy link
Copy Markdown
Member

@samsonasik that should be taken care of in #9299, i just need to get @kenjis ' approval

@paulbalandan

Copy link
Copy Markdown
Member

@samsonasik pls rebase in latest develop. probably you would just need to update rector version

@samsonasik
samsonasikforce-pushed the refactor-upgrade-phpstan-2-rector-2 branch from 9b6d9bf to 1147411CompareDecember 15, 2024 05:33
@samsonasik

Copy link
Copy Markdown
MemberAuthor

Rebased 👍

@samsonasik

Copy link
Copy Markdown
MemberAuthor

Setup PHP error seems unrelated:

==> Setup PHP
✗ PHP Could not setup PHP 8.3
Error: The process '/usr/bin/bash' failed with exit code 1

@ddevsrddevsr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ddevsrddevsr added the refactor Pull requests that refactor code label Dec 15, 2024
@paulbalandan
paulbalandan marked this pull request as ready for review December 15, 2024 18:02

@paulbalandanpaulbalandan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to go. I'm merging this.

@paulbalandan
paulbalandan merged commit 61881bd into codeigniter4:developDec 15, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactorPull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@samsonasik@paulbalandan@ddevsr