Use iterable to allow generators#53
Merged
Bukashk0zzz merged 5 commits intoBukashk0zzz:masterfrom Jul 10, 2025
Merged
Conversation
Owner
|
@vaiil please remove 5.6 from tests add 8.4 to tests |
There was a problem hiding this comment.
Pull Request Overview
This PR updates method signatures to use iterable instead of array for generator inputs—enabling use of PHP generators—and bumps the minimum PHP requirement to 7.1.
- Change type hints and docblocks from
arraytoiterablefor currencies, categories, offers, and deliveries - Update
composer.jsonto require PHP ≥7.1
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Generator.php | Updated docblocks and method signatures from array to iterable |
| composer.json | Bumped PHP requirement from >=5.6.1 to >=7.1 |
Comments suppressed due to low confidence (5)
src/Generator.php:80
- [nitpick] Consider adding a return type declaration
: boolto the generate method to leverage PHP 7.1+ typing features.
public function generate(ShopInfo $shopInfo, iterable $currencies, iterable $categories, iterable $offers, iterable $deliveries = [])
src/Generator.php:234
- You can add a
: voidreturn type to this private method to make its signature explicit now that PHP 7.1+ is required.
private function addCurrencies(iterable $currencies)
src/Generator.php:253
- Consider specifying
: voidas the return type for consistency with PHP 7.1+ features.
private function addCategories(iterable $categories)
src/Generator.php:272
- Add an explicit
: voidreturn type for clarity now that PHP 7.1+ is enforced.
private function addDeliveries(iterable $deliveries)
src/Generator.php:291
- It might be helpful to declare a
: voidreturn type here to fully adopt PHP 7.1+ typing.
private function addOffers(iterable $offers)
Contributor
Author
|
@Bukashk0zzz I have done it, but it seems that php8.4 tests will fail, because of old versions of dev packages |
Owner
|
@vaiil do you will be able to fix tests pipeline? |
a4f09f5 to
6c97f51
Compare
tests: update phpunit and faker tests: use max 10 version
16ca664 to
c4b1daf
Compare
Contributor
Author
|
@Bukashk0zzz I've updated some dev packages. Can you rerun actions now? |
Owner
|
Thanks! |
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.
Change array to iterable to be able to use \Generator.
Bump min php version to 7.1 that supports iterable type
close #33 (comment)