Skip to content

Conversation

@mttsch
Copy link
Contributor

@mttsch mttsch commented Aug 9, 2025

No description provided.

$rectorConfig->ruleWithConfiguration(
RenameMethodRector::class,
[
new MethodCallRename('SplObjectStorage', 'contains', 'offsetExists'),
Copy link
Member

Choose a reason for hiding this comment

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

The PHP documentation seems ambiguous 😃 , it says:

SplObjectStorage::offsetExists() is an alias of [SplObjectStorage::contains()](https://www.php.net/manual/en/splobjectstorage.contains.php).

https://www.php.net/manual/en/splobjectstorage.offsetexists.php

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting. But I would guess this to be an issue in the documentation or previously the "alias relationship" was seen in the opposite direction. But the RFC is clear in stating to use the existing methods inherited from ArrayAccess instead of the custom ones from SplObjectStorage .

Copy link
Member

Choose a reason for hiding this comment

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

yes, indeed, looks like documentation issue.

@samsonasik samsonasik merged commit ad470ba into rectorphp:main Aug 9, 2025
47 checks passed
@samsonasik
Copy link
Member

Thank you @mttsch

@mttsch mttsch deleted the feature/php85-SplObjectStorage branch August 10, 2025 11:01
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.

2 participants