diff --git a/Tests/DependencyInjection/PropertyInfoPassTest.php b/Tests/DependencyInjection/PropertyInfoPassTest.php index aea826e..a1db482 100644 --- a/Tests/DependencyInjection/PropertyInfoPassTest.php +++ b/Tests/DependencyInjection/PropertyInfoPassTest.php @@ -42,7 +42,7 @@ public function testServicesAreOrderedAccordingToPriority($index, $tag) $this->assertEquals($expected, $definition->getArgument($index)); } - public function provideTags() + public static function provideTags() { return [ [0, 'property_info.list_extractor'], diff --git a/Tests/Extractor/PhpStanExtractorTest.php b/Tests/Extractor/PhpStanExtractorTest.php index 467c076..a517e7a 100644 --- a/Tests/Extractor/PhpStanExtractorTest.php +++ b/Tests/Extractor/PhpStanExtractorTest.php @@ -58,7 +58,7 @@ public function testParamTagTypeIsOmitted() $this->assertNull($this->extractor->getTypes(PhpStanOmittedParamTagTypeDocBlock::class, 'omittedType')); } - public function invalidTypesProvider() + public static function invalidTypesProvider() { return [ 'pub' => ['pub'], @@ -86,7 +86,7 @@ public function testExtractTypesWithNoPrefixes($property, array $type = null) $this->assertEquals($type, $noPrefixExtractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', $property)); } - public function typesProvider() + public static function typesProvider() { return [ ['foo', null], @@ -139,7 +139,7 @@ public function testExtractCollection($property, array $type = null) $this->testExtract($property, $type); } - public function provideCollectionTypes() + public static function provideCollectionTypes() { return [ ['iteratorCollection', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Iterator', true, null, new Type(Type::BUILTIN_TYPE_STRING))]], @@ -197,7 +197,7 @@ public function testExtractTypesWithCustomPrefixes($property, array $type = null $this->assertEquals($type, $customExtractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', $property)); } - public function typesWithCustomPrefixesProvider() + public static function typesWithCustomPrefixesProvider() { return [ ['foo', null], @@ -235,7 +235,7 @@ public function typesWithCustomPrefixesProvider() ]; } - public function typesWithNoPrefixesProvider() + public static function typesWithNoPrefixesProvider() { return [ ['foo', null], @@ -273,7 +273,7 @@ public function typesWithNoPrefixesProvider() ]; } - public function dockBlockFallbackTypesProvider() + public static function dockBlockFallbackTypesProvider() { return [ 'pub' => [ @@ -304,7 +304,7 @@ public function testPropertiesDefinedByTraits(string $property, Type $type) $this->assertEquals([$type], $this->extractor->getTypes(DummyUsingTrait::class, $property)); } - public function propertiesDefinedByTraitsProvider(): array + public static function propertiesDefinedByTraitsProvider(): array { return [ ['propertyInTraitPrimitiveType', new Type(Type::BUILTIN_TYPE_STRING)], @@ -321,7 +321,7 @@ public function testPropertiesStaticType(string $class, string $property, Type $ $this->assertEquals([$type], $this->extractor->getTypes($class, $property)); } - public function propertiesStaticTypeProvider(): array + public static function propertiesStaticTypeProvider(): array { return [ [ParentDummy::class, 'propertyTypeStatic', new Type(Type::BUILTIN_TYPE_OBJECT, false, ParentDummy::class)], @@ -337,7 +337,7 @@ public function testPropertiesParentType(string $class, string $property, ?array $this->assertEquals($types, $this->extractor->getTypes($class, $property)); } - public function propertiesParentTypeProvider(): array + public static function propertiesParentTypeProvider(): array { return [ [ParentDummy::class, 'parentAnnotationNoParent', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'parent')]], @@ -353,7 +353,7 @@ public function testExtractConstructorTypes($property, array $type = null) $this->assertEquals($type, $this->extractor->getTypesFromConstructor('Symfony\Component\PropertyInfo\Tests\Fixtures\ConstructorDummy', $property)); } - public function constructorTypesProvider() + public static function constructorTypesProvider() { return [ ['date', [new Type(Type::BUILTIN_TYPE_INT)]], @@ -372,7 +372,7 @@ public function testExtractorUnionTypes(string $property, ?array $types) $this->assertEquals($types, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\DummyUnionType', $property)); } - public function unionTypesProvider(): array + public static function unionTypesProvider(): array { return [ ['a', [new Type(Type::BUILTIN_TYPE_STRING), new Type(Type::BUILTIN_TYPE_INT)]], @@ -410,7 +410,7 @@ public function testExtractorIntRangeType(string $property, ?array $types) $this->assertEquals($types, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\IntRangeDummy', $property)); } - public function intRangeTypeProvider(): array + public static function intRangeTypeProvider(): array { return [ ['a', [new Type(Type::BUILTIN_TYPE_INT)]], diff --git a/Tests/Extractor/ReflectionExtractorTest.php b/Tests/Extractor/ReflectionExtractorTest.php index e17e203..b795558 100644 --- a/Tests/Extractor/ReflectionExtractorTest.php +++ b/Tests/Extractor/ReflectionExtractorTest.php @@ -207,7 +207,7 @@ public function testExtractors($property, array $type = null) $this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', $property, [])); } - public function typesProvider() + public static function typesProvider() { return [ ['a', null], @@ -234,7 +234,7 @@ public function testExtractPhp7Type(string $class, string $property, array $type $this->assertEquals($type, $this->extractor->getTypes($class, $property, [])); } - public function php7TypesProvider() + public static function php7TypesProvider() { return [ [Php7Dummy::class, 'foo', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true)]], @@ -255,7 +255,7 @@ public function testExtractPhp71Type($property, array $type = null) $this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php71Dummy', $property, [])); } - public function php71TypesProvider() + public static function php71TypesProvider() { return [ ['foo', [new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)]], @@ -276,7 +276,7 @@ public function testExtractPhp80Type($property, array $type = null) $this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php80Dummy', $property, [])); } - public function php80TypesProvider() + public static function php80TypesProvider() { return [ ['foo', [new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)]], @@ -300,7 +300,7 @@ public function testExtractPhp81Type($property, array $type = null) $this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php81Dummy', $property, [])); } - public function php81TypesProvider() + public static function php81TypesProvider() { return [ ['nothing', null], @@ -326,7 +326,7 @@ public function testExtractPhp82Type($property, array $type = null) $this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php82Dummy', $property, [])); } - public function php82TypesProvider(): iterable + public static function php82TypesProvider(): iterable { yield ['nil', null]; yield ['false', [new Type(Type::BUILTIN_TYPE_FALSE)]]; @@ -344,7 +344,7 @@ public function testExtractWithDefaultValue($property, $type) $this->assertEquals($type, $this->extractor->getTypes(DefaultValue::class, $property, [])); } - public function defaultValueProvider() + public static function defaultValueProvider() { return [ ['defaultInt', [new Type(Type::BUILTIN_TYPE_INT, false)]], @@ -366,7 +366,7 @@ public function testIsReadable($property, $expected) ); } - public function getReadableProperties() + public static function getReadableProperties() { return [ ['bar', false], @@ -397,7 +397,7 @@ public function testIsWritable($property, $expected) ); } - public function getWritableProperties() + public static function getWritableProperties() { return [ ['bar', false], @@ -451,7 +451,7 @@ public function testIsInitializable(string $class, string $property, bool $expec $this->assertSame($expected, $this->extractor->isInitializable($class, $property)); } - public function getInitializableProperties(): array + public static function getInitializableProperties(): array { return [ [Php71Dummy::class, 'string', true], @@ -475,7 +475,7 @@ public function testExtractTypeConstructor(string $class, string $property, arra $this->assertNull($this->extractor->getTypes($class, $property, ['enable_constructor_extraction' => false])); } - public function constructorTypesProvider(): array + public static function constructorTypesProvider(): array { return [ // php71 dummy has following constructor: __construct(string $string, int $intPrivate) @@ -534,7 +534,7 @@ public function testGetReadAccessor($class, $property, $found, $type, $name, $vi $this->assertSame($static, $readAcessor->isStatic()); } - public function readAccessorProvider(): array + public static function readAccessorProvider(): array { return [ [Dummy::class, 'bar', true, PropertyReadInfo::TYPE_PROPERTY, 'bar', PropertyReadInfo::VISIBILITY_PRIVATE, false], @@ -592,7 +592,7 @@ public function testGetWriteMutator($class, $property, $allowConstruct, $found, } } - public function writeMutatorProvider(): array + public static function writeMutatorProvider(): array { return [ [Dummy::class, 'bar', false, true, PropertyWriteInfo::TYPE_PROPERTY, 'bar', null, null, PropertyWriteInfo::VISIBILITY_PRIVATE, false], @@ -650,7 +650,7 @@ public function testExtractConstructorTypes(string $property, array $type = null $this->assertEquals($type, $this->extractor->getTypesFromConstructor('Symfony\Component\PropertyInfo\Tests\Fixtures\ConstructorDummy', $property)); } - public function extractConstructorTypesProvider(): array + public static function extractConstructorTypesProvider(): array { return [ ['timezone', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTimeZone')]],