Skip to content

refactor: replace PHP_VERSION by PHP_VERSION_ID - #8618

Merged
samsonasik merged 3 commits into
codeigniter4:developfrom
justbyitself:patch-2
Mar 12, 2024
Merged

samsonasik merged 3 commits into
codeigniter4:developfrom
justbyitself:patch-2

Conversation

@justbyitself

Copy link
Copy Markdown
Contributor

PHP_VERSION_ID is shorter and the most commonly used in this repository.

PHP_VERSION_ID is prefered at CodeIgniter4 repository.
@justbyitself justbyitself changed the title refactor: Replace PHP_VERSION by PHP_VERSION_ID refactor: replace PHP_VERSION by PHP_VERSION_ID Mar 11, 2024
@samsonasik

samsonasik commented Mar 11, 2024

Copy link
Copy Markdown
Member

There is already VersionCompareFuncCallToConstantRector rector rule for that

https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#versioncomparefunccalltoconstantrector

Could you add to the rector.php so it will be detected automatically in the future? Thank you.

justbyitself added a commit to justbyitself/CodeIgniter4 that referenced this pull request Mar 11, 2024
justbyitself added a commit to justbyitself/CodeIgniter4 that referenced this pull request Mar 11, 2024
@samsonasik

Copy link
Copy Markdown
Member

It seems you commit in separate branch, you can commit new change here that the PR include rector.php + code change

Add Rector rule in order to replace PHP_VERSION by PHP_VERSION_ID.
@samsonasik suggestion: codeigniter4#8619
@justbyitself

Copy link
Copy Markdown
Contributor Author

@samsonasik OK, done. Thank you.

@paulbalandan

paulbalandan commented Mar 11, 2024

Copy link
Copy Markdown
Member

@justbyitself please run the following in your terminal:

composer cs-fix
vendor/bin/rector process system

Then commit and push the changes.

@kenjis kenjis added the refactor Pull requests that refactor code label Mar 12, 2024

@kenjis kenjis 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.

LGTM!

@samsonasik
samsonasik merged commit de073e2 into codeigniter4:develop Mar 12, 2024
@samsonasik

Copy link
Copy Markdown
Member

Thank you @justbyitself

@justbyitself

Copy link
Copy Markdown
Contributor Author

Thank you @samsonasik @paulbalandan @kenjis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants