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

Raise min PHP version to PHP 7.3, check compatibility PHP 8.3. #19959

Closed
wants to merge 14 commits into from
Closed

Raise min PHP version to PHP 7.3, check compatibility PHP 8.3. #19959

wants to merge 14 commits into from

Conversation

terabytesoftw
Copy link
Member

@terabytesoftw terabytesoftw commented Sep 20, 2023

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

This PR introduces the following changes:

  1. Raises the minimum PHP version to 7.3.
  2. Update PHPUNIT to version 9.6.
  3. Removes the cgwans path for PHPUNIT.
  4. Add tests for PHP version 8.3.
  5. Add tests for PGSQL version 16.

These changes could potentially enable us to introduce type hinting in the code in the future, prevent unintended errors, incorporate static analysis tools such as PHPSTAN, and implement code styling using StyleCI.

Yii2-Extensions:

@what-the-diff
Copy link

what-the-diff bot commented Sep 20, 2023

PR Summary

  • Expanded PHP matrix for compatibility testing
    This pull request expands our compatibility testing to incorporate the more recent versions of PHP, including PHP 8.3 in various testing environments such as MSSQL, MySQL, SQLite, and PostgreSQL. This allows us to ensure that our codebase works properly across a larger range of PHP versions.

  • Updated required PHP version
    The codebase now requires PHP 7.4 or later to operate, marking an increase from the previous minimum of version 5.4.0. This change reflects the move towards newer PHP functionalities and ensures our code remains up to date with recent PHP standards.

  • Composer.json dependency management
    Several outdated or unnecessary dependencies were removed from the composer.json files, and some existing dependencies were updated for better compatibility and performance. New dependencies were also added as necessary.

  • Changes in Test Case structure
    We have updated our test cases to meet the syntax and design of newer PHP and PHPUnit versions, including changes to assertion methods and test case classes. This is done to align our testing process with up-to-date standards and practices.

  • Addition and Removal of Features
    A new public method getColumnWidths() was added to Table.php for better data management. We also removed some redundant or deprecated features from our codebase, like the compatibility.php file and the inclusion of this file in bootstrap.php.

  • Return Type Declarations
    Several methods in our test files have been updated to include return type declarations, specifically for those implementing the setUp() and tearDown() methods with void.

  • Assertion Method Upgrades
    Various instances of the earlier assertion methods (like assertContains() or assertRegExp()) used in test cases have been replaced with more appropriate ones as per the latest PHPUnit standards like assertStringContainsString(), assertMatchesRegularExpression(), and assertIsString().

  • Updated Test Cases
    Numerous test cases have been modified for better consistency and accuracy. This includes adding exception expectations, making sure methods return an appropriate void declaration, and updating assertion methods.

@terabytesoftw terabytesoftw requested a review from a team September 20, 2023 16:05
@terabytesoftw terabytesoftw added the status:code review The pull request needs review. label Sep 20, 2023
@rob006
Copy link
Contributor

rob006 commented Sep 20, 2023

Why PHP 7.4? PHPUnit 9 should work fine with PHP 7.3.

@terabytesoftw
Copy link
Member Author

Why PHP 7.4? PHPUnit 9 should work fine with PHP 7.3.

I thought about the latest version of PHP 7, the most recent, 7.4, but if everyone agrees, i can lower it to 7.3, the tests will pass anyway.

@terabytesoftw terabytesoftw changed the title Raise min PHP version to PHP 7.4, check compatibility PHP 8.3. Raise min PHP version to PHP 7.3, check compatibility PHP 8.3. Sep 20, 2023
@rob006
Copy link
Contributor

rob006 commented Sep 20, 2023

I think we can safely remove https://github.com/yiisoft/yii2/blob/81f3033087b5568442ca4013ce2b6149336722bb/framework/base/Object.php, since it is unusable since PHP 7.2.

@terabytesoftw
Copy link
Member Author

terabytesoftw commented Sep 20, 2023

Why PHP 7.4? PHPUnit 9 should work fine with PHP 7.3.

I thought about the latest version of PHP 7, the most recent, 7.4, but if everyone agrees, i can lower it to 7.3, the tests will pass anyway.

Done PHP 7.3.

I particularly prefer 7.4, it would allow the code to be typified.

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (53f1619) 48.94% compared to head (cee4222) 66.37%.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #19959       +/-   ##
=============================================
+ Coverage     48.94%   66.37%   +17.43%     
- Complexity        0    11360    +11360     
=============================================
  Files           445      429       -16     
  Lines         42817    35987     -6830     
=============================================
+ Hits          20956    23888     +2932     
+ Misses        21861    12099     -9762     
Files Coverage Δ
framework/console/widgets/Table.php 99.40% <ø> (+27.13%) ⬆️

... and 376 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@terabytesoftw terabytesoftw closed this by deleting the head repository Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants