[ 'fooFoo(); } }' ], 'accessibleProtectedMethodFromTrait' => [ 'fooFoo(); } }' ], 'accessiblePublicMethodFromTrait' => [ 'fooFoo(); } }' ], 'accessiblePrivatePropertyFromTrait' => [ 'fooFoo; } }' ], 'accessibleProtectedPropertyFromTrait' => [ 'fooFoo; } }' ], 'accessiblePublicPropertyFromTrait' => [ 'fooFoo; } }' ], 'accessibleProtectedMethodFromInheritedTrait' => [ 'fooFoo(); } }' ], 'accessiblePublicMethodFromInheritedTrait' => [ 'fooFoo(); } }' ], 'staticClassMethodFromWithinTrait' => [ ' [ 'fooFoo("hello");' ], 'redefinedTraitMethodWithAlias' => [ 'barBar(); } }' ], 'traitSelf' => [ 'g();', 'assertions' => [ ['A' => '$a'] ] ], 'parentTraitSelf' => [ 'g();', 'assertions' => [ ['A' => '$a'] ] ], 'directStaticCall' => [ ' [ 'foo(); } }' ] ]; } /** * @return array */ public function providerFileCheckerInvalidCodeParse() { return [ 'inaccessiblePrivateMethodFromInheritedTrait' => [ 'fooFoo(); } }', 'error_message' => 'InaccessibleMethod' ], 'undefinedTrait' => [ ' 'UndefinedTrait' ], 'missingPropertyType' => [ 'foo = 5; } }', 'error_message' => 'MissingPropertyType - somefile.php:3 - Property T::$foo does not have a ' . 'declared type - consider null|int' ], 'missingPropertyTypeWithConstructorInit' => [ 'foo = 5; } }', 'error_message' => 'MissingPropertyType - somefile.php:3 - Property T::$foo does not have a ' . 'declared type - consider int' ], 'missingPropertyTypeWithConstructorInitAndNull' => [ 'foo = 5; } public function makeNull() : void { $this->foo = null; } }', 'error_message' => 'MissingPropertyType - somefile.php:3 - Property T::$foo does not have a ' . 'declared type - consider null|int' ], 'missingPropertyTypeWithConstructorInitAndNullDefault' => [ 'foo = 5; } }', 'error_message' => 'MissingPropertyType - somefile.php:3 - Property T::$foo does not have a ' . 'declared type - consider int|nul' ] ]; } }