Conversation
There was a problem hiding this comment.
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');
e4eea2b to
7b86135
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.