@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @return string The PHP code corresponding to this call chain |
| 42 | 42 | */ |
| 43 | - public function toString(array $options=[]) |
|
| 43 | + public function toString(array $options = []) |
|
| 44 | 44 | { |
| 45 | 45 | $target = isset($options['target']) ? $options['target'] : $this->expectedTarget; |
| 46 | 46 | $max_param_length = isset($options['max_parameter_length']) ? $options['max_parameter_length'] : 56; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | foreach ($this->stack as $i => $call) { |
| 57 | 57 | if (isset($call['method'])) { |
| 58 | 58 | $string .= '->'; |
| 59 | - $string .= $call['method'].'('; |
|
| 59 | + $string .= $call['method'] . '('; |
|
| 60 | 60 | $string .= implode(', ', array_map(function($argument) use ($max_param_length, $short_objects) { |
| 61 | 61 | return static::varExport($argument, [ |
| 62 | 62 | 'short_objects' => $short_objects, |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | ]) . ']'; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (! empty($options['limit']) && $options['limit'] == $i) { |
|
| 75 | + if (!empty($options['limit']) && $options['limit'] == $i) { |
|
| 76 | 76 | break; |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | * @param array $options max_length | alias_instances |
| 88 | 88 | * @return string The PHP code of the variable |
| 89 | 89 | */ |
| 90 | - protected static function varExport($variable, array $options=[]) |
|
| 90 | + protected static function varExport($variable, array $options = []) |
|
| 91 | 91 | { |
| 92 | 92 | $options['max_length'] = isset($options['max_length']) ? $options['max_length'] : 56; |
| 93 | - $options['short_objects'] = (! empty($options['short_objects'])) || in_array('short_objects', $options); |
|
| 93 | + $options['short_objects'] = (!empty($options['short_objects'])) || in_array('short_objects', $options); |
|
| 94 | 94 | |
| 95 | 95 | $export = var_export($variable, true); |
| 96 | 96 | |
@@ -64,8 +64,7 @@ discard block |
||
| 64 | 64 | ]); |
| 65 | 65 | }, $call['arguments'])); |
| 66 | 66 | $string .= ')'; |
| 67 | - } |
|
| 68 | - else { |
|
| 67 | + } else { |
|
| 69 | 68 | $string .= '[' . static::varExport($call['entry'], [ |
| 70 | 69 | 'short_objects' => $short_objects, |
| 71 | 70 | 'max_length' => $max_param_length, |
@@ -105,8 +104,7 @@ discard block |
||
| 105 | 104 | if (is_object($variable)) { |
| 106 | 105 | // shortening short objects would only slow the workflow |
| 107 | 106 | $export = get_class($variable) . ' #' . spl_object_id($variable); |
| 108 | - } |
|
| 109 | - elseif (is_string($variable)) { |
|
| 107 | + } elseif (is_string($variable)) { |
|
| 110 | 108 | $keep_length = floor(($options['max_length'] - 5) / 2); |
| 111 | 109 | |
| 112 | 110 | $export = substr($variable, 0, (int) $keep_length) |