returnTypesFromSignature; self::assertEmpty( array_filter($returnTypes, fn (string $type) => str_contains($type, '?')), "Method '$stubMethod->parentName::$stubMethod->name' has since version '$sinceVersion'\n but has nullable return typehint '" . implode('|', $returnTypes) . "' that supported only since PHP 7.1. \n Please declare return type via PhpDoc" ); } /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubsParametersProvider::parametersForUnionTypeHintTestsProvider * @throws RuntimeException */ public static function testMethodDoesNotHaveUnionTypeHintsInParameters( PHPClass|PHPInterface $class, PHPMethod $stubMethod, PHPParameter $parameter, ) { $sinceVersion = ParserUtils::getDeclaredSinceVersion($stubMethod); self::assertLessThan( 2, count($parameter->typesFromSignature), "Method '$class->name::$stubMethod->name' with @since '$sinceVersion' \n has parameter '$parameter->name' with union typehint '" . implode('|', $parameter->typesFromSignature) . "' \n but union typehints available only since php 8.0" ); } /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubsParametersProvider::parametersForNullableTypeHintTestsProvider * @throws RuntimeException */ public static function testMethodDoesNotHaveNullableTypeHintsInParameters( PHPClass|PHPInterface $class, PHPMethod $stubMethod, PHPParameter $parameter, ) { $sinceVersion = ParserUtils::getDeclaredSinceVersion($stubMethod); self::assertEmpty( array_filter($parameter->typesFromSignature, fn (string $type) => str_contains($type, '?')), "Method '$class->name::$stubMethod->name' with @since '$sinceVersion' \n has nullable parameter '$parameter->name' with typehint '" . implode('|', $parameter->typesFromSignature) . "' \n but nullable typehints available only since php 7.1" ); } /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubMethodsProvider::methodsForUnionReturnTypeHintTestsProvider * @throws RuntimeException */ public static function testMethodDoesNotHaveUnionReturnTypeHint(PHPMethod $stubMethod) { $sinceVersion = ParserUtils::getDeclaredSinceVersion($stubMethod); self::assertLessThan( 2, count($stubMethod->returnTypesFromSignature), "Method '$stubMethod->parentName::$stubMethod->name' has since version '$sinceVersion'\n but has union return typehint '" . implode('|', $stubMethod->returnTypesFromSignature) . "' that supported only since PHP 8.0. \n Please declare return type via PhpDoc" ); } /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubsParametersProvider::parametersForScalarTypeHintTestsProvider * @throws RuntimeException */ public static function testMethodDoesNotHaveScalarTypeHintsInParameters( PHPClass|PHPInterface $class, PHPMethod $stubMethod, PHPParameter $parameter, ) { $sinceVersion = ParserUtils::getDeclaredSinceVersion($stubMethod); self::assertEmpty( array_intersect(['int', 'float', 'string', 'bool', 'mixed', 'object'], $parameter->typesFromSignature), "Method '$class->name::$stubMethod->name' with @since '$sinceVersion' \n has parameter '$parameter->name' with typehint '" . implode('|', $parameter->typesFromSignature) . "' but typehints available only since php 7" ); } /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubMethodsProvider::methodsForReturnTypeHintTestsProvider * @throws RuntimeException */ public static function testMethodDoesNotHaveReturnTypeHint(PHPMethod $stubMethod) { $sinceVersion = ParserUtils::getDeclaredSinceVersion($stubMethod); self::assertEmpty($stubMethod->returnTypesFromSignature, "Method '$stubMethod->parentName::$stubMethod->name' has since version '$sinceVersion'\n but has return typehint '" . implode('|', $stubMethod->returnTypesFromSignature) . "' that supported only since PHP 7. Please declare return type via PhpDoc"); } } __halt_compiler();----SIGNATURE:----cKiedxRRYlraJWoFXDGrmE6JgavWlWEb7iXUwGyOt1s/m7VEikASiH2sgq5MLv8vpPIfkMZDK9H/JorOhkWBqXxr1h1g8vg/pEmBcQRTGkriomBUfYtREgDWp+jBrlrRSFz7/DPNpYXbHhh/e6p+ptmkIeI9jrr0fmtCLQ3q9jn7LsWws6hpNaqFwtvyEfctwk+sVkQPhAsEBA3d+rPC4HDsdNQxBWE5e1/z30x/BB+oSiJVU/dBKgheo668hG9V7hDVtkQihp+T6JlRh3JAKQaygQpOCSWvpVJuIKOhkd2VS7RIy32M7Tkie7fWkwsTIuvdGIDW2ddqu+AOvE7j/mGrY13+bZThh4oIsV7ABUfsyRL9d2T0twJrsbb1quIrznOPHf7Pn51pDfCx4UaDNFueKbAkTfbywGaOYHX960ug3yofdNkNq7LZo7311nFAhdVZfB87as2sEWKOMSKMR2i4ZXEy/LrkzN07oiY2pzpOk5yxol+r6UoB7aqbpgVBMpOT+GT6EX9/Wx8A5Asx0an3e5CskFXPu7P0gzS/qQPuNw22Pi9fBAzM2y+P9EWxXrhTKy1zrlld5lO85zGeQZD2eSLxGVerCYghmCq3Lb+IbdprPlVcgOTExEPOPigI5CSfMI0JW+0/XCNhyFAqa0w712p0WUQriFT5ePgUHuE=----ATTACHMENT:----NjIxNDkyMzgxODg5MDA1MCA5NzA3NjAzNDkzMzU4NTk1IDkwOTQ0OTYyMjYzOTc1MzA=