Skip to content

PHP v8.4 upgrade and fixes#1

Merged
dostrog merged 13 commits intomasterfrom
feature/update-packages
Jun 14, 2025
Merged

PHP v8.4 upgrade and fixes#1
dostrog merged 13 commits intomasterfrom
feature/update-packages

Conversation

@dostrog
Copy link
Copy Markdown
Owner

@dostrog dostrog commented Jun 14, 2025

No description provided.

@dostrog dostrog requested a review from Copilot June 14, 2025 08:02
Copy link
Copy Markdown

Copilot AI left a 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 upgrades the PHP version to v8.4 and applies various type and syntax improvements across the codebase while updating dependencies and test expectations.

  • Upgraded PHP version and dependency versions in composer.json.
  • Refactored service classes and value objects to use readonly properties and constructor property promotion.
  • Updated tests to match new method signatures and replaced Safe functions with native ones where appropriate.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Unit/NationalBankOfUkraineTest.php Debug output added in a test expecting an exception
tests/Unit/CacheTest.php Replaced Safe sprintf with native sprintf
tests/TestCase.php Enabled migration attribute and re-enabled package aliases
tests/Feature/LarateTest.php Changed provider name assertion to allow multiple values
testbench.yaml Introduced testbench configuration
src/StringHelper.php Revised exception rethrow to include the previous exception
src/Services/RussianCentralBank.php Added strict type declarations and updated error message details in parseRateData
src/Services/NationalBankOfUkraine.php Improved float parsing with a new helper method and nullable DateTimeInterface check
src/Services/HttpService.php Updated constructor type hint to allow a nullable Factory
src/Providers/LarateServiceProvider.php Introduced override attribute for service registration
src/Larate.php Updated the class to readonly and refactored the constructor using property promotion
src/Facades/LarateFacade.php Added explicit return type for the facade accessor method
src/ExchangeRate.php Refactored to readonly with constructor property promotion
src/CurrencyPair.php Converted to readonly and implemented Stringable
src/Contracts/ExchangeRateService.php Updated method signature to accept a nullable DateTimeInterface
src/Contracts/ExchangeRateProvider.php Updated method signature to accept a nullable DateTimeInterface
src/CacheHelper.php Updated string formatting by replacing Safe sprintf with native sprintf
composer.json Upgraded the PHP version and bumped dependency versions
.php-cs-fixer.cache Updated cache configuration for PHP CS Fixer
Comments suppressed due to low confidence (2)

src/Services/RussianCentralBank.php:58

  • [nitpick] Consider passing the original input value or a more descriptive message instead of the literal 'false' to improve clarity in the error message.
throw new RuntimeException(trans('larate::error.badfloat', ['value' => 'false']));

tests/Unit/NationalBankOfUkraineTest.php:81

  • Remove the assignment and subsequent var_dump call from this test since an exception is expected. This debug output may interfere with automated test results.
$a = $this->service->parseRateData($content, 'USD');

@dostrog dostrog force-pushed the feature/update-packages branch from e4eea2b to 7b86135 Compare June 14, 2025 08:59
@dostrog dostrog merged commit 6562516 into master Jun 14, 2025
9 checks passed
@dostrog dostrog deleted the feature/update-packages branch June 14, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants