Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Range with strings #64

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

Closed
Schrank wants to merge 3 commits into phpstan:master from Schrank:rangeWithStrings
Closed

Conversation

@Schrank
Copy link

@Schrank Schrank commented Dec 22, 2019

if ($startType instanceof StringType
&& $endType instanceof StringType
&& $stepType instanceof IntegerType) {
return new ArrayType(new IntegerType(), new StringType());
Copy link
Member

@ondrejmirtes ondrejmirtes Dec 22, 2019

Choose a reason for hiding this comment

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

Hi, I'd like the suggested logic from phpstan/phpstan#2378 (comment). These if statements won't cover all cases.

use PHPStan\Type\StringType;
use PHPUnit\Framework\MockObject\MockObject;

class RangeFunctionReturnTypeExtensionTest extends \PHPStan\Testing\TestCase
Copy link
Member

@ondrejmirtes ondrejmirtes Dec 22, 2019

Choose a reason for hiding this comment

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

Hi, this isn't at all how dynamic return type extensions are tested. Please add new dataProvider to NodeScopeResolverTest::testFileAsserts and test it there. THank you.

Schrank reacted with heart emoji
Copy link
Member

Please open the PR again if you decide to finish it. Thanks.

Schrank reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ondrejmirtes ondrejmirtes ondrejmirtes requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

range can return strings

AltStyle によって変換されたページ (->オリジナル) /