-
Notifications
You must be signed in to change notification settings - Fork 4
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
IBX-9727: Added missing type hints #89
base: main
Are you sure you want to change the base?
Conversation
Applied Rectors: * Rector\TypeDeclaration\Rector\Class_\AddTestsVoidReturnTypeWhereNoReturnRector * Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector * Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeBasedOnPHPUnitDataProviderRector * Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector * Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanConstReturnsRector * Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanStrictReturnsRector * Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector * Rector\TypeDeclaration\Rector\ClassMethod\ReturnNullableTypeRector * Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnDirectArrayRector * Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector * Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector * Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector * Rector\TypeDeclaration\Rector\ClassMethod\ReturnUnionTypeRector * Rector\TypeDeclaration\Rector\ClassMethod\StrictArrayParamDimFetchRector * Rector\TypeDeclaration\Rector\ClassMethod\StrictStringParamConcatRector * Rector\TypeDeclaration\Rector\ClassMethod\StringReturnTypeFromStrictScalarReturnsRector * Rector\TypeDeclaration\Rector\ClassMethod\StringReturnTypeFromStrictStringReturnsRector * Rector\TypeDeclaration\Rector\Class_\TypedPropertyFromCreateMockAssignRector * Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeRector * Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector * Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector * Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector
|
@@ -923,12 +923,12 @@ public function providerForTestGetSearchTargetsThrowsRuntimeException() | |||
* @param string $message | |||
*/ | |||
public function testGetSearchTargetsThrowsRuntimeException( | |||
$endpointMap, | |||
array $endpointMap, | |||
$defaultEndpoint, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are missing typehint
@@ -22,7 +23,7 @@ abstract class AbstractAggregationVisitorTest extends TestCase | |||
protected $visitor; | |||
|
|||
/** @var \Ibexa\Contracts\Solr\Query\AggregationVisitor|\PHPUnit\Framework\MockObject\MockObject */ | |||
protected $dispatcherVisitor; | |||
protected MockObject $dispatcherVisitor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected MockObject $dispatcherVisitor; | |
protected AggregationVisitor&MockObject $dispatcherVisitor; |
|
||
final class RangeAggregationVisitorTest extends AbstractAggregationVisitorTest | ||
{ | ||
/** @var \Ibexa\Contracts\Solr\Query\Common\AggregationVisitor\AggregationFieldResolver|\PHPUnit\Framework\MockObject\MockObject */ | ||
private $aggregationFieldResolver; | ||
private MockObject $aggregationFieldResolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MockObject $aggregationFieldResolver; | |
private AggregationFieldResolver&MockObject $aggregationFieldResolver; |
|
||
final class StatsAggregationVisitorTest extends AbstractAggregationVisitorTest | ||
{ | ||
/** @var \Ibexa\Contracts\Solr\Query\Common\AggregationVisitor\AggregationFieldResolver|\PHPUnit\Framework\MockObject\MockObject */ | ||
private $aggregationFieldResolver; | ||
private MockObject $aggregationFieldResolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MockObject $aggregationFieldResolver; | |
private AggregationFieldResolver&MockObject $aggregationFieldResolver; |
|
||
final class TermAggregationVisitorTest extends AbstractAggregationVisitorTest | ||
{ | ||
/** @var \Ibexa\Contracts\Solr\Query\Common\AggregationVisitor\AggregationFieldResolver|\PHPUnit\Framework\MockObject\MockObject */ | ||
private $aggregationFieldResolver; | ||
private MockObject $aggregationFieldResolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MockObject $aggregationFieldResolver; | |
private AggregationFieldResolver&MockObject $aggregationFieldResolver; |
use PHPUnit\Framework\TestCase; | ||
|
||
final class ObjectStateAggregationKeyMapperTest extends TestCase | ||
{ | ||
/** @var \Ibexa\Contracts\Core\Repository\ObjectStateService|\PHPUnit\Framework\MockObject\MockObject */ | ||
private $objectStateService; | ||
private MockObject $objectStateService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MockObject $objectStateService; | |
private ObjectStateService&MockObject $objectStateService; |
use PHPUnit\Framework\TestCase; | ||
|
||
final class SectionAggregationKeyMapperTest extends TestCase | ||
{ | ||
private const EXAMPLE_SECTION_IDS = [1, 2, 3]; | ||
|
||
/** @var \Ibexa\Contracts\Core\Repository\SectionService|\PHPUnit\Framework\MockObject\MockObject */ | ||
private $sectionService; | ||
private MockObject $sectionService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MockObject $sectionService; | |
private SectionService&MockObject $sectionService; |
use PHPUnit\Framework\TestCase; | ||
|
||
final class SubtreeAggregationKeyMapperTest extends TestCase | ||
{ | ||
private const EXAMPLE_PATH_STRING = '/1/2/54/'; | ||
|
||
/** @var \Ibexa\Contracts\Solr\ResultExtractor\AggregationResultExtractor\TermAggregationKeyMapper|\PHPUnit\Framework\MockObject\MockObject */ | ||
private $locationAggregationKeyMapper; | ||
private MockObject $locationAggregationKeyMapper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MockObject $locationAggregationKeyMapper; | |
private TermAggregationKeyMapper&MockObject $locationAggregationKeyMapper; |
@@ -23,10 +24,10 @@ final class UserMetadataAggregationKeyMapperTest extends TestCase | |||
private const EXAMPLE_USER_GROUP_IDS = [1, 2, 3]; | |||
|
|||
/** @var \Ibexa\Contracts\Core\Repository\UserService|\PHPUnit\Framework\MockObject\MockObject */ | |||
private $userService; | |||
private MockObject $userService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MockObject $userService; | |
private UserService&MockObject $userService; |
use stdClass; | ||
|
||
final class TermAggregationResultExtractorTest extends AbstractAggregationResultExtractorTest | ||
{ | ||
/** @var \Ibexa\Contracts\Solr\ResultExtractor\AggregationResultExtractor\TermAggregationKeyMapper|\PHPUnit\Framework\MockObject\MockObject */ | ||
private $keyMapper; | ||
private MockObject $keyMapper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private MockObject $keyMapper; | |
private TermAggregationKeyMapper&MockObject $keyMapper; |
Caution
These changes are volatile and - in some repositories - extensive, so they need to be carefully reviewed before merging.
Description:
Added missing strict type hints using
\Rector\Set\ValueObject\SetList::TYPE_DECLARATION
set.Additionally FQCNs have been imported for every affected file using PHP CS Fixer, in some cases they might override unrelated lines.
For QA:
Regression tests.