@@ -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) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | // if we get here, then we just return the PHP scalar type |
101 | - return [ $type => $type ]; |
|
101 | + return [$type => $type]; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $retval = array_merge( |
116 | 116 | array_slice(GetArrayTypes::from($item), 0, -1), |
117 | 117 | self::$arrayExtras, |
118 | - [ 'array' => 'array' ] |
|
118 | + ['array' => 'array'] |
|
119 | 119 | ); |
120 | 120 | |
121 | 121 | // all done |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $retval = array_merge( |
138 | 138 | GetObjectTypes::from($item), |
139 | 139 | self::getObjectSpecialTypes($item), |
140 | - [ 'object' => 'object' ] |
|
140 | + ['object' => 'object'] |
|
141 | 141 | ); |
142 | 142 | |
143 | 143 | return $retval; |
@@ -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 | } |