Skip to content

Conversation

@TomasVotruba
Copy link
Member

  • add scalar types condition
  • add call static support, set and get

@TomasVotruba TomasVotruba changed the title tv known magic method calls types 2 [type-declaration] Add set, get and static call to KnownMagicClassMethodTypeRector Oct 4, 2025
@TomasVotruba TomasVotruba force-pushed the tv-known-magic-method-calls-types-2 branch from ac2f93c to fea5ed6 Compare October 4, 2025 17:42
@TomasVotruba TomasVotruba force-pushed the tv-known-magic-method-calls-types-2 branch from 018ab9e to addfd97 Compare October 4, 2025 17:47
@TomasVotruba TomasVotruba enabled auto-merge (squash) October 4, 2025 17:50
@TomasVotruba TomasVotruba disabled auto-merge October 4, 2025 17:51
@TomasVotruba TomasVotruba merged commit 6016355 into main Oct 4, 2025
50 checks passed
@TomasVotruba TomasVotruba deleted the tv-known-magic-method-calls-types-2 branch October 4, 2025 17:51
if (! $firstParam->type instanceof Node) {
$firstParam->type = new Identifier('string');
$hasChanged = true;
if ($this->isNames($classMethod, [MethodName::CALL, MethodName::CALL_STATIC])) {
Copy link
Member

Choose a reason for hiding this comment

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

By this change, the parent guard can't early return null, as check match method name moved after, I will create new parent to move below here, or use continue instead.

Copy link
Member

Choose a reason for hiding this comment

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

I created PR for check parent with other method to continue on it:

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