Stop importing the php82 polyfill in DefaultSchemaFilesProviderTest - #46
Closed
Steveb-p wants to merge 1 commit into
Closed
Stop importing the php82 polyfill in DefaultSchemaFilesProviderTest#46Steveb-p wants to merge 1 commit into
Steveb-p wants to merge 1 commit into
Conversation
Steveb-p
force-pushed
the
ci-disable-phpstan-parallel-on-php74
branch
from
September 8, 2026 19:54
cd8da48 to
8234de3
Compare
PHPStan dies on PHP 7.4 before reporting anything, so every PR against this branch fails the
"Tests (7.4)" job regardless of its contents:
Child process error (exit code 255): PHP Fatal error: Cannot redeclare
Ibexa\PolyfillPhp82\iterator_to_array() ... while running parallel worker
ibexa/polyfill-php82 v1.0.1 lists src/iterator_to_array.php in *both* autoload.files and
autoload.psr-4 ("Ibexa\PolyfillPhp82\" => "src/"), and the function carries no function_exists()
guard. Analysing the `use function Ibexa\PolyfillPhp82\iterator_to_array;` in this test makes
PHPStan probe for a class of that name; PSR-4 resolves it to the same file that autoload.files
already loaded, and including it a second time is fatal.
The polyfill isn't needed here anyway: getSchemaFiles() is a generator, so it's always Traversable
and the native iterator_to_array() accepts it on every supported version. Asserting that first
keeps level 8 happy about the declared `iterable` return type. This was the only usage in the repo.
The underlying autoload overlap is worth fixing in ibexa/polyfill-php82 -- any package importing
this function hits the same wall on 7.4 -- but that shouldn't keep this branch red meanwhile.
Steveb-p
force-pushed
the
ci-disable-phpstan-parallel-on-php74
branch
from
September 8, 2026 19:57
8234de3 to
1b5d965
Compare
Collaborator
Author
|
Superseded by ibexa/polyfill-php82#7, which fixes the root cause rather than sidestepping it here. The fatal came from #42, #43 and #44 now carry a temporary |
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.
Description:
PHPStan dies on PHP 7.4 before reporting anything, so every PR against
4.6fails theTests (7.4)job regardless of what it changes — currently #42, #43 and #44, one of which is aneleven-line change to a single method:
ibexa/polyfill-php82v1.0.1 listssrc/iterator_to_array.phpin bothautoload.filesandautoload.psr-4(Ibexa\PolyfillPhp82\→src/), and the function has nofunction_exists()guard. Analysing the
use function Ibexa\PolyfillPhp82\iterator_to_array;inDefaultSchemaFilesProviderTestmakes PHPStan probe for a class of that name; PSR-4 resolves itto the same file
autoload.filesalready loaded, and the second include is fatal. The "parallelworker" wording is a red herring — it's where the probe happens to land, not the cause.
The polyfill isn't needed in that test:
getSchemaFiles()is a generator, so it's alwaysTraversableand the nativeiterator_to_array()accepts it on every supported version.Asserting that first keeps level 8 happy about the declared
iterablereturn type. It was theonly usage in the repo.
Worth fixing the autoload overlap in
ibexa/polyfill-php82too — any package importing thatfunction hits the same wall on 7.4 — but that shouldn't keep this branch red in the meantime. I
can open that separately if you'd like.