-
Notifications
You must be signed in to change notification settings - Fork 22
added php 8.4 support and tests #379
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds PHP 8.4 support and related CI coverage, replaces legacy utf8_encode
/utf8_decode
calls with mb_convert_encoding
, and tightens up type hints with nullable types across the codebase.
- Switch encoding functions to
mb_convert_encoding
in both source and tests - Update method signatures to use nullable type hints for PHP 8.x compatibility
- Add PHP 8.4 job to the GitHub Actions workflow and bump
composer.json
requirement
Reviewed Changes
Copilot reviewed 29 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
composer.json | Added ^8.4 to supported PHP versions |
.github/workflows/tests.yaml | Introduced php8-4 job for CI |
src/Util/Json.php | Replaced utf8_encode with mb_convert_encoding |
src/ShareUrl/Policy/DynamicPolicyBuilder.php | Made parameters nullable and renamed advanced identity method |
tests/Util/JsonTest.php | Updated tests to use mb_convert_encoding instead of utf8_decode |
tests/ShareUrl/Policy/DynamicPolicyBuilderTest.php | Updated test to call the renamed method |
Comments suppressed due to low confidence (2)
tests/ShareUrl/Policy/DynamicPolicyBuilderTest.php:722
- [nitpick] This abbreviated method name is inconsistent with other builder methods which use full words (e.g.,
withAdvancedIdentityProfileRequirements
). Consider keeping the descriptive name for better clarity and API consistency.
->withAdvIdentityProfileReqs($advancedIdentityProfileSample)
src/ShareUrl/Policy/DynamicPolicyBuilder.php:414
- [nitpick] The method name
withAdvIdentityProfileReqs
is an abbreviation of the originalwithAdvancedIdentityProfileRequirements
. Abbreviations can reduce readability; consider restoring the full, descriptive name to maintain a clear and consistent API.
public function withAdvIdentityProfileReqs($advancedIdentityProfileRequirements): self
$latin1String = mb_convert_encoding('éàê', 'ISO-8859-1', 'UTF-8'); | ||
$latin1Array = [ | ||
mb_convert_encoding('éàê', 'ISO-8859-1', 'UTF-8'), | ||
mb_convert_encoding('çî', 'ISO-8859-1', 'UTF-8') | ||
]; | ||
$nestedLatin1Array = [ | ||
mb_convert_encoding('éàê', 'ISO-8859-1', 'UTF-8'), | ||
[ | ||
mb_convert_encoding('çî', 'ISO-8859-1', 'UTF-8'), | ||
mb_convert_encoding('üñ', 'ISO-8859-1', 'UTF-8') | ||
] | ||
]; | ||
|
||
$latin1Object = new \stdClass(); | ||
$latin1Object->property1 = utf8_decode('éàê'); | ||
$latin1Object->property2 = utf8_decode('çî'); | ||
$latin1Object->property1 = mb_convert_encoding('éàê', 'ISO-8859-1', 'UTF-8'); | ||
$latin1Object->property2 = mb_convert_encoding('çî', 'ISO-8859-1', 'UTF-8'); | ||
|
||
$nestedLatin1Object = new \stdClass(); | ||
$nestedLatin1Object->property = utf8_decode('çî'); | ||
$nestedLatin1Object->property = mb_convert_encoding('çî', 'ISO-8859-1', 'UTF-8'); |
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.
[nitpick] There are many repeated calls to mb_convert_encoding
with the same parameters. Consider extracting a small helper function (e.g., latin1($str)
) to DRY up these tests and improve readability.
Copilot uses AI. Check for mistakes.
No description provided.