Skip to content

Use iterable to allow generators#53

Merged
Bukashk0zzz merged 5 commits intoBukashk0zzz:masterfrom
vaiil:feature/allow-generators
Jul 10, 2025
Merged

Use iterable to allow generators#53
Bukashk0zzz merged 5 commits intoBukashk0zzz:masterfrom
vaiil:feature/allow-generators

Conversation

@vaiil
Copy link
Contributor

@vaiil vaiil commented Jul 9, 2025

Change array to iterable to be able to use \Generator.
Bump min php version to 7.1 that supports iterable type

close #33 (comment)

@Bukashk0zzz
Copy link
Owner

@vaiil please remove 5.6 from tests add 8.4 to tests

@Bukashk0zzz Bukashk0zzz requested a review from Copilot July 9, 2025 16:06
Copy link

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 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 array to iterable for currencies, categories, offers, and deliveries
  • Update composer.json to 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 : bool to 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 : void return 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 : void as the return type for consistency with PHP 7.1+ features.
    private function addCategories(iterable $categories)

src/Generator.php:272

  • Add an explicit : void return 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 : void return type here to fully adopt PHP 7.1+ typing.
    private function addOffers(iterable $offers)

@vaiil
Copy link
Contributor Author

vaiil commented Jul 9, 2025

@Bukashk0zzz I have done it, but it seems that php8.4 tests will fail, because of old versions of dev packages

@Bukashk0zzz
Copy link
Owner

@vaiil do you will be able to fix tests pipeline?

@vaiil vaiil force-pushed the feature/allow-generators branch 2 times, most recently from a4f09f5 to 6c97f51 Compare July 10, 2025 11:45
@vaiil vaiil force-pushed the feature/allow-generators branch from 16ca664 to c4b1daf Compare July 10, 2025 12:03
@vaiil
Copy link
Contributor Author

vaiil commented Jul 10, 2025

@Bukashk0zzz I've updated some dev packages. Can you rerun actions now?

@Bukashk0zzz
Copy link
Owner

Thanks!

@Bukashk0zzz Bukashk0zzz merged commit 78107aa into Bukashk0zzz:master Jul 10, 2025
2 checks passed
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.

Use iterable instead of arrays in Generator

2 participants