-
Notifications
You must be signed in to change notification settings - Fork 2
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
Drop PHP 7.x support and add PHP 8.3 support #11
Conversation
The .scrutinizer.yml file has been updated to run PHP tests specifically on version 8.2. Additionally, the previous list of tools has been removed, including PHP mess detector, PHP analyzer, etc., presumably because they are no longer needed.
This commit added 'bamarni/composer-bin-plugin' to the allowed plugins section in the composer.json configuration. This is necessary to ensure compatibility and functionality with this particular plugin.
This commit removes the entire build.xml file, a configuration file for build tools. This document provided specific instructions to the build process, including tasks for various test and report generation. The deletion may suggest a shift to a different build process.
The PHP version requirement has been updated in composer.json. The support now is for PHP version 8.1 only, older versions (7.3 and 8.0) are not included in the "require" field anymore.
The annotation syntax for Stream has been migrated from Doctrine to the native PHP 8 Attributes. Changes have been made in several files including Streamer.php, Annotation/Stream.php, and StreamTransferInject.php. Also, the dependency on "doctrine/annotations" has been removed from composer.json as it is no longer needed.
Updated the doctrine/coding-standard from version 8.2 to version 11 in composer.json. Also added configuration to allow the use of dealerdirect/phpcodesniffer-composer-installer plugin.
The code has been refactored to improve clarity and compatibility with PHP 8. Key changes involve using constructor property and parameter promotion and changing comments to PHP 8's more intuitive format. The random number generator in the StreamRenderer has also been modified for better randomness.
Add Stream annotation and update StreamProvider comments Stream annotation is added in Streamer.php. The comments in StreamProvider.php are updated to explicitly state that it implements ProviderInterface<resource>. This gives better understanding of the code structure and the relationship between StreamProvider and ProviderInterface.
The update ensures that the `ResourceObject` body is iterable before processing. It also tweaks the `StreamResponder` to avoid setting HTTP response codes when running under command-line interface (CLI) and only attempts to render `ResourceObject` if its `view` property is `null`. Unnecessary annotation in `IntegrateTest` was also removed and `StreamTransferInject` was updated with necessary dependencies.
Updated phpstan.neon configuration file from 'excludes_analyse' to 'excludePaths'. This change suits the new syntax guidelines for the application paths, specifically for the 'tests/Fake' directory.
This commit dramatically simplifies our GitHub workflows for continuous integration, coding standards checking, and static analysis. We've switched to utilizing shared workflows from ray-di GitHub instead of maintaining several complex, custom workflows. This change streamlines the validation process and reduces redundancy in our codebase while upgrading PHP version to 8.3.
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent changes across various configuration and source files primarily focus on updating PHP compatibility to version 8.3. This includes modifying GitHub workflows, updating Composer dependencies, and refactoring source code for better type safety and modern PHP features. The updates aim to streamline coding standards, continuous integration, and static analysis processes while ensuring compatibility with the latest PHP versions. Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
The current version of PHPUnit used for development has been updated to "^9.6.19". This is to ensure that our testing framework remains current and incorporates the latest features and security fixes available in this version.
@coderabbitai review |
Actions performedReview triggered.
|
1 similar comment
Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (15)
- .github/workflows/coding-standards.yml (1 hunks)
- .github/workflows/continuous-integration.yml (1 hunks)
- .github/workflows/static-analysis.yml (1 hunks)
- .scrutinizer.yml (1 hunks)
- composer.json (2 hunks)
- phpstan.neon (1 hunks)
- src/Annotation/Stream.php (1 hunks)
- src/StreamProvider.php (1 hunks)
- src/StreamRenderer.php (3 hunks)
- src/StreamResponder.php (3 hunks)
- src/StreamTransferInject.php (2 hunks)
- src/Streamer.php (1 hunks)
- src/StreamerInterface.php (1 hunks)
- tests/IntegrateTest.php (3 hunks)
- vendor-bin/tools/composer.json (1 hunks)
Files skipped from review due to trivial changes (2)
- .scrutinizer.yml
- src/StreamerInterface.php
Additional comments not posted (20)
phpstan.neon (1)
6-6
: Change aligns with PHPStan's latest configuration standards..github/workflows/static-analysis.yml (1)
9-12
: Simplification of the static analysis workflow is well-aligned with the project's goals..github/workflows/coding-standards.yml (1)
9-12
: Update to coding standards workflow is consistent with the modernization efforts.Verification successful
The recent runs of the
coding-standards.yml
workflow show successful completions for the latest changes, indicating that the new configuration is working as expected.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct execution of the new coding standards workflow. # Test: Trigger the workflow manually via GitHub Actions to ensure it runs correctly with the new configuration. echo "Manually trigger the workflow in GitHub Actions and check for successful completion."Length of output: 178
Script:
#!/bin/bash # Description: Check the recent runs of the coding-standards.yml workflow and their statuses. # List the recent runs of the coding-standards.yml workflow gh run list --workflow=coding-standards.yml --limit 5Length of output: 603
src/Annotation/Stream.php (1)
9-9
: Transition to PHP 8 attributes is correctly implemented..github/workflows/continuous-integration.yml (1)
9-13
: LGTM! Verify the new GitHub action for compatibility and functionality.vendor-bin/tools/composer.json (1)
3-3
: LGTM! Ensure compatibility of the new coding standard and plugin with PHP 8.3.Also applies to: 10-14
src/StreamProvider.php (1)
13-13
: LGTM! The explicit interface implementation enhances type safety and clarity.src/StreamTransferInject.php (1)
17-19
: LGTM! Verify the correct functionality of the new PHP 8 attributes in practice.Also applies to: 25-26
Verification successful
The attributes
#[Inject]
and#[Stream]
are present in the codebase, specifically in thesrc/StreamTransferInject.php
file. This confirms that the attributes have been correctly applied in the methods.
#[Inject]
is found insrc/StreamTransferInject.php
.#[Stream]
is found in bothsrc/StreamTransferInject.php
andsrc/Streamer.php
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct functionality of the new PHP 8 attributes in `setRenderer` and `setTransfer` methods. # Test: Check if the attributes are correctly interpreted and function as expected. ast-grep --lang php --pattern $'trait StreamTransferInject { $$$ #[Inject] #[Stream] $_($_) { $$$ } $$$ }'Length of output: 230
Script:
#!/bin/bash # Description: Verify the correct functionality of the new PHP 8 attributes in `setRenderer` and `setTransfer` methods. # Test: Check if the attributes are correctly interpreted and function as expected. rg --multiline --multiline-dotall 'trait StreamTransferInject \{.*?#[Inject].*?#[Stream].*?\}' --glob '*.php'Length of output: 111
Script:
#!/bin/bash # Description: Verify the correct functionality of the new PHP 8 attributes in `setRenderer` and `setTransfer` methods. # Test: Check if the `#[Inject]` attribute is present in the codebase. rg --multiline --multiline-dotall '#\[Inject\]' --glob '*.php' # Test: Check if the `#[Stream]` attribute is present in the codebase. rg --multiline --multiline-dotall '#\[Stream\]' --glob '*.php'Length of output: 332
src/StreamResponder.php (3)
19-19
: Constructor now correctly usesprivate readonly
for immutability.
30-30
: Improved null check enhances type safety and clarity.
40-42
: CLI check aroundhttp_response_code
is a good practice to avoid unnecessary operations in CLI mode.src/Streamer.php (2)
24-24
: Addingarray
type declaration enhances type safety.
28-28
: Use of PHP 8 constructor property promotion enhances code simplicity and readability.src/StreamRenderer.php (2)
26-31
: Constructor and property changes correctly use PHP 8 features for better immutability and type safety.
80-80
: Use ofassert
for checking iterability enhances robustness and prevents runtime errors.composer.json (2)
29-29
: Updated PHP version requirement aligns with the PR's objectives to support newer PHP versions.
36-36
: Updatedphpunit
version ensures compatibility with the new PHP version.tests/IntegrateTest.php (3)
27-29
: Type declarations for properties enhance type safety and maintainability.
39-39
: Improved annotation forcaseProvider
enhances clarity on the expected return type.
74-74
: Proper use of assertions and stream handling intestRender
ensures robust testing.
Closes #10