project_checker->registerFile( 'somefile.php', 'project_checker); $context = new Context(); $file_checker->visitAndAnalyzeMethods($context); } /** * @return array */ public function providerFileCheckerValidCodeParse() { return [ 'extendsAndImplements' => [ 'baz(); $dee = (new D())->fooFoo();', 'assertions' => [ '$cee' => 'string', '$dee' => 'string', ], ], 'isExtendedInterface' => [ ' [ 'fooFoo(); }', ], 'correctInterfaceMethodSignature' => [ ' [ ' [ ' [ ' [ 'foo(); } }', ], 'abstractInterfaceImplements' => [ ' [ 'foo(); } }', ], 'implementsPartialInterfaceMethods' => [ ' [], 'error_levels' => ['MissingReturnType'], ], 'interfaceConstants' => [ ' [ ' [ ' [ 'bar) { } }', 'error_message' => 'NoInterfaceProperties', ], 'unimplementedInterfaceMethod' => [ ' 'UnimplementedInterfaceMethod', ], 'mismatchingInterfaceMethodSignature' => [ ' 'MethodSignatureMismatch', ], 'mismatchingInterfaceMethodSignatureInTrait' => [ ' 'MethodSignatureMismatch', ], 'mismatchingInterfaceMethodSignatureInImplementer' => [ ' 'MethodSignatureMismatch', ], 'abstractInterfaceImplementsButCallUndefinedMethod' => [ 'foo2(); } }', 'error_message' => 'UndefinedMethod', ], 'abstractInterfaceImplementsWithSubclass' => [ ' 'UnimplementedInterfaceMethod', ], 'moreSpecificReturnType' => [ ' 'MoreSpecificReturnType', ], ]; } }