|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -namespace Go\ParserReflection\Stub; |
4 |
| - |
5 |
| -use Go\ParserReflection\ReflectionParameter; |
6 |
| - |
7 |
| -const TEST_PARAMETER = 42; |
8 |
| - |
9 |
| -function noParameters() {} |
10 |
| -function singleParameter($test) {} |
11 |
| -function miscParameters( |
12 |
| - array $arrayParam, |
13 |
| - array $arrayParamWithDefault = array(1,2,3), |
14 |
| - array $arrayNullable = null, |
15 |
| - callable $callableParam, |
16 |
| - callable $callableNullable = null, |
17 |
| - \stdClass $objectParam, |
18 |
| - \stdClass $objectNullable = null, |
19 |
| - ReflectionParameter $typehintedParamWithNs, |
20 |
| - &$byReferenceParam, |
21 |
| - &$byReferenceNullable = __CLASS__, |
22 |
| - $constParam = TEST_PARAMETER, |
23 |
| - $constValueParam = __NAMESPACE__, // This line is long and should be truncated |
24 |
| - \Traversable $traversable |
25 |
| -) {} |
26 |
| - |
27 |
| -class Foo { |
28 |
| - const CLASS_CONST = __CLASS__; |
29 |
| - |
30 |
| - public function methodParam($firstParam, $optionalParam = null) {} |
31 |
| - public function methodParamConst($firstParam = self::CLASS_CONST, $another = __CLASS__, $ns = TEST_PARAMETER) {} |
| 3 | +namespace { |
| 4 | + function testResolveDefaults($a = null, $b = false, $c = true) |
| 5 | + { |
| 6 | + } |
| 7 | + |
| 8 | + class TestParametersForRootNsClass |
| 9 | + { |
| 10 | + public function foo($a = null, $b = false, $c = true) |
| 11 | + { |
| 12 | + } |
| 13 | + } |
32 | 14 | }
|
33 | 15 |
|
34 |
| -class SubFoo extends Foo { |
35 |
| - public function anotherMethodParam(self $selfParam, parent $parentParam) {} |
| 16 | +namespace Go\ParserReflection\Stub { |
| 17 | + |
| 18 | + use Go\ParserReflection\ReflectionParameter; |
| 19 | + |
| 20 | + const TEST_PARAMETER = 42; |
| 21 | + |
| 22 | + function noParameters() |
| 23 | + { |
| 24 | + } |
| 25 | + |
| 26 | + function singleParameter($test) |
| 27 | + { |
| 28 | + } |
| 29 | + |
| 30 | + function miscParameters( |
| 31 | + array $arrayParam, |
| 32 | + array $arrayParamWithDefault = array(1, 2, 3), |
| 33 | + array $arrayNullable = null, |
| 34 | + callable $callableParam, |
| 35 | + callable $callableNullable = null, |
| 36 | + \stdClass $objectParam, |
| 37 | + \stdClass $objectNullable = null, |
| 38 | + ReflectionParameter $typehintedParamWithNs, |
| 39 | + &$byReferenceParam, |
| 40 | + &$byReferenceNullable = __CLASS__, |
| 41 | + $constParam = TEST_PARAMETER, |
| 42 | + $constValueParam = __NAMESPACE__, // This line is long and should be truncated |
| 43 | + \Traversable $traversable |
| 44 | + ) { |
| 45 | + } |
| 46 | + |
| 47 | + class Foo |
| 48 | + { |
| 49 | + const CLASS_CONST = __CLASS__; |
| 50 | + |
| 51 | + public function methodParam($firstParam, $optionalParam = null) |
| 52 | + { |
| 53 | + } |
| 54 | + |
| 55 | + public function methodParamConst($firstParam = self::CLASS_CONST, $another = __CLASS__, $ns = TEST_PARAMETER) |
| 56 | + { |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + class SubFoo extends Foo |
| 61 | + { |
| 62 | + public function anotherMethodParam(self $selfParam, parent $parentParam) |
| 63 | + { |
| 64 | + } |
| 65 | + } |
36 | 66 | }
|
0 commit comments