Skip to content

Some metadata fixes for SPL classes#5574

Merged
staabm merged 1 commit intophpstan:2.1.xfrom
bitwise-operators:fix-splhead-metadata
May 1, 2026
Merged

Some metadata fixes for SPL classes#5574
staabm merged 1 commit intophpstan:2.1.xfrom
bitwise-operators:fix-splhead-metadata

Conversation

@bitwise-operators
Copy link
Copy Markdown
Contributor

Three fixes:

  • SplHeap was misnamed as SplHead
  • Reference to a non-existent SplFixedArray::extract() method replaced with missing SplFixedArray::setSize() method
  • Fixed incorrect argument name in the stub for SplFixedArray.

@phpstan-bot
Copy link
Copy Markdown
Collaborator

You've opened the pull request against the latest branch 2.2.x. PHPStan 2.2 is not going to be released for months. If your code is relevant on 2.1.x and you want it to be released sooner, please rebase your pull request and change its target to 2.1.x.

'SplFileObject::fseek' => ['hasSideEffects' => true],
'SplFileObject::ftruncate' => ['hasSideEffects' => true],
'SplFileObject::fwrite' => ['hasSideEffects' => true],
'SplFixedArray::extract' => ['hasSideEffects' => true],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated automatically when running bin/generate-function-metadata.php

You should modify bin/functionMetadata_original.php instead

@bitwise-operators bitwise-operators force-pushed the fix-splhead-metadata branch 2 times, most recently from 9b6bd9c to 101b456 Compare April 30, 2026 11:18
@bitwise-operators bitwise-operators changed the base branch from 2.2.x to 2.1.x April 30, 2026 11:19
@bitwise-operators
Copy link
Copy Markdown
Contributor Author

Fixed.

Also changed target to 2.1.x

Comment thread resources/functionMetadata.php Outdated
'ReflectionMethod::isProtected' => ['hasSideEffects' => false],
'ReflectionMethod::isPublic' => ['hasSideEffects' => false],
'ReflectionMethod::isStatic' => ['hasSideEffects' => false],
'ReflectionMethod::setAccessible' => ['hasSideEffects' => false],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: I think this is a consequences of JetBrains/phpstorm-stubs#1876

I didn't regenerated the metadata when I bumped the phpstorm stubs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I suspected something like that.

@VincentLanglet VincentLanglet requested a review from staabm April 30, 2026 11:56
@staabm staabm force-pushed the fix-splhead-metadata branch from 101b456 to 48e7e24 Compare May 1, 2026 07:18
@staabm
Copy link
Copy Markdown
Contributor

staabm commented May 1, 2026

thank you!

@staabm staabm merged commit 6855944 into phpstan:2.1.x May 1, 2026
935 of 942 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.

4 participants