Skip to content

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

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

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.

@ondrejmirtes
Copy link
Member

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

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

Labels

None yet

2 participants