Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.

Conversation

@jmleroux
Copy link

@jmleroux jmleroux commented Nov 10, 2021

Dedicated interfaces are needed for correct type-hinting.

When using PHP >= 7.4, a more strict interface would for example allow safe use of Row::toArray() when using the iterator.
If we keep the generic Iterator interface, the returned item is mixed type and the use of $item->toArray() is not safe.

We use the iterator in Akeneo here: https://github.com/akeneo/pim-community-dev/blob/master/src/Akeneo/Tool/Component/Connector/Reader/File/FlatFileIterator.php

Because of poor type hinting, we have to make a test on the instance, which could be avoided with better type hinting: https://github.com/akeneo/pim-community-dev/pull/14869/files#L96

@CLAassistant
Copy link

CLAassistant commented Nov 10, 2021

CLA assistant check
All committers have signed the CLA.

@jmleroux jmleroux marked this pull request as ready for review November 12, 2021 13:45
@Slamdunk
Copy link

Slamdunk commented Mar 2, 2022

Merged in openspout/openspout#7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants