Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace PHP_CodeSniffer\Tests\Core\File; use PHP_CodeSniffer\Tests\Core\AbstractM..

Decoded Output download

<?php
 namespace PHP_CodeSniffer\Tests\Core\File; use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; class GetMethodParametersTest extends AbstractMethodUnitTest { public function testPassByReference() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "&$var", "has_attributes" => false, "pass_by_reference" => true, "variable_length" => false, "type_hint" => '', "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testArrayHint() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "array $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "array", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testVariable() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "$var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testSingleDefaultValue() { $expected = array(); $expected[0] = array("name" => "$var1", "content" => "$var1=self::CONSTANT", "has_attributes" => false, "default" => "self::CONSTANT", "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testDefaultValues() { $expected = array(); $expected[0] = array("name" => "$var1", "content" => "$var1=1", "has_attributes" => false, "default" => "1", "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false); $expected[1] = array("name" => "$var2", "content" => "$var2='value'", "has_attributes" => false, "default" => "'value'", "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testTypeHint() { $expected = array(); $expected[0] = array("name" => "$var1", "content" => "foo $var1", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "foo", "nullable_type" => false); $expected[1] = array("name" => "$var2", "content" => "bar $var2", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "bar", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testSelfTypeHint() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "self $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "self", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testNullableTypeHint() { $expected = array(); $expected[0] = array("name" => "$var1", "content" => "?int $var1", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?int", "nullable_type" => true); $expected[1] = array("name" => "$var2", "content" => "?\bar $var2", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?\bar", "nullable_type" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testBitwiseAndConstantExpressionDefaultValue() { $expected = array(); $expected[0] = array("name" => "$a", "content" => "$a = 10 & 20", "default" => "10 & 20", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testArrowFunction() { $expected = array(); $expected[0] = array("name" => "$a", "content" => "int $a", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "int", "nullable_type" => false); $expected[1] = array("name" => "$b", "content" => "...$b", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => true, "type_hint" => '', "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8MixedTypeHint() { $expected = array(); $expected[0] = array("name" => "$var1", "content" => "mixed &...$var1", "has_attributes" => false, "pass_by_reference" => true, "variable_length" => true, "type_hint" => "mixed", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8MixedTypeHintNullable() { $expected = array(); $expected[0] = array("name" => "$var1", "content" => "?Mixed $var1", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?Mixed", "nullable_type" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testNamespaceOperatorTypeHint() { $expected = array(); $expected[0] = array("name" => "$var1", "content" => "?namespace\Name $var1", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?namespace\Name", "nullable_type" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8UnionTypesSimple() { $expected = array(); $expected[0] = array("name" => "$number", "content" => "int|float $number", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "int|float", "nullable_type" => false); $expected[1] = array("name" => "$obj", "content" => "self|parent &...$obj", "has_attributes" => false, "pass_by_reference" => true, "variable_length" => true, "type_hint" => "self|parent", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8UnionTypesWithSpreadOperatorAndReference() { $expected = array(); $expected[0] = array("name" => "$paramA", "content" => "float|null &$paramA", "has_attributes" => false, "pass_by_reference" => true, "variable_length" => false, "type_hint" => "float|null", "nullable_type" => false); $expected[1] = array("name" => "$paramB", "content" => "string|int ...$paramB", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => true, "type_hint" => "string|int", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8UnionTypesSimpleWithBitwiseOrInDefault() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "int|float $var = CONSTANT_A | CONSTANT_B", "default" => "CONSTANT_A | CONSTANT_B", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "int|float", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8UnionTypesTwoClasses() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "MyClassA|\Package\MyClassB $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "MyClassA|\Package\MyClassB", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8UnionTypesAllBaseTypes() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "array|bool|callable|int|float|null|object|string $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "array|bool|callable|int|float|null|object|string", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8UnionTypesAllPseudoTypes() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "false|mixed|self|parent|iterable|Resource $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "false|mixed|self|parent|iterable|Resource", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8UnionTypesNullable() { $expected = array(); $expected[0] = array("name" => "$number", "content" => "?int|float $number", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?int|float", "nullable_type" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8PseudoTypeNull() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "null $var = null", "default" => "null", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "null", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8PseudoTypeFalse() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "false $var = false", "default" => "false", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "false", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8PseudoTypeFalseAndBool() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "bool|false $var = false", "default" => "false", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "bool|false", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8ObjectAndClass() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "object|ClassName $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "object|ClassName", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8PseudoTypeIterableAndArray() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "iterable|array|Traversable $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "iterable|array|Traversable", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8DuplicateTypeInUnionWhitespaceAndComment() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "int | string /*comment*/ | INT $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "int|string|INT", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8ConstructorPropertyPromotionNoTypes() { $expected = array(); $expected[0] = array("name" => "$x", "content" => "public $x = 0.0", "default" => "0.0", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false, "property_visibility" => "public", "property_readonly" => false); $expected[1] = array("name" => "$y", "content" => "protected $y = ''", "default" => "''", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false, "property_visibility" => "protected", "property_readonly" => false); $expected[2] = array("name" => "$z", "content" => "private $z = null", "default" => "null", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false, "property_visibility" => "private", "property_readonly" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8ConstructorPropertyPromotionWithTypes() { $expected = array(); $expected[0] = array("name" => "$x", "content" => "protected float|int $x", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "float|int", "nullable_type" => false, "property_visibility" => "protected", "property_readonly" => false); $expected[1] = array("name" => "$y", "content" => "public ?string &$y = 'test'", "default" => "'test'", "has_attributes" => false, "pass_by_reference" => true, "variable_length" => false, "type_hint" => "?string", "nullable_type" => true, "property_visibility" => "public", "property_readonly" => false); $expected[2] = array("name" => "$z", "content" => "private mixed $z", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "mixed", "nullable_type" => false, "property_visibility" => "private", "property_readonly" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8ConstructorPropertyPromotionAndNormalParam() { $expected = array(); $expected[0] = array("name" => "$promotedProp", "content" => "public int $promotedProp", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "int", "nullable_type" => false, "property_visibility" => "public", "property_readonly" => false); $expected[1] = array("name" => "$normalArg", "content" => "?int $normalArg", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?int", "nullable_type" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP81ConstructorPropertyPromotionWithReadOnly() { $expected = array(); $expected[0] = array("name" => "$promotedProp", "content" => "public readonly ?int $promotedProp", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?int", "nullable_type" => true, "property_visibility" => "public", "property_readonly" => true); $expected[1] = array("name" => "$promotedToo", "content" => "readonly private string|bool &$promotedToo", "has_attributes" => false, "pass_by_reference" => true, "variable_length" => false, "type_hint" => "string|bool", "nullable_type" => false, "property_visibility" => "private", "property_readonly" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP81ConstructorPropertyPromotionWithOnlyReadOnly() { $expected = array(); $expected[0] = array("name" => "$promotedProp", "content" => "readonly Foo&Bar $promotedProp", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "Foo&Bar", "nullable_type" => false, "property_visibility" => "public", "property_readonly" => true); $expected[1] = array("name" => "$promotedToo", "content" => "readonly ?bool $promotedToo", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?bool", "nullable_type" => true, "property_visibility" => "public", "property_readonly" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8ConstructorPropertyPromotionGlobalFunction() { $expected = array(); $expected[0] = array("name" => "$x", "content" => "private $x", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false, "property_visibility" => "private"); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8ConstructorPropertyPromotionAbstractMethod() { $expected = array(); $expected[0] = array("name" => "$y", "content" => "public callable $y", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "callable", "nullable_type" => false, "property_visibility" => "public"); $expected[1] = array("name" => "$x", "content" => "private ...$x", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => true, "type_hint" => '', "nullable_type" => false, "property_visibility" => "private"); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testCommentsInParameter() { $expected = array(); $expected[0] = array("name" => "$param", "content" => "// Leading comment.
    ?MyClass /*-*/ & /*-*/.../*-*/ $param /*-*/ = /*-*/ 'default value' . /*-*/ 'second part' // Trailing comment.", "has_attributes" => false, "pass_by_reference" => true, "variable_length" => true, "type_hint" => "?MyClass", "nullable_type" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testParameterAttributesInFunctionDeclaration() { $expected = array(); $expected[0] = array("name" => "$constructorPropPromTypedParamSingleAttribute", "content" => "#[\MyExample\MyAttribute] private string $constructorPropPromTypedParamSingleAttribute", "has_attributes" => true, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "string", "nullable_type" => false, "property_visibility" => "private"); $expected[1] = array("name" => "$typedParamSingleAttribute", "content" => "#[MyAttr([1, 2])]
        Type|false
        $typedParamSingleAttribute", "has_attributes" => true, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "Type|false", "nullable_type" => false); $expected[2] = array("name" => "$nullableTypedParamMultiAttribute", "content" => "#[MyAttribute(1234), MyAttribute(5678)] ?int $nullableTypedParamMultiAttribute", "has_attributes" => true, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?int", "nullable_type" => true); $expected[3] = array("name" => "$nonTypedParamTwoAttributes", "content" => "#[WithoutArgument] #[SingleArgument(0)] $nonTypedParamTwoAttributes", "has_attributes" => true, "pass_by_reference" => false, "variable_length" => false, "type_hint" => '', "nullable_type" => false); $expected[4] = array("name" => "$otherParam", "content" => "#[MyAttribute(array("key" => "value"))]\xa        &...$otherParam", "has_attributes" => true, "pass_by_reference" => true, "variable_length" => true, "type_hint" => '', "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP8IntersectionTypes() { $expected = array(); $expected[0] = array("name" => "$obj1", "content" => "Foo&Bar $obj1", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "Foo&Bar", "nullable_type" => false); $expected[1] = array("name" => "$obj2", "content" => "Boo&Bar $obj2", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "Boo&Bar", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP81IntersectionTypesWithSpreadOperatorAndReference() { $expected = array(); $expected[0] = array("name" => "$paramA", "content" => "Boo&Bar &$paramA", "has_attributes" => false, "pass_by_reference" => true, "variable_length" => false, "type_hint" => "Boo&Bar", "nullable_type" => false); $expected[1] = array("name" => "$paramB", "content" => "Foo&Bar ...$paramB", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => true, "type_hint" => "Foo&Bar", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP81MoreIntersectionTypes() { $expected = array(); $expected[0] = array("name" => "$var", "content" => "MyClassA&\Package\MyClassB&\Package\MyClassC $var", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "MyClassA&\Package\MyClassB&\Package\MyClassC", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP81IllegalIntersectionTypes() { $expected = array(); $expected[0] = array("name" => "$numeric_string", "content" => "string&int $numeric_string", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "string&int", "nullable_type" => false); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } public function testPHP81NullableIntersectionTypes() { $expected = array(); $expected[0] = array("name" => "$object", "content" => "?Foo&Bar $object", "has_attributes" => false, "pass_by_reference" => false, "variable_length" => false, "type_hint" => "?Foo&Bar", "nullable_type" => true); $this->getMethodParametersTestHelper("/* " . __FUNCTION__ . " */", $expected); } private function getMethodParametersTestHelper($commentString, $expected) { $function = $this->getTargetToken($commentString, array(T_FUNCTION, T_CLOSURE, T_FN)); $found = self::$phpcsFile->getMethodParameters($function); $this->assertArraySubset($expected, $found, true); } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace PHP_CodeSniffer\Tests\Core\File; use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; class GetMethodParametersTest extends AbstractMethodUnitTest { public function testPassByReference() { $expected = array(); $expected[0] = array("\156\141\155\145" => "\x24\166\141\162", "\x63\x6f\156\x74\x65\x6e\x74" => "\x26\x24\x76\x61\x72", "\x68\x61\163\137\x61\x74\164\162\151\142\165\x74\145\163" => false, "\x70\141\x73\163\137\142\171\137\162\145\x66\145\x72\145\x6e\x63\145" => true, "\166\141\x72\x69\141\x62\x6c\145\137\154\145\156\x67\x74\150" => false, "\x74\171\160\x65\x5f\x68\151\x6e\164" => '', "\x6e\x75\154\154\x61\142\x6c\x65\x5f\164\171\x70\x65" => false); $this->getMethodParametersTestHelper("\x2f\52\40" . __FUNCTION__ . "\x20\x2a\x2f", $expected); } public function testArrayHint() { $expected = array(); $expected[0] = array("\x6e\x61\155\x65" => "\44\x76\x61\x72", "\x63\157\156\164\145\156\x74" => "\x61\x72\162\x61\171\x20\x24\166\141\x72", "\150\141\x73\137\141\164\x74\162\x69\142\x75\x74\x65\163" => false, "\160\x61\x73\163\x5f\x62\x79\137\162\145\x66\145\162\145\156\x63\145" => false, "\166\x61\162\151\141\x62\154\145\x5f\x6c\145\x6e\147\x74\150" => false, "\x74\171\160\x65\137\x68\151\156\164" => "\141\x72\162\141\x79", "\x6e\x75\x6c\x6c\141\x62\154\x65\x5f\164\171\x70\x65" => false); $this->getMethodParametersTestHelper("\57\52\40" . __FUNCTION__ . "\x20\52\x2f", $expected); } public function testVariable() { $expected = array(); $expected[0] = array("\x6e\x61\155\x65" => "\44\x76\141\162", "\x63\157\156\x74\145\x6e\x74" => "\x24\x76\x61\x72", "\x68\x61\x73\137\141\164\x74\162\x69\x62\x75\164\145\x73" => false, "\160\141\163\163\x5f\142\171\x5f\x72\x65\146\145\162\x65\x6e\x63\145" => false, "\166\141\162\x69\141\142\x6c\145\137\154\145\x6e\x67\x74\x68" => false, "\164\171\160\145\137\x68\151\156\x74" => '', "\x6e\x75\154\x6c\x61\x62\154\x65\137\164\171\160\x65" => false); $this->getMethodParametersTestHelper("\x2f\x2a\40" . __FUNCTION__ . "\x20\52\57", $expected); } public function testSingleDefaultValue() { $expected = array(); $expected[0] = array("\x6e\141\x6d\x65" => "\44\166\x61\x72\x31", "\143\157\x6e\x74\x65\156\164" => "\44\166\141\x72\61\75\163\145\x6c\x66\72\x3a\x43\117\x4e\123\x54\x41\116\x54", "\x68\141\x73\137\141\164\x74\162\x69\x62\165\x74\x65\x73" => false, "\x64\x65\146\141\x75\x6c\x74" => "\x73\145\x6c\x66\x3a\x3a\103\117\x4e\x53\124\x41\116\124", "\160\x61\163\x73\137\x62\171\137\x72\x65\x66\145\162\x65\156\143\x65" => false, "\166\141\x72\151\x61\142\x6c\x65\137\x6c\145\156\x67\x74\x68" => false, "\164\x79\160\x65\x5f\150\x69\156\x74" => '', "\x6e\x75\x6c\154\141\142\x6c\x65\x5f\x74\171\160\x65" => false); $this->getMethodParametersTestHelper("\x2f\x2a\x20" . __FUNCTION__ . "\40\x2a\57", $expected); } public function testDefaultValues() { $expected = array(); $expected[0] = array("\156\141\155\x65" => "\x24\x76\x61\x72\x31", "\x63\157\x6e\x74\145\x6e\x74" => "\44\x76\x61\x72\61\75\61", "\150\141\x73\137\141\x74\164\x72\151\142\165\x74\145\x73" => false, "\144\145\146\x61\x75\154\x74" => "\x31", "\x70\141\x73\163\x5f\142\171\x5f\x72\x65\146\145\x72\145\x6e\x63\145" => false, "\166\141\162\x69\141\x62\154\145\137\x6c\145\x6e\147\x74\x68" => false, "\x74\x79\x70\x65\x5f\x68\151\156\x74" => '', "\156\165\x6c\154\x61\142\x6c\145\x5f\x74\x79\x70\145" => false); $expected[1] = array("\x6e\141\x6d\x65" => "\x24\x76\141\162\62", "\143\157\156\164\145\156\x74" => "\x24\x76\141\162\x32\75\47\166\141\x6c\x75\x65\47", "\x68\x61\x73\x5f\x61\x74\x74\x72\x69\x62\165\x74\x65\x73" => false, "\x64\145\x66\x61\165\x6c\x74" => "\47\166\141\154\x75\145\x27", "\x70\x61\x73\163\x5f\x62\171\137\x72\x65\x66\145\162\145\156\x63\x65" => false, "\166\141\162\x69\141\x62\154\145\137\154\x65\x6e\x67\x74\x68" => false, "\x74\x79\x70\x65\137\x68\151\156\164" => '', "\156\165\x6c\154\x61\142\x6c\145\137\164\x79\160\145" => false); $this->getMethodParametersTestHelper("\x2f\x2a\x20" . __FUNCTION__ . "\x20\52\57", $expected); } public function testTypeHint() { $expected = array(); $expected[0] = array("\x6e\x61\155\145" => "\x24\x76\141\162\x31", "\143\x6f\156\x74\x65\156\164" => "\146\157\x6f\x20\44\x76\141\162\x31", "\150\x61\x73\137\141\164\x74\162\x69\x62\165\164\x65\163" => false, "\160\141\163\x73\x5f\142\x79\137\x72\x65\146\x65\x72\x65\x6e\x63\145" => false, "\x76\141\162\151\141\142\x6c\145\x5f\x6c\x65\156\147\164\150" => false, "\x74\x79\x70\x65\x5f\x68\151\156\x74" => "\146\x6f\157", "\x6e\x75\154\154\x61\142\x6c\x65\x5f\x74\x79\160\x65" => false); $expected[1] = array("\156\141\155\145" => "\44\166\141\162\x32", "\143\x6f\x6e\x74\x65\x6e\164" => "\142\141\x72\x20\44\166\x61\x72\62", "\150\x61\x73\137\x61\164\x74\x72\151\x62\x75\164\145\163" => false, "\160\141\163\x73\137\142\x79\x5f\x72\145\146\x65\162\x65\x6e\x63\x65" => false, "\x76\141\x72\x69\141\142\x6c\145\137\154\x65\156\147\164\x68" => false, "\x74\x79\x70\x65\x5f\150\151\x6e\x74" => "\142\x61\x72", "\x6e\165\x6c\154\x61\x62\154\x65\x5f\x74\171\160\145" => false); $this->getMethodParametersTestHelper("\57\52\x20" . __FUNCTION__ . "\40\x2a\57", $expected); } public function testSelfTypeHint() { $expected = array(); $expected[0] = array("\x6e\141\x6d\x65" => "\x24\166\x61\x72", "\x63\x6f\x6e\x74\145\x6e\x74" => "\163\145\154\x66\x20\x24\x76\x61\x72", "\150\x61\163\137\x61\164\164\x72\151\x62\165\164\x65\163" => false, "\x70\141\x73\163\137\x62\x79\x5f\x72\x65\146\145\x72\145\156\143\145" => false, "\x76\141\x72\x69\x61\142\154\145\137\x6c\145\x6e\x67\164\150" => false, "\x74\x79\x70\x65\137\x68\x69\156\164" => "\163\x65\154\146", "\x6e\165\x6c\x6c\141\x62\x6c\145\137\x74\x79\x70\x65" => false); $this->getMethodParametersTestHelper("\x2f\52\40" . __FUNCTION__ . "\x20\x2a\57", $expected); } public function testNullableTypeHint() { $expected = array(); $expected[0] = array("\x6e\141\155\145" => "\44\166\x61\x72\x31", "\143\157\156\164\x65\156\x74" => "\77\x69\156\164\40\x24\x76\141\162\x31", "\x68\141\x73\137\141\164\164\162\151\142\165\164\x65\x73" => false, "\x70\141\163\x73\x5f\142\x79\137\x72\x65\146\145\x72\145\156\143\145" => false, "\x76\x61\x72\x69\141\142\x6c\145\137\x6c\145\x6e\147\164\x68" => false, "\x74\171\160\145\x5f\150\x69\156\x74" => "\77\151\x6e\164", "\x6e\x75\154\154\141\x62\154\x65\137\164\171\160\145" => true); $expected[1] = array("\x6e\x61\155\x65" => "\x24\x76\141\x72\62", "\143\157\x6e\x74\145\x6e\x74" => "\x3f\134\142\x61\x72\40\44\x76\x61\162\62", "\150\x61\x73\x5f\141\x74\164\162\x69\142\165\164\145\x73" => false, "\x70\x61\x73\x73\137\142\171\137\x72\x65\146\145\162\x65\x6e\143\145" => false, "\x76\x61\162\x69\x61\x62\154\x65\x5f\154\x65\x6e\x67\x74\150" => false, "\x74\171\x70\145\137\150\151\156\x74" => "\77\134\142\141\x72", "\x6e\165\154\x6c\141\142\154\x65\x5f\164\x79\160\145" => true); $this->getMethodParametersTestHelper("\x2f\52\40" . __FUNCTION__ . "\x20\52\x2f", $expected); } public function testBitwiseAndConstantExpressionDefaultValue() { $expected = array(); $expected[0] = array("\x6e\x61\155\x65" => "\x24\141", "\143\157\156\x74\145\156\x74" => "\44\x61\x20\75\40\x31\60\x20\46\40\62\x30", "\144\x65\146\x61\x75\154\164" => "\x31\x30\x20\x26\x20\62\60", "\x68\x61\163\x5f\141\x74\x74\162\x69\142\165\x74\x65\163" => false, "\160\x61\163\163\137\142\171\x5f\162\x65\x66\145\x72\145\x6e\143\145" => false, "\166\x61\162\x69\141\x62\154\x65\x5f\x6c\145\156\x67\164\x68" => false, "\164\x79\x70\x65\x5f\x68\151\x6e\164" => '', "\x6e\x75\154\x6c\141\142\154\x65\x5f\164\171\x70\x65" => false); $this->getMethodParametersTestHelper("\57\x2a\40" . __FUNCTION__ . "\40\52\x2f", $expected); } public function testArrowFunction() { $expected = array(); $expected[0] = array("\156\141\x6d\x65" => "\44\x61", "\143\157\x6e\x74\145\156\x74" => "\x69\156\164\40\x24\141", "\x68\x61\x73\137\141\x74\x74\162\151\142\165\164\145\163" => false, "\x70\141\x73\x73\137\142\171\x5f\x72\145\146\x65\162\145\156\143\145" => false, "\x76\141\162\151\x61\x62\154\x65\x5f\x6c\x65\x6e\147\164\x68" => false, "\x74\171\x70\x65\137\150\151\x6e\x74" => "\x69\156\164", "\x6e\165\154\154\141\142\x6c\x65\x5f\164\x79\160\145" => false); $expected[1] = array("\156\141\155\x65" => "\44\x62", "\x63\157\x6e\164\x65\156\x74" => "\56\x2e\x2e\44\x62", "\x68\x61\x73\137\x61\x74\164\x72\151\142\x75\x74\145\163" => false, "\x70\141\163\x73\137\x62\171\x5f\162\145\146\145\x72\x65\x6e\x63\x65" => false, "\x76\141\x72\x69\x61\x62\154\x65\137\x6c\145\156\147\164\x68" => true, "\164\171\160\x65\x5f\x68\151\x6e\x74" => '', "\x6e\165\x6c\154\141\x62\154\145\x5f\x74\171\x70\145" => false); $this->getMethodParametersTestHelper("\x2f\x2a\x20" . __FUNCTION__ . "\x20\52\57", $expected); } public function testPHP8MixedTypeHint() { $expected = array(); $expected[0] = array("\x6e\x61\155\x65" => "\44\x76\141\x72\61", "\x63\x6f\156\164\145\156\x74" => "\155\x69\170\x65\x64\40\x26\x2e\56\56\44\166\141\x72\x31", "\150\x61\x73\137\141\164\x74\162\x69\142\165\x74\145\163" => false, "\160\141\163\x73\x5f\x62\x79\x5f\x72\x65\x66\x65\x72\x65\156\x63\x65" => true, "\x76\x61\x72\151\x61\x62\154\145\137\154\x65\156\x67\164\x68" => true, "\164\171\x70\145\x5f\150\151\x6e\x74" => "\155\151\x78\x65\x64", "\x6e\x75\x6c\x6c\x61\x62\x6c\x65\x5f\x74\171\x70\x65" => false); $this->getMethodParametersTestHelper("\57\x2a\x20" . __FUNCTION__ . "\40\x2a\57", $expected); } public function testPHP8MixedTypeHintNullable() { $expected = array(); $expected[0] = array("\x6e\x61\155\145" => "\x24\166\x61\x72\x31", "\143\157\x6e\164\145\x6e\164" => "\77\115\151\170\x65\x64\40\x24\x76\x61\162\61", "\150\x61\163\137\141\164\x74\162\x69\142\165\164\145\163" => false, "\160\141\x73\x73\x5f\142\171\137\162\x65\x66\x65\x72\145\156\x63\145" => false, "\x76\141\162\x69\x61\142\154\145\137\x6c\145\156\x67\164\x68" => false, "\164\171\160\x65\137\x68\x69\x6e\x74" => "\x3f\115\151\170\145\x64", "\x6e\165\154\x6c\141\x62\154\145\x5f\x74\171\160\x65" => true); $this->getMethodParametersTestHelper("\57\52\x20" . __FUNCTION__ . "\x20\x2a\57", $expected); } public function testNamespaceOperatorTypeHint() { $expected = array(); $expected[0] = array("\x6e\x61\x6d\x65" => "\44\x76\x61\x72\x31", "\143\157\x6e\164\145\156\164" => "\x3f\x6e\141\x6d\145\163\160\x61\x63\145\x5c\x4e\x61\155\x65\x20\44\x76\141\162\x31", "\x68\141\x73\x5f\x61\x74\164\162\x69\142\165\x74\145\x73" => false, "\x70\x61\x73\x73\x5f\142\171\x5f\162\145\x66\145\162\x65\156\143\x65" => false, "\x76\141\162\x69\x61\x62\154\145\x5f\x6c\145\x6e\x67\x74\150" => false, "\x74\x79\x70\x65\137\150\151\x6e\x74" => "\77\x6e\x61\x6d\145\x73\x70\141\143\x65\x5c\116\x61\x6d\x65", "\x6e\165\x6c\154\141\142\154\145\137\x74\171\x70\x65" => true); $this->getMethodParametersTestHelper("\x2f\x2a\40" . __FUNCTION__ . "\40\52\57", $expected); } public function testPHP8UnionTypesSimple() { $expected = array(); $expected[0] = array("\x6e\141\x6d\x65" => "\44\156\x75\x6d\x62\x65\x72", "\143\x6f\156\164\145\156\164" => "\151\x6e\164\x7c\146\154\x6f\141\164\x20\44\x6e\165\x6d\x62\x65\x72", "\x68\141\163\x5f\141\x74\x74\162\x69\x62\x75\x74\145\163" => false, "\160\x61\x73\163\x5f\x62\x79\137\162\x65\146\x65\162\145\x6e\143\145" => false, "\166\141\162\151\x61\142\x6c\x65\137\x6c\x65\156\147\x74\x68" => false, "\x74\171\160\x65\x5f\150\151\x6e\x74" => "\151\156\164\x7c\x66\154\157\141\164", "\156\x75\x6c\x6c\141\x62\154\x65\137\x74\x79\160\145" => false); $expected[1] = array("\156\x61\155\145" => "\44\x6f\x62\152", "\143\157\x6e\x74\x65\156\x74" => "\x73\x65\154\x66\x7c\160\x61\x72\145\x6e\164\40\x26\x2e\56\56\44\157\142\152", "\150\141\163\137\x61\x74\164\x72\151\x62\165\164\145\x73" => false, "\160\141\x73\163\137\142\x79\137\162\x65\146\145\162\145\x6e\143\x65" => true, "\166\141\x72\x69\x61\x62\x6c\x65\137\154\x65\x6e\147\164\150" => true, "\164\171\x70\145\137\x68\151\156\x74" => "\163\145\154\146\x7c\x70\141\x72\145\x6e\164", "\x6e\165\154\x6c\141\142\154\x65\137\x74\171\x70\145" => false); $this->getMethodParametersTestHelper("\57\52\40" . __FUNCTION__ . "\x20\x2a\x2f", $expected); } public function testPHP8UnionTypesWithSpreadOperatorAndReference() { $expected = array(); $expected[0] = array("\156\x61\155\x65" => "\x24\160\x61\x72\141\155\x41", "\x63\157\156\164\145\x6e\x74" => "\146\x6c\x6f\141\164\174\156\x75\154\x6c\x20\x26\x24\160\141\162\141\x6d\x41", "\150\141\163\x5f\x61\x74\x74\162\x69\142\165\164\145\x73" => false, "\160\x61\x73\163\137\142\171\137\162\145\x66\x65\x72\145\156\x63\x65" => true, "\166\x61\162\151\141\142\x6c\145\x5f\x6c\145\x6e\x67\x74\150" => false, "\164\x79\160\x65\137\x68\151\156\x74" => "\146\x6c\157\141\164\174\156\x75\x6c\x6c", "\156\165\154\154\x61\x62\154\145\137\164\x79\160\145" => false); $expected[1] = array("\x6e\x61\x6d\145" => "\x24\x70\141\162\141\x6d\102", "\143\x6f\156\x74\x65\x6e\164" => "\x73\164\162\151\156\147\x7c\151\156\164\x20\x2e\56\x2e\44\x70\141\x72\x61\x6d\102", "\x68\x61\x73\137\x61\x74\164\x72\x69\142\165\x74\x65\163" => false, "\160\141\163\163\137\142\x79\137\162\145\146\x65\x72\x65\156\x63\x65" => false, "\x76\141\162\x69\x61\x62\154\145\x5f\x6c\x65\x6e\147\x74\x68" => true, "\164\171\160\145\x5f\x68\x69\156\164" => "\x73\x74\x72\x69\156\147\174\151\x6e\164", "\156\x75\154\154\141\142\x6c\x65\x5f\164\171\160\x65" => false); $this->getMethodParametersTestHelper("\57\x2a\x20" . __FUNCTION__ . "\x20\x2a\x2f", $expected); } public function testPHP8UnionTypesSimpleWithBitwiseOrInDefault() { $expected = array(); $expected[0] = array("\x6e\x61\x6d\x65" => "\x24\x76\x61\x72", "\143\157\x6e\x74\145\x6e\x74" => "\x69\156\x74\x7c\x66\154\157\x61\x74\x20\44\x76\141\162\40\x3d\40\x43\117\116\x53\124\x41\x4e\124\x5f\x41\40\x7c\x20\103\117\x4e\x53\x54\101\x4e\x54\137\x42", "\144\145\146\x61\x75\x6c\164" => "\103\x4f\x4e\123\124\x41\116\124\137\101\x20\174\40\x43\117\x4e\x53\x54\x41\x4e\x54\137\x42", "\150\x61\x73\x5f\x61\164\164\x72\x69\x62\x75\164\x65\163" => false, "\x70\x61\x73\x73\x5f\x62\171\137\162\145\x66\x65\162\145\156\143\145" => false, "\x76\141\162\151\x61\x62\154\x65\x5f\x6c\145\x6e\x67\x74\x68" => false, "\x74\171\160\145\x5f\x68\151\x6e\x74" => "\x69\156\x74\174\146\154\x6f\x61\x74", "\x6e\x75\154\x6c\x61\x62\154\145\137\x74\171\160\x65" => false); $this->getMethodParametersTestHelper("\x2f\52\40" . __FUNCTION__ . "\x20\52\x2f", $expected); } public function testPHP8UnionTypesTwoClasses() { $expected = array(); $expected[0] = array("\x6e\x61\155\145" => "\x24\x76\x61\162", "\143\x6f\x6e\x74\x65\156\x74" => "\115\171\103\x6c\x61\x73\163\x41\x7c\x5c\x50\x61\x63\x6b\141\x67\145\x5c\115\171\103\x6c\x61\163\x73\x42\x20\44\166\141\162", "\150\141\x73\137\141\164\x74\x72\x69\x62\165\x74\145\163" => false, "\x70\x61\x73\x73\137\x62\x79\137\x72\x65\x66\145\x72\x65\x6e\x63\x65" => false, "\166\141\162\x69\x61\x62\x6c\145\137\154\145\x6e\147\164\150" => false, "\x74\x79\160\x65\137\x68\151\156\164" => "\115\171\103\x6c\x61\x73\x73\101\174\x5c\x50\141\x63\x6b\x61\147\145\134\115\x79\103\154\141\163\x73\102", "\156\x75\x6c\x6c\141\142\x6c\x65\x5f\x74\171\x70\x65" => false); $this->getMethodParametersTestHelper("\57\52\x20" . __FUNCTION__ . "\40\x2a\x2f", $expected); } public function testPHP8UnionTypesAllBaseTypes() { $expected = array(); $expected[0] = array("\156\x61\x6d\x65" => "\44\166\141\x72", "\x63\x6f\x6e\x74\145\x6e\x74" => "\141\x72\x72\141\x79\174\142\157\x6f\x6c\174\143\x61\x6c\x6c\x61\x62\x6c\145\174\x69\x6e\x74\174\x66\x6c\x6f\141\164\174\x6e\x75\154\x6c\x7c\157\142\x6a\145\x63\x74\x7c\163\x74\x72\x69\156\147\40\x24\x76\x61\162", "\x68\141\163\x5f\x61\x74\164\x72\x69\x62\165\x74\x65\163" => false, "\x70\141\x73\163\137\142\x79\x5f\162\x65\x66\145\162\145\x6e\143\x65" => false, "\x76\x61\x72\x69\x61\x62\x6c\x65\x5f\154\x65\156\147\x74\150" => false, "\x74\171\160\145\x5f\x68\151\x6e\x74" => "\141\x72\162\141\x79\174\x62\x6f\x6f\x6c\174\143\141\154\154\x61\142\x6c\x65\174\x69\x6e\x74\174\x66\154\157\x61\x74\x7c\x6e\165\154\154\x7c\157\x62\152\x65\143\x74\x7c\x73\x74\162\151\156\x67", "\156\165\x6c\x6c\141\x62\154\145\137\x74\171\160\145" => false); $this->getMethodParametersTestHelper("\57\x2a\40" . __FUNCTION__ . "\x20\x2a\x2f", $expected); } public function testPHP8UnionTypesAllPseudoTypes() { $expected = array(); $expected[0] = array("\156\x61\155\x65" => "\x24\x76\x61\162", "\x63\157\156\164\145\156\x74" => "\x66\x61\154\163\x65\x7c\x6d\151\170\145\x64\174\163\x65\x6c\146\x7c\x70\x61\x72\x65\156\x74\174\x69\164\x65\x72\x61\142\x6c\x65\x7c\x52\x65\163\157\x75\x72\x63\145\x20\44\x76\x61\162", "\x68\141\163\x5f\x61\x74\x74\162\151\142\x75\164\145\x73" => false, "\160\141\163\x73\137\142\171\x5f\x72\145\x66\x65\162\145\156\x63\145" => false, "\x76\141\162\x69\141\142\154\145\137\x6c\x65\x6e\147\x74\150" => false, "\164\x79\160\x65\x5f\150\x69\x6e\x74" => "\146\x61\x6c\163\145\174\x6d\x69\x78\x65\x64\174\163\x65\x6c\x66\x7c\160\141\162\x65\156\x74\x7c\x69\164\x65\162\141\x62\x6c\x65\x7c\122\145\x73\x6f\165\162\x63\x65", "\x6e\165\154\154\x61\142\x6c\145\137\x74\x79\160\x65" => false); $this->getMethodParametersTestHelper("\57\52\x20" . __FUNCTION__ . "\40\52\x2f", $expected); } public function testPHP8UnionTypesNullable() { $expected = array(); $expected[0] = array("\156\141\155\x65" => "\x24\x6e\165\155\x62\145\162", "\x63\157\156\x74\145\156\164" => "\x3f\151\x6e\164\x7c\x66\x6c\x6f\141\x74\40\44\156\x75\x6d\x62\x65\162", "\x68\141\x73\137\141\x74\164\162\151\x62\x75\x74\x65\x73" => false, "\160\x61\x73\x73\x5f\142\x79\x5f\x72\145\146\x65\x72\145\156\143\x65" => false, "\x76\x61\x72\x69\x61\x62\x6c\x65\137\x6c\x65\156\147\164\x68" => false, "\164\x79\160\x65\x5f\x68\151\156\x74" => "\x3f\151\156\x74\174\146\154\x6f\x61\164", "\x6e\165\x6c\x6c\x61\x62\154\x65\137\164\171\160\x65" => true); $this->getMethodParametersTestHelper("\x2f\52\x20" . __FUNCTION__ . "\x20\x2a\57", $expected); } public function testPHP8PseudoTypeNull() { $expected = array(); $expected[0] = array("\156\141\155\x65" => "\44\166\x61\162", "\143\x6f\156\x74\145\156\164" => "\x6e\165\x6c\x6c\40\x24\166\141\162\40\x3d\40\156\x75\x6c\154", "\144\145\146\x61\165\x6c\164" => "\x6e\165\x6c\154", "\x68\x61\163\x5f\141\164\x74\162\151\142\x75\x74\x65\x73" => false, "\x70\141\x73\163\137\x62\x79\137\x72\x65\x66\x65\x72\145\x6e\143\145" => false, "\166\x61\x72\x69\x61\142\x6c\x65\137\x6c\145\156\147\164\x68" => false, "\x74\x79\x70\145\137\150\x69\156\x74" => "\156\165\x6c\154", "\x6e\165\x6c\x6c\141\x62\x6c\145\137\x74\171\x70\x65" => false); $this->getMethodParametersTestHelper("\x2f\52\40" . __FUNCTION__ . "\x20\x2a\x2f", $expected); } public function testPHP8PseudoTypeFalse() { $expected = array(); $expected[0] = array("\156\x61\155\145" => "\44\x76\141\162", "\143\x6f\x6e\164\x65\x6e\164" => "\x66\141\x6c\163\x65\x20\44\166\x61\x72\x20\75\40\x66\141\x6c\x73\145", "\144\x65\146\141\x75\154\x74" => "\x66\141\154\x73\145", "\x68\141\x73\137\141\164\x74\x72\x69\142\165\x74\145\x73" => false, "\x70\x61\x73\163\x5f\142\171\x5f\162\x65\x66\145\162\x65\156\143\x65" => false, "\x76\141\162\x69\x61\142\154\x65\x5f\154\145\x6e\147\164\150" => false, "\x74\171\160\145\137\150\151\156\x74" => "\x66\x61\154\x73\145", "\156\x75\154\x6c\x61\x62\x6c\145\x5f\164\171\160\145" => false); $this->getMethodParametersTestHelper("\57\52\x20" . __FUNCTION__ . "\x20\52\x2f", $expected); } public function testPHP8PseudoTypeFalseAndBool() { $expected = array(); $expected[0] = array("\156\141\x6d\x65" => "\44\x76\141\162", "\x63\x6f\156\164\x65\x6e\x74" => "\142\157\157\x6c\174\146\x61\154\x73\145\40\x24\166\x61\x72\40\75\x20\146\x61\x6c\x73\145", "\144\x65\146\141\165\x6c\164" => "\x66\141\x6c\x73\x65", "\150\141\163\x5f\x61\164\164\162\x69\142\x75\164\145\163" => false, "\x70\141\163\163\137\142\171\137\162\x65\146\145\x72\145\156\143\x65" => false, "\x76\141\x72\x69\x61\x62\154\x65\x5f\x6c\145\156\147\164\x68" => false, "\x74\171\x70\x65\137\150\x69\x6e\164" => "\x62\157\x6f\x6c\174\x66\141\154\x73\x65", "\x6e\x75\x6c\x6c\x61\142\154\145\x5f\164\x79\160\145" => false); $this->getMethodParametersTestHelper("\x2f\52\x20" . __FUNCTION__ . "\40\x2a\x2f", $expected); } public function testPHP8ObjectAndClass() { $expected = array(); $expected[0] = array("\156\x61\x6d\145" => "\44\x76\x61\162", "\143\157\x6e\x74\x65\156\164" => "\x6f\142\x6a\145\x63\x74\x7c\x43\154\x61\x73\163\116\141\x6d\145\x20\x24\x76\141\x72", "\x68\x61\x73\137\x61\164\x74\162\x69\142\165\164\x65\x73" => false, "\x70\x61\x73\163\137\x62\171\137\x72\x65\146\x65\162\x65\156\143\x65" => false, "\x76\141\x72\151\141\x62\154\145\x5f\154\x65\156\x67\164\150" => false, "\164\x79\x70\x65\x5f\x68\x69\156\164" => "\x6f\142\152\x65\x63\164\x7c\x43\x6c\141\163\163\116\141\155\x65", "\156\x75\x6c\x6c\141\142\154\x65\137\x74\x79\160\x65" => false); $this->getMethodParametersTestHelper("\x2f\x2a\x20" . __FUNCTION__ . "\x20\52\x2f", $expected); } public function testPHP8PseudoTypeIterableAndArray() { $expected = array(); $expected[0] = array("\156\x61\155\x65" => "\x24\x76\141\162", "\143\x6f\x6e\x74\x65\x6e\164" => "\x69\x74\x65\x72\x61\x62\x6c\x65\x7c\141\x72\x72\141\171\x7c\124\x72\x61\x76\145\x72\x73\141\142\154\145\x20\x24\x76\141\162", "\x68\x61\x73\137\x61\x74\x74\162\x69\x62\165\164\145\x73" => false, "\160\141\163\x73\x5f\x62\x79\x5f\x72\145\146\145\x72\x65\x6e\143\145" => false, "\166\141\x72\x69\x61\142\154\145\x5f\154\x65\156\147\x74\x68" => false, "\x74\171\160\145\x5f\150\151\156\x74" => "\151\164\145\x72\141\142\154\x65\174\x61\x72\162\x61\x79\x7c\124\x72\141\x76\x65\x72\163\141\142\154\x65", "\x6e\x75\154\154\x61\142\x6c\x65\137\164\171\160\145" => false); $this->getMethodParametersTestHelper("\57\x2a\40" . __FUNCTION__ . "\x20\x2a\x2f", $expected); } public function testPHP8DuplicateTypeInUnionWhitespaceAndComment() { $expected = array(); $expected[0] = array("\156\141\x6d\145" => "\x24\x76\141\162", "\x63\x6f\156\x74\x65\156\164" => "\151\156\x74\40\x7c\x20\x73\164\162\151\x6e\147\x20\x2f\52\143\157\x6d\x6d\x65\156\164\x2a\x2f\40\174\40\111\x4e\124\40\x24\x76\x61\162", "\x68\141\163\x5f\x61\164\164\162\x69\142\x75\x74\145\163" => false, "\160\x61\163\163\x5f\x62\171\137\x72\145\x66\145\162\x65\156\x63\145" => false, "\166\x61\x72\x69\x61\x62\154\145\137\154\145\x6e\147\x74\150" => false, "\x74\x79\160\145\137\x68\x69\156\x74" => "\151\x6e\164\174\x73\x74\162\x69\156\x67\x7c\111\x4e\x54", "\156\165\x6c\x6c\x61\x62\x6c\145\137\164\x79\x70\145" => false); $this->getMethodParametersTestHelper("\x2f\52\x20" . __FUNCTION__ . "\x20\52\57", $expected); } public function testPHP8ConstructorPropertyPromotionNoTypes() { $expected = array(); $expected[0] = array("\x6e\141\155\145" => "\44\x78", "\143\157\156\164\x65\x6e\x74" => "\160\165\x62\x6c\151\143\x20\x24\170\40\x3d\40\x30\56\60", "\144\145\146\x61\165\154\164" => "\60\x2e\60", "\x68\x61\163\137\x61\x74\164\x72\151\142\165\x74\145\163" => false, "\160\141\163\163\x5f\x62\x79\x5f\x72\x65\146\x65\162\145\156\143\x65" => false, "\166\141\x72\x69\x61\x62\154\x65\137\154\145\x6e\x67\x74\150" => false, "\x74\x79\160\145\137\x68\x69\156\x74" => '', "\x6e\165\154\154\x61\142\x6c\x65\x5f\x74\x79\x70\145" => false, "\x70\x72\157\x70\x65\x72\164\171\x5f\166\151\163\x69\142\x69\154\x69\164\171" => "\160\x75\x62\154\151\x63", "\x70\x72\157\x70\x65\162\164\171\x5f\162\145\141\x64\157\156\154\171" => false); $expected[1] = array("\x6e\x61\155\145" => "\44\171", "\x63\x6f\x6e\164\x65\156\164" => "\x70\x72\157\164\145\143\x74\145\x64\x20\44\x79\40\75\40\47\x27", "\x64\x65\x66\x61\x75\x6c\164" => "\x27\47", "\x68\141\163\x5f\x61\164\164\x72\x69\142\x75\164\145\163" => false, "\160\x61\x73\163\137\142\171\x5f\x72\145\x66\x65\x72\x65\156\x63\x65" => false, "\x76\141\162\151\x61\142\x6c\x65\x5f\x6c\145\156\147\x74\150" => false, "\x74\171\x70\145\x5f\x68\151\x6e\164" => '', "\156\x75\154\154\141\x62\154\x65\x5f\x74\x79\160\145" => false, "\x70\162\x6f\160\145\x72\x74\x79\137\x76\151\163\x69\x62\x69\x6c\151\x74\171" => "\160\162\157\164\x65\143\164\x65\144", "\x70\162\157\x70\145\162\164\x79\x5f\162\145\x61\x64\x6f\x6e\x6c\171" => false); $expected[2] = array("\156\141\155\145" => "\x24\172", "\x63\157\156\164\145\156\164" => "\160\162\151\166\141\x74\145\40\x24\172\40\75\40\x6e\165\154\154", "\144\145\146\141\165\x6c\164" => "\156\165\154\x6c", "\x68\x61\x73\x5f\141\164\164\x72\x69\x62\x75\x74\145\163" => false, "\x70\x61\163\163\137\142\171\x5f\162\x65\x66\145\162\x65\156\x63\x65" => false, "\x76\141\162\151\x61\142\154\145\x5f\x6c\145\156\147\164\150" => false, "\164\x79\160\145\137\x68\x69\x6e\x74" => '', "\x6e\165\x6c\154\x61\x62\x6c\145\137\x74\x79\160\x65" => false, "\x70\x72\157\x70\145\162\164\171\x5f\x76\151\x73\x69\x62\x69\x6c\151\x74\171" => "\160\x72\x69\x76\x61\164\x65", "\x70\162\x6f\160\145\x72\x74\171\137\x72\x65\141\x64\x6f\156\154\171" => false); $this->getMethodParametersTestHelper("\x2f\52\40" . __FUNCTION__ . "\x20\52\x2f", $expected); } public function testPHP8ConstructorPropertyPromotionWithTypes() { $expected = array(); $expected[0] = array("\156\x61\155\145" => "\44\x78", "\x63\157\x6e\164\145\156\x74" => "\x70\162\x6f\164\145\143\x74\145\144\40\146\154\x6f\141\x74\174\x69\156\164\40\44\170", "\150\x61\x73\x5f\x61\164\164\x72\x69\142\x75\164\145\163" => false, "\x70\141\163\x73\137\x62\171\137\162\145\x66\x65\162\145\156\143\x65" => false, "\x76\x61\162\151\141\142\x6c\145\137\x6c\145\x6e\147\164\x68" => false, "\164\x79\160\x65\x5f\150\151\156\164" => "\x66\x6c\x6f\141\x74\174\x69\x6e\x74", "\156\165\154\154\141\142\154\145\137\x74\x79\160\x65" => false, "\x70\x72\x6f\160\145\162\x74\171\137\166\151\163\x69\142\151\x6c\151\164\x79" => "\160\x72\157\x74\145\x63\x74\145\x64", "\x70\162\157\160\x65\162\x74\171\137\x72\x65\141\144\157\x6e\154\x79" => false); $expected[1] = array("\156\x61\155\145" => "\x24\171", "\x63\x6f\x6e\x74\x65\156\x74" => "\160\x75\142\154\151\143\40\77\163\164\x72\151\x6e\x67\40\x26\44\171\40\x3d\40\47\164\x65\163\164\x27", "\x64\x65\x66\141\x75\x6c\164" => "\x27\164\145\x73\164\x27", "\150\x61\x73\137\x61\x74\x74\x72\151\142\x75\164\x65\163" => false, "\x70\141\163\x73\x5f\x62\x79\137\x72\145\x66\145\x72\x65\156\143\x65" => true, "\166\x61\x72\x69\141\x62\x6c\145\137\154\145\x6e\147\x74\x68" => false, "\164\171\x70\x65\x5f\150\151\x6e\164" => "\x3f\x73\164\x72\x69\156\147", "\156\x75\x6c\154\x61\142\154\145\x5f\164\171\x70\x65" => true, "\160\162\157\160\145\162\x74\x79\x5f\166\x69\163\x69\142\x69\x6c\151\164\x79" => "\160\x75\142\x6c\x69\x63", "\160\162\157\160\x65\162\164\171\x5f\x72\x65\x61\x64\157\x6e\x6c\171" => false); $expected[2] = array("\x6e\141\x6d\145" => "\44\172", "\x63\x6f\156\164\145\156\x74" => "\160\162\x69\166\x61\164\145\40\x6d\x69\170\145\x64\x20\x24\172", "\x68\x61\163\x5f\x61\x74\x74\x72\x69\142\165\x74\x65\163" => false, "\160\141\x73\163\137\x62\171\137\x72\x65\146\145\x72\145\x6e\x63\x65" => false, "\x76\141\162\x69\x61\x62\x6c\x65\137\x6c\145\156\x67\x74\150" => false, "\x74\x79\160\145\x5f\150\151\x6e\x74" => "\x6d\x69\170\x65\x64", "\156\165\154\154\141\142\154\145\137\164\x79\x70\145" => false, "\x70\162\157\160\x65\x72\164\x79\x5f\166\x69\163\x69\142\x69\154\x69\x74\x79" => "\160\162\x69\166\x61\164\145", "\160\162\x6f\x70\145\162\x74\171\137\x72\145\141\x64\x6f\x6e\154\171" => false); $this->getMethodParametersTestHelper("\x2f\52\40" . __FUNCTION__ . "\x20\52\x2f", $expected); } public function testPHP8ConstructorPropertyPromotionAndNormalParam() { $expected = array(); $expected[0] = array("\156\x61\155\145" => "\x24\x70\x72\x6f\155\157\164\x65\x64\x50\162\157\160", "\x63\157\156\164\x65\x6e\x74" => "\160\x75\x62\154\151\143\40\151\156\164\x20\44\x70\162\x6f\155\x6f\x74\145\x64\x50\x72\x6f\160", "\150\x61\163\x5f\141\x74\x74\x72\x69\x62\165\164\x65\163" => false, "\x70\x61\x73\163\137\142\x79\137\162\x65\x66\145\162\145\156\143\145" => false, "\x76\141\162\151\141\x62\154\x65\x5f\154\x65\x6e\147\x74\150" => false, "\164\171\160\145\137\150\151\x6e\164" => "\151\156\164", "\156\x75\x6c\154\141\x62\154\x65\137\164\x79\x70\145" => false, "\160\x72\x6f\160\x65\162\164\171\x5f\x76\x69\163\151\x62\151\154\x69\164\x79" => "\x70\x75\x62\x6c\x69\143", "\160\x72\157\x70\x65\162\164\x79\x5f\x72\x65\141\x64\x6f\x6e\x6c\x79" => false); $expected[1] = array("\x6e\x61\x6d\x65" => "\x24\x6e\157\162\x6d\x61\x6c\101\162\x67", "\143\x6f\x6e\x74\x65\156\164" => "\x3f\151\x6e\164\40\x24\156\x6f\x72\155\x61\x6c\x41\162\147", "\x68\x61\x73\137\x61\x74\164\162\151\x62\165\x74\x65\163" => false, "\x70\141\163\163\137\x62\x79\x5f\x72\145\x66\145\x72\x65\156\x63\145" => false, "\x76\x61\x72\151\141\142\154\145\137\x6c\145\156\x67\x74\x68" => false, "\x74\x79\x70\145\137\x68\151\156\x74" => "\77\151\156\x74", "\156\165\x6c\x6c\x61\x62\154\145\x5f\x74\x79\x70\x65" => true); $this->getMethodParametersTestHelper("\57\52\40" . __FUNCTION__ . "\x20\x2a\57", $expected); } public function testPHP81ConstructorPropertyPromotionWithReadOnly() { $expected = array(); $expected[0] = array("\156\x61\155\145" => "\44\160\162\157\155\x6f\x74\145\x64\120\x72\157\x70", "\143\157\156\x74\x65\156\x74" => "\x70\x75\142\154\x69\x63\40\x72\145\x61\144\157\156\154\x79\x20\x3f\151\x6e\x74\40\44\x70\x72\157\155\157\x74\x65\x64\x50\162\x6f\160", "\x68\141\x73\137\141\x74\x74\x72\151\x62\x75\164\x65\163" => false, "\x70\141\163\x73\x5f\142\x79\137\x72\x65\x66\x65\162\145\x6e\143\x65" => false, "\166\x61\162\x69\x61\x62\x6c\145\x5f\x6c\x65\x6e\147\164\x68" => false, "\164\x79\160\145\137\150\151\x6e\164" => "\x3f\x69\x6e\164", "\156\x75\154\x6c\141\142\x6c\x65\137\164\171\x70\x65" => true, "\160\162\x6f\160\145\x72\x74\171\137\x76\151\163\151\142\151\154\x69\164\171" => "\x70\x75\x62\154\151\143", "\x70\x72\x6f\160\145\x72\164\x79\137\x72\145\x61\x64\157\x6e\x6c\171" => true); $expected[1] = array("\x6e\141\x6d\x65" => "\44\160\x72\157\155\x6f\x74\x65\x64\124\157\x6f", "\143\x6f\x6e\164\x65\156\164" => "\162\145\x61\144\157\156\154\x79\40\160\162\151\x76\x61\164\x65\x20\163\164\x72\151\156\147\x7c\142\x6f\157\x6c\40\x26\x24\160\162\157\x6d\157\164\145\x64\124\x6f\x6f", "\150\x61\163\137\141\164\x74\x72\x69\x62\165\164\145\163" => false, "\x70\x61\163\x73\x5f\x62\x79\x5f\x72\x65\x66\145\x72\145\x6e\x63\145" => true, "\166\x61\x72\x69\141\142\x6c\145\x5f\154\x65\156\147\164\x68" => false, "\x74\x79\160\145\x5f\150\x69\156\164" => "\163\x74\162\151\156\x67\174\142\x6f\x6f\x6c", "\x6e\165\x6c\x6c\141\142\x6c\x65\x5f\164\171\160\x65" => false, "\x70\x72\x6f\160\x65\x72\164\x79\x5f\x76\151\x73\x69\x62\x69\154\x69\164\171" => "\160\x72\151\166\141\164\145", "\x70\x72\157\x70\145\x72\x74\x79\137\x72\145\x61\144\x6f\x6e\x6c\171" => true); $this->getMethodParametersTestHelper("\x2f\x2a\x20" . __FUNCTION__ . "\40\x2a\57", $expected); } public function testPHP81ConstructorPropertyPromotionWithOnlyReadOnly() { $expected = array(); $expected[0] = array("\x6e\x61\x6d\145" => "\44\160\162\157\155\157\164\145\144\120\x72\157\x70", "\x63\x6f\x6e\164\145\x6e\164" => "\162\x65\x61\144\157\156\154\171\x20\x46\157\157\46\x42\141\162\40\44\160\162\x6f\x6d\x6f\x74\145\144\x50\162\x6f\x70", "\x68\x61\163\x5f\x61\x74\x74\162\x69\x62\x75\164\145\x73" => false, "\160\141\x73\x73\x5f\142\x79\x5f\x72\x65\146\145\162\x65\x6e\143\x65" => false, "\166\x61\x72\151\x61\x62\x6c\x65\x5f\154\x65\x6e\147\164\x68" => false, "\164\171\x70\145\x5f\x68\151\x6e\x74" => "\106\157\157\x26\102\141\x72", "\x6e\x75\154\154\x61\x62\x6c\145\x5f\x74\x79\160\145" => false, "\x70\162\157\x70\145\162\164\171\137\166\x69\163\x69\142\x69\x6c\151\x74\x79" => "\160\165\142\154\151\x63", "\x70\x72\x6f\160\x65\x72\x74\x79\x5f\x72\x65\x61\144\x6f\x6e\154\171" => true); $expected[1] = array("\156\x61\155\x65" => "\x24\160\x72\x6f\x6d\157\164\x65\x64\124\x6f\x6f", "\x63\x6f\x6e\x74\145\x6e\x74" => "\162\x65\x61\144\157\156\154\171\x20\77\142\157\157\x6c\40\44\160\162\157\155\x6f\x74\x65\144\x54\x6f\157", "\150\x61\163\x5f\141\x74\164\162\151\142\165\164\145\163" => false, "\160\141\163\x73\x5f\x62\171\137\162\x65\146\145\162\x65\x6e\143\145" => false, "\x76\x61\162\151\141\142\154\145\137\x6c\x65\x6e\147\x74\x68" => false, "\x74\x79\x70\x65\x5f\x68\151\x6e\164" => "\x3f\x62\x6f\157\x6c", "\156\x75\154\x6c\141\x62\154\x65\x5f\x74\171\160\x65" => true, "\160\x72\157\x70\145\162\x74\x79\137\166\151\x73\x69\142\151\x6c\151\164\x79" => "\160\165\142\x6c\151\143", "\x70\162\x6f\160\145\x72\164\x79\137\x72\x65\141\x64\x6f\x6e\154\x79" => true); $this->getMethodParametersTestHelper("\x2f\52\x20" . __FUNCTION__ . "\x20\x2a\x2f", $expected); } public function testPHP8ConstructorPropertyPromotionGlobalFunction() { $expected = array(); $expected[0] = array("\x6e\x61\155\x65" => "\44\x78", "\x63\157\x6e\x74\145\156\x74" => "\160\x72\x69\166\141\x74\x65\x20\x24\x78", "\150\x61\x73\x5f\141\x74\164\x72\151\142\x75\x74\145\163" => false, "\x70\141\163\x73\137\x62\x79\137\x72\145\x66\145\x72\x65\x6e\143\145" => false, "\x76\141\162\x69\x61\x62\154\x65\137\x6c\x65\156\x67\164\x68" => false, "\x74\x79\x70\145\137\150\151\x6e\x74" => '', "\x6e\165\154\x6c\x61\x62\154\145\137\x74\171\x70\145" => false, "\x70\x72\157\160\145\162\164\171\137\x76\151\x73\151\142\151\154\x69\164\x79" => "\160\x72\x69\166\141\x74\x65"); $this->getMethodParametersTestHelper("\x2f\x2a\40" . __FUNCTION__ . "\40\52\57", $expected); } public function testPHP8ConstructorPropertyPromotionAbstractMethod() { $expected = array(); $expected[0] = array("\x6e\x61\x6d\145" => "\x24\171", "\143\x6f\x6e\164\x65\x6e\x74" => "\x70\165\142\x6c\151\143\x20\x63\141\154\154\x61\142\x6c\145\x20\44\171", "\150\141\x73\137\x61\x74\x74\x72\151\x62\165\164\x65\163" => false, "\160\141\x73\x73\137\142\171\137\162\145\146\x65\x72\x65\156\143\145" => false, "\x76\x61\x72\151\141\142\x6c\x65\x5f\154\x65\156\x67\x74\x68" => false, "\164\x79\x70\145\x5f\x68\x69\x6e\164" => "\143\x61\x6c\x6c\141\x62\154\145", "\156\165\154\154\x61\142\154\x65\137\164\x79\160\145" => false, "\x70\x72\x6f\160\x65\162\x74\171\x5f\166\x69\163\x69\x62\x69\x6c\151\x74\x79" => "\160\x75\142\x6c\151\143"); $expected[1] = array("\x6e\x61\155\x65" => "\44\x78", "\x63\157\x6e\164\x65\156\164" => "\x70\162\x69\166\141\x74\145\40\x2e\56\x2e\x24\x78", "\x68\141\x73\137\x61\164\x74\x72\x69\x62\x75\x74\145\x73" => false, "\x70\141\163\x73\x5f\x62\x79\137\162\145\x66\x65\162\x65\156\x63\x65" => false, "\x76\x61\162\151\141\142\154\145\x5f\154\x65\156\x67\x74\150" => true, "\x74\x79\x70\145\137\150\x69\156\164" => '', "\156\165\x6c\154\141\142\154\145\x5f\x74\x79\160\145" => false, "\x70\x72\x6f\160\145\x72\x74\x79\x5f\166\x69\x73\x69\x62\x69\x6c\151\164\171" => "\x70\162\x69\x76\x61\x74\x65"); $this->getMethodParametersTestHelper("\57\52\x20" . __FUNCTION__ . "\x20\x2a\x2f", $expected); } public function testCommentsInParameter() { $expected = array(); $expected[0] = array("\156\141\155\145" => "\44\160\141\x72\141\x6d", "\143\157\x6e\164\x65\x6e\x74" => "\57\57\x20\114\145\141\x64\x69\156\147\x20\143\157\x6d\x6d\145\x6e\164\x2e\12\40\x20\40\40\x3f\x4d\171\103\154\141\x73\163\40\57\52\x2d\52\57\x20\x26\x20\57\52\x2d\x2a\57\x2e\56\56\57\52\55\52\x2f\40\x24\x70\x61\162\x61\155\40\57\52\x2d\52\57\x20\x3d\40\57\x2a\55\52\57\40\x27\x64\x65\146\141\165\x6c\164\x20\166\141\154\165\145\x27\40\x2e\40\x2f\x2a\55\x2a\57\40\47\163\145\143\x6f\156\144\x20\160\141\x72\164\x27\x20\x2f\57\40\x54\162\x61\151\154\151\156\x67\40\x63\157\155\x6d\x65\156\x74\x2e", "\x68\x61\x73\x5f\141\164\x74\162\151\x62\165\164\145\x73" => false, "\x70\141\x73\x73\137\x62\x79\137\162\x65\146\x65\x72\x65\x6e\143\x65" => true, "\166\141\x72\151\x61\x62\154\x65\137\x6c\145\x6e\147\x74\x68" => true, "\164\x79\160\x65\137\x68\151\x6e\x74" => "\77\x4d\171\x43\x6c\x61\x73\x73", "\x6e\x75\x6c\154\141\x62\154\145\137\164\x79\160\x65" => true); $this->getMethodParametersTestHelper("\57\x2a\x20" . __FUNCTION__ . "\40\x2a\x2f", $expected); } public function testParameterAttributesInFunctionDeclaration() { $expected = array(); $expected[0] = array("\x6e\x61\155\x65" => "\44\x63\x6f\x6e\x73\x74\x72\165\x63\x74\x6f\162\120\162\157\160\x50\x72\x6f\155\124\171\x70\x65\x64\120\141\x72\141\x6d\x53\x69\156\147\x6c\145\x41\x74\164\x72\x69\142\165\164\x65", "\143\157\156\164\x65\156\x74" => "\x23\133\134\x4d\171\x45\x78\141\155\160\x6c\x65\134\x4d\171\x41\x74\164\x72\x69\x62\x75\164\145\135\40\x70\x72\x69\166\x61\x74\145\40\163\x74\x72\x69\156\147\40\x24\x63\x6f\156\163\164\x72\165\x63\x74\157\x72\x50\162\x6f\x70\x50\x72\157\x6d\124\171\x70\x65\x64\x50\x61\162\x61\155\123\x69\156\147\x6c\145\x41\164\x74\162\x69\x62\x75\164\x65", "\150\141\x73\137\x61\164\164\162\x69\142\165\x74\x65\163" => true, "\x70\x61\x73\163\137\x62\171\137\x72\x65\x66\x65\x72\145\x6e\x63\x65" => false, "\166\x61\162\x69\x61\142\154\x65\137\154\x65\156\147\164\150" => false, "\164\171\160\x65\x5f\150\x69\156\x74" => "\163\164\162\151\156\x67", "\x6e\165\x6c\x6c\x61\142\x6c\x65\137\164\x79\160\145" => false, "\x70\x72\157\x70\145\162\164\x79\137\166\151\163\x69\142\x69\x6c\151\x74\171" => "\x70\x72\151\166\141\164\145"); $expected[1] = array("\x6e\141\155\145" => "\x24\x74\171\160\145\x64\x50\141\x72\x61\155\x53\151\x6e\x67\154\145\101\164\x74\x72\x69\x62\165\164\145", "\x63\157\156\x74\x65\156\x74" => "\x23\133\115\x79\101\164\164\162\x28\133\61\54\x20\x32\x5d\x29\135\12\40\40\x20\x20\40\40\40\40\124\x79\160\145\x7c\146\x61\x6c\x73\x65\12\40\x20\40\40\x20\x20\40\40\x24\x74\171\160\x65\144\120\141\162\141\x6d\123\151\156\x67\x6c\x65\x41\x74\164\x72\x69\x62\x75\164\x65", "\x68\x61\x73\x5f\141\164\x74\x72\151\142\x75\x74\145\163" => true, "\x70\141\163\x73\x5f\142\x79\137\x72\x65\x66\145\162\145\156\143\x65" => false, "\x76\141\x72\151\141\142\154\x65\x5f\x6c\145\156\x67\x74\x68" => false, "\164\171\x70\145\x5f\150\x69\x6e\x74" => "\124\171\x70\145\x7c\146\141\154\163\x65", "\x6e\165\x6c\x6c\x61\x62\x6c\145\137\164\171\x70\145" => false); $expected[2] = array("\156\141\x6d\145" => "\44\156\x75\x6c\154\141\x62\154\145\x54\x79\160\145\144\x50\x61\162\141\155\115\165\x6c\x74\151\x41\x74\x74\x72\x69\x62\165\164\145", "\x63\x6f\x6e\164\145\156\164" => "\43\133\x4d\171\x41\164\164\162\x69\142\165\x74\x65\x28\61\x32\x33\x34\51\x2c\x20\115\171\x41\x74\164\x72\x69\x62\x75\x74\x65\x28\x35\x36\67\x38\51\x5d\40\77\x69\156\164\40\44\156\165\154\x6c\141\x62\154\145\x54\x79\x70\145\x64\x50\141\x72\x61\x6d\115\x75\x6c\164\151\101\x74\164\162\x69\142\165\x74\x65", "\150\141\163\137\x61\164\164\x72\x69\142\x75\164\145\163" => true, "\x70\141\163\x73\x5f\142\171\x5f\x72\145\146\145\162\145\156\143\145" => false, "\166\141\162\x69\141\142\x6c\145\137\x6c\x65\156\147\164\x68" => false, "\x74\171\x70\x65\137\x68\151\156\x74" => "\x3f\151\x6e\164", "\156\165\x6c\x6c\141\x62\x6c\145\137\164\171\160\145" => true); $expected[3] = array("\156\x61\x6d\x65" => "\44\x6e\157\x6e\x54\x79\x70\145\144\120\x61\x72\141\155\x54\167\157\x41\164\x74\x72\x69\x62\165\x74\145\163", "\x63\157\156\x74\x65\x6e\x74" => "\x23\x5b\127\x69\164\150\x6f\x75\x74\x41\x72\x67\165\x6d\145\156\x74\135\40\x23\133\x53\x69\156\x67\x6c\145\101\x72\147\165\155\145\156\164\x28\60\51\135\x20\x24\x6e\x6f\156\x54\x79\x70\x65\x64\120\141\162\141\x6d\124\x77\157\x41\164\x74\x72\x69\x62\165\164\x65\163", "\150\x61\x73\137\x61\164\x74\x72\x69\x62\x75\x74\145\x73" => true, "\160\141\x73\x73\x5f\x62\x79\137\x72\x65\x66\x65\x72\x65\156\x63\145" => false, "\166\x61\x72\151\x61\x62\x6c\x65\x5f\154\x65\x6e\x67\x74\x68" => false, "\164\171\160\x65\137\x68\151\156\x74" => '', "\156\x75\154\x6c\x61\142\x6c\x65\x5f\x74\171\160\x65" => false); $expected[4] = array("\x6e\141\x6d\145" => "\44\157\x74\x68\145\162\120\x61\x72\141\155", "\x63\157\x6e\x74\145\x6e\x74" => "\43\x5b\115\171\x41\x74\164\162\151\142\x75\164\145\x28\141\162\162\141\x79\x28\42\153\x65\x79\x22\40\x3d\76\40\42\166\x61\x6c\165\145\42\x29\51\x5d\xa\40\x20\x20\40\x20\40\40\x20\x26\x2e\56\56\44\x6f\164\150\145\x72\x50\141\x72\141\155", "\150\x61\x73\137\x61\164\x74\162\x69\x62\x75\164\145\163" => true, "\x70\x61\x73\x73\137\142\171\137\x72\x65\x66\145\x72\x65\x6e\143\145" => true, "\166\141\x72\151\141\142\x6c\145\137\x6c\145\156\x67\164\150" => true, "\164\x79\160\x65\137\150\x69\156\164" => '', "\x6e\x75\154\154\141\x62\154\x65\137\x74\x79\x70\145" => false); $this->getMethodParametersTestHelper("\57\52\40" . __FUNCTION__ . "\x20\52\57", $expected); } public function testPHP8IntersectionTypes() { $expected = array(); $expected[0] = array("\x6e\x61\155\145" => "\44\157\x62\x6a\61", "\x63\157\156\x74\145\156\x74" => "\106\157\x6f\46\102\x61\162\40\x24\157\x62\152\x31", "\x68\x61\x73\x5f\141\x74\164\162\151\x62\165\164\x65\x73" => false, "\160\141\x73\163\x5f\x62\x79\137\162\145\x66\145\162\145\156\143\x65" => false, "\x76\141\x72\x69\x61\142\x6c\145\x5f\x6c\145\x6e\147\164\x68" => false, "\164\x79\160\x65\137\150\x69\156\164" => "\x46\x6f\157\46\x42\141\x72", "\x6e\x75\154\154\141\x62\154\145\x5f\164\x79\160\145" => false); $expected[1] = array("\x6e\141\x6d\145" => "\44\157\x62\152\x32", "\143\x6f\156\164\x65\x6e\164" => "\x42\x6f\157\x26\102\141\162\x20\44\157\x62\152\x32", "\150\141\x73\x5f\x61\x74\x74\162\x69\142\165\x74\145\163" => false, "\x70\x61\163\163\137\x62\x79\x5f\x72\x65\x66\145\162\x65\x6e\143\145" => false, "\x76\x61\x72\x69\141\142\x6c\x65\137\x6c\x65\x6e\x67\164\x68" => false, "\x74\171\160\x65\x5f\150\151\x6e\164" => "\x42\157\x6f\x26\102\141\x72", "\156\165\154\154\141\x62\x6c\x65\137\164\x79\x70\x65" => false); $this->getMethodParametersTestHelper("\x2f\52\40" . __FUNCTION__ . "\40\x2a\57", $expected); } public function testPHP81IntersectionTypesWithSpreadOperatorAndReference() { $expected = array(); $expected[0] = array("\156\x61\x6d\x65" => "\44\160\x61\x72\x61\155\x41", "\x63\x6f\x6e\x74\145\156\x74" => "\x42\x6f\x6f\46\x42\141\x72\40\46\44\x70\x61\x72\x61\155\101", "\x68\141\163\137\x61\164\164\162\x69\142\165\164\x65\x73" => false, "\x70\x61\163\x73\137\x62\171\137\x72\145\x66\x65\162\145\x6e\x63\x65" => true, "\166\x61\162\151\141\142\x6c\145\137\154\145\156\x67\x74\150" => false, "\164\171\160\145\x5f\x68\151\x6e\164" => "\102\157\157\46\102\141\162", "\156\165\154\154\141\142\x6c\145\x5f\x74\x79\160\x65" => false); $expected[1] = array("\156\141\155\145" => "\44\160\x61\162\x61\x6d\x42", "\143\157\156\x74\145\156\164" => "\x46\x6f\x6f\46\x42\x61\162\x20\x2e\x2e\x2e\44\160\x61\x72\141\x6d\x42", "\x68\141\x73\x5f\x61\x74\164\162\151\142\165\164\x65\x73" => false, "\x70\x61\163\163\x5f\142\x79\x5f\162\x65\146\145\162\x65\x6e\x63\145" => false, "\166\141\x72\x69\x61\142\x6c\145\x5f\x6c\x65\x6e\x67\x74\150" => true, "\x74\x79\x70\x65\x5f\x68\x69\x6e\x74" => "\x46\157\157\x26\102\141\x72", "\156\165\x6c\x6c\141\142\x6c\x65\137\x74\x79\160\145" => false); $this->getMethodParametersTestHelper("\57\52\40" . __FUNCTION__ . "\x20\x2a\57", $expected); } public function testPHP81MoreIntersectionTypes() { $expected = array(); $expected[0] = array("\x6e\x61\155\145" => "\x24\166\x61\x72", "\143\x6f\156\164\x65\x6e\164" => "\x4d\x79\x43\154\x61\x73\x73\101\46\x5c\x50\141\x63\153\x61\x67\145\x5c\115\171\103\154\141\163\163\x42\x26\134\x50\141\143\x6b\x61\147\x65\134\115\x79\x43\154\x61\163\x73\103\x20\44\166\x61\162", "\x68\141\163\x5f\141\164\x74\162\151\142\165\164\145\163" => false, "\x70\x61\x73\163\137\142\x79\x5f\162\x65\x66\x65\x72\x65\x6e\143\x65" => false, "\x76\141\x72\151\141\x62\x6c\x65\137\x6c\145\156\x67\x74\x68" => false, "\164\x79\x70\145\137\x68\x69\156\x74" => "\115\x79\103\x6c\141\x73\x73\x41\46\x5c\120\141\x63\x6b\x61\147\145\x5c\115\x79\x43\x6c\141\163\163\x42\x26\134\x50\141\143\x6b\141\147\145\x5c\x4d\x79\x43\x6c\x61\163\x73\x43", "\156\x75\154\x6c\x61\142\154\x65\137\164\171\160\x65" => false); $this->getMethodParametersTestHelper("\x2f\x2a\x20" . __FUNCTION__ . "\40\52\x2f", $expected); } public function testPHP81IllegalIntersectionTypes() { $expected = array(); $expected[0] = array("\x6e\x61\155\x65" => "\44\156\165\155\x65\162\151\x63\137\163\164\162\x69\x6e\x67", "\143\x6f\156\x74\145\156\164" => "\163\x74\x72\151\156\147\x26\151\156\164\40\x24\x6e\x75\x6d\145\x72\151\143\x5f\x73\164\162\x69\156\x67", "\x68\x61\x73\137\141\x74\164\x72\151\142\165\x74\x65\163" => false, "\x70\x61\163\163\x5f\x62\171\x5f\162\x65\146\145\162\x65\x6e\x63\145" => false, "\x76\x61\x72\151\x61\142\x6c\145\137\x6c\x65\x6e\147\164\x68" => false, "\x74\171\x70\x65\x5f\150\151\x6e\164" => "\163\164\162\151\x6e\147\46\x69\156\x74", "\x6e\x75\154\x6c\141\142\154\x65\137\x74\171\x70\145" => false); $this->getMethodParametersTestHelper("\57\52\40" . __FUNCTION__ . "\40\x2a\57", $expected); } public function testPHP81NullableIntersectionTypes() { $expected = array(); $expected[0] = array("\x6e\141\155\145" => "\x24\x6f\x62\x6a\145\143\164", "\x63\157\156\164\x65\x6e\x74" => "\77\x46\x6f\157\46\x42\x61\x72\40\44\157\142\x6a\x65\143\164", "\x68\141\163\137\x61\x74\164\x72\151\142\x75\164\145\x73" => false, "\160\141\x73\x73\137\142\x79\x5f\162\x65\x66\145\162\145\156\x63\x65" => false, "\166\141\x72\151\141\142\x6c\x65\137\x6c\145\x6e\147\x74\150" => false, "\x74\x79\x70\x65\x5f\x68\151\x6e\164" => "\x3f\x46\157\157\x26\x42\x61\x72", "\x6e\x75\154\154\141\142\154\x65\137\164\x79\x70\x65" => true); $this->getMethodParametersTestHelper("\57\x2a\40" . __FUNCTION__ . "\40\x2a\x2f", $expected); } private function getMethodParametersTestHelper($commentString, $expected) { $function = $this->getTargetToken($commentString, array(T_FUNCTION, T_CLOSURE, T_FN)); $found = self::$phpcsFile->getMethodParameters($function); $this->assertArraySubset($expected, $found, true); } }

Function Calls

None

Variables

None

Stats

MD5 9d32a479f59aa8d83447e7da3ab7b7ef
Eval Count 0
Decode Time 195 ms