@@ -24,4 +24,6 @@ |
||
| 24 | 24 | if ($nameResultPair[$testName] !== $text) { |
| 25 | 25 | var_dump('EXPECTED', $nameResultPair[$testName]); |
| 26 | 26 | var_dump('RECEIVED', $text); |
| 27 | -} else echo 'WRITE OK !!!'; |
|
| 27 | +} else { |
|
| 28 | + echo 'WRITE OK !!!'; |
|
| 29 | +} |
|
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function __construct(int $options = null) |
| 27 | 27 | { |
| 28 | - if (is_int($options)) $this->options = $options; |
|
| 28 | + if (is_int($options)) { |
|
| 29 | + $this->options = $options; |
|
| 30 | + } |
|
| 29 | 31 | } |
| 30 | 32 | |
| 31 | 33 | |
@@ -45,8 +47,12 @@ discard block |
||
| 45 | 47 | |
| 46 | 48 | public function dumpScalar($dataType, $indent):string |
| 47 | 49 | { |
| 48 | - if ($dataType === \INF) return '.inf'; |
|
| 49 | - if ($dataType === -\INF) return '-.inf'; |
|
| 50 | + if ($dataType === \INF) { |
|
| 51 | + return '.inf'; |
|
| 52 | + } |
|
| 53 | + if ($dataType === -\INF) { |
|
| 54 | + return '-.inf'; |
|
| 55 | + } |
|
| 50 | 56 | $precision = "%.".$this->floatPrecision."F"; |
| 51 | 57 | switch (gettype($dataType)) { |
| 52 | 58 | case 'boolean': return $dataType ? 'true' : 'false'; |
@@ -84,9 +90,13 @@ discard block |
||
| 84 | 90 | // $mask = '%s:'; |
| 85 | 91 | } elseif (is_object($compound)) { |
| 86 | 92 | //var_dump("SPECIAL"); |
| 87 | - if ($compound instanceof Tagged) return $this->dumpTagged($compound, $indent); |
|
| 93 | + if ($compound instanceof Tagged) { |
|
| 94 | + return $this->dumpTagged($compound, $indent); |
|
| 95 | + } |
|
| 88 | 96 | //TODO: consider dumping datetime as date strings according to a format provided by user |
| 89 | - if ($compound instanceof \DateTime) return $compound->format(self::DATE_FORMAT); |
|
| 97 | + if ($compound instanceof \DateTime) { |
|
| 98 | + return $compound->format(self::DATE_FORMAT); |
|
| 99 | + } |
|
| 90 | 100 | // $iterator = new \ArrayIterator($compound); |
| 91 | 101 | $iterator = new \ArrayIterator(get_object_vars($compound)); |
| 92 | 102 | } |