Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodExtensions class-name is case-insensitive #2562

Merged
merged 3 commits into from Aug 5, 2023

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Aug 2, 2023

@staabm staabm changed the base branch from 1.11.x to 1.10.x August 2, 2023 19:42
@phpstan-bot
Copy link
Collaborator

You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.

@@ -544,3 +544,35 @@ public function doBar(string $s)
}

}

class TestCaseInsensitiveClassNames
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there was no exisiting bug to fix for the throw-type-extension case.. but adding test coverage can not hurt

tests DynamicMethodThrowTypeExtension

@@ -18,3 +18,6 @@

$returnType = $closure->call($newThis, new class {});
assertType('true', $returnType);

$staticallyBoundClosureCaseInsensitive = \closure::bind($closure, $newThis);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

test DynamicStaticMethodReturnTypeExtension

@@ -95,4 +95,9 @@ public function dateTimeZoneDoesThrows(string $tz): void
new \DateTimeZone($tz);
}

public function dateTimeZoneDoesNotThrowCaseInsensitive(): void
{
new \DaTetImezOnE('UTC');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

test DynamicStaticMethodThrowTypeExtension

{
$xml = new \SimpleXmlElement('');
$elements = $xml->xpath('//data');
assertType('array<SimpleXmlElement>', $elements);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

test DynamicMethodReturnTypeExtension-case

@staabm staabm marked this pull request as ready for review August 3, 2023 08:48
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 1c9e90f into phpstan:1.10.x Aug 5, 2023
410 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants