@@ -99,7 +99,7 @@ |
||
99 | 99 | // in case a named parameter appears multiple times in the format string |
100 | 100 | if ($paramKeys[$paramName] === -1) { |
101 | 101 | // no - it needs a home |
102 | - $messageData[$nextData] =& $args[$paramName]; |
|
102 | + $messageData[$nextData] = & $args[$paramName]; |
|
103 | 103 | $paramKeys[$paramName] = $nextData; |
104 | 104 | $nextData++; |
105 | 105 | } |
@@ -127,7 +127,7 @@ |
||
127 | 127 | } |
128 | 128 | |
129 | 129 | // $data contains an <object, method> pair |
130 | - return "callable<" . get_class($data[0]). "::" . $data[1] . ">"; |
|
130 | + return "callable<" . get_class($data[0]) . "::" . $data[1] . ">"; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -91,8 +91,6 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * get the list of extra types that are valid for this specific object |
93 | 93 | * |
94 | - * @param object $object |
|
95 | - * the object to examine |
|
96 | 94 | * @return string[] |
97 | 95 | * a (possibly empty) list of types for this object |
98 | 96 | */ |
@@ -104,8 +102,6 @@ discard block |
||
104 | 102 | /** |
105 | 103 | * what PHP type is $data? |
106 | 104 | * |
107 | - * @param mixed $data |
|
108 | - * the data to examine |
|
109 | 105 | * @param int $flags |
110 | 106 | * options to change what we put in the return value |
111 | 107 | * @return string |
@@ -121,7 +117,7 @@ discard block |
||
121 | 117 | * |
122 | 118 | * @param mixed $item |
123 | 119 | * the item to examine |
124 | - * @return array |
|
120 | + * @return string[] |
|
125 | 121 | * the list of type(s) that this item can be |
126 | 122 | */ |
127 | 123 | function get_strict_types($item) |
@@ -12,9 +12,9 @@ |
||
12 | 12 | $varDump = ob_get_clean(); |
13 | 13 | |
14 | 14 | $output = '```php' . PHP_EOL |
15 | - . $code . PHP_EOL . PHP_EOL |
|
16 | - . "// outputs" . PHP_EOL |
|
17 | - . "//" . PHP_EOL; |
|
15 | + . $code . PHP_EOL . PHP_EOL |
|
16 | + . "// outputs" . PHP_EOL |
|
17 | + . "//" . PHP_EOL; |
|
18 | 18 | |
19 | 19 | foreach (explode("\n", trim($varDump)) as $line) { |
20 | 20 | $output .= "// {$line}" . PHP_EOL; |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $retval = eval($code); |
34 | 34 | |
35 | 35 | // all done |
36 | - return [ $retval, $output ]; |
|
36 | + return [$retval, $output]; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | function typeinspector_run_dataset($inspectorName, $failureTypes) |
@@ -42,8 +42,7 @@ |
||
42 | 42 | |
43 | 43 | $successList = $failureList = []; |
44 | 44 | |
45 | - foreach ($dataSet as $dataItem) |
|
46 | - { |
|
45 | + foreach ($dataSet as $dataItem) { |
|
47 | 46 | $failed = false; |
48 | 47 | list($retval, $output) = typeinspector_run_dataitem($inspectorName, $dataItem); |
49 | 48 | foreach ($failureTypes as $failureType) { |
@@ -118,14 +118,14 @@ |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | // if we get here, then $item will coerce to a PHP numeric type :) |
121 | - return [ $retval => $retval ]; |
|
121 | + return [$retval => $retval]; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | private static function fromObject($item) |
125 | 125 | { |
126 | 126 | // does this object support being converted to a string? |
127 | 127 | if (method_exists($item, '__toString')) { |
128 | - return [ 'string' => 'string' ]; |
|
128 | + return ['string' => 'string']; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | // no, it does not |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | class GetStrictTypes |
50 | 50 | { |
51 | 51 | private static $dispatchMap = [ |
52 | - 'array' => [ GetArrayTypes::class, 'from' ], |
|
53 | - 'object' => [ GetObjectTypes::class, 'from' ], |
|
54 | - 'string' => [ GetStringTypes::class, 'from' ], |
|
52 | + 'array' => [GetArrayTypes::class, 'from'], |
|
53 | + 'object' => [GetObjectTypes::class, 'from'], |
|
54 | + 'string' => [GetStringTypes::class, 'from'], |
|
55 | 55 | ]; |
56 | 56 | |
57 | 57 | /** |
@@ -84,6 +84,6 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | // if we get here, then we just return the PHP scalar type |
87 | - return [ $type => $type ]; |
|
87 | + return [$type => $type]; |
|
88 | 88 | } |
89 | 89 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @param array $filterList |
50 | 50 | * a list of namespaces and classes to skip over |
51 | - * @return StackFrame |
|
51 | + * @return GanbaroDigital\MissingBits\TraceInspectors\StackFrame |
|
52 | 52 | */ |
53 | 53 | function get_caller(array $filterList = []) |
54 | 54 | { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * the debug_backtrace() return value |
70 | 70 | * @param array $filterList |
71 | 71 | * a list of namespaces and classes to skip over |
72 | - * @return StackFrame |
|
72 | + * @return GanbaroDigital\MissingBits\TraceInspectors\StackFrame |
|
73 | 73 | */ |
74 | 74 | function get_caller_from_trace(array $backtrace, array $filterList = []) |
75 | 75 | { |
@@ -43,13 +43,13 @@ |
||
43 | 43 | |
44 | 44 | use GanbaroDigital\MissingBits\TraceInspectors\GetCaller; |
45 | 45 | |
46 | - /** |
|
47 | - * work out who has called a piece of code |
|
48 | - * |
|
49 | - * @param array $filterList |
|
50 | - * a list of namespaces and classes to skip over |
|
51 | - * @return StackFrame |
|
52 | - */ |
|
46 | + /** |
|
47 | + * work out who has called a piece of code |
|
48 | + * |
|
49 | + * @param array $filterList |
|
50 | + * a list of namespaces and classes to skip over |
|
51 | + * @return StackFrame |
|
52 | + */ |
|
53 | 53 | function get_caller(array $filterList = []) |
54 | 54 | { |
55 | 55 | // we supply the trace |
@@ -88,7 +88,7 @@ |
||
88 | 88 | |
89 | 89 | // PHP's stack trace is a little esoteric. To find all the details about |
90 | 90 | // a caller, we have to combine information from two stack frames. |
91 | - $prevFrame = $backtrace[max($index - 1,0)]; |
|
91 | + $prevFrame = $backtrace[max($index - 1, 0)]; |
|
92 | 92 | |
93 | 93 | // find the first backtrace entry that passes our filters |
94 | 94 | for ($i = $index; $i <= $maxIndex; $i++) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | // if we get here, then we just return the PHP scalar type |
94 | - return [ $type => $type ]; |
|
94 | + return [$type => $type]; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $retval = array_merge( |
131 | 131 | GetObjectTypes::from($item), |
132 | 132 | self::getObjectSpecialTypes($item), |
133 | - [ 'object' => 'object' ] |
|
133 | + ['object' => 'object'] |
|
134 | 134 | ); |
135 | 135 | |
136 | 136 | return $retval; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | * |
60 | 60 | * @param mixed $item |
61 | 61 | * the item to examine |
62 | - * @return array |
|
62 | + * @return string[] |
|
63 | 63 | * the list of type(s) that this item can be |
64 | 64 | */ |
65 | 65 | public function __invoke($item) |