@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** @var CounterValuesInterface $report */ |
| 33 | 33 | return |
| 34 | 34 | sprintf( |
| 35 | - self::COUNTER . ': %s%s', |
|
| 35 | + self::COUNTER.': %s%s', |
|
| 36 | 36 | (string)$report->getValue(), |
| 37 | 37 | $eol ? PHP_EOL : '' |
| 38 | 38 | ); |
@@ -47,15 +47,15 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | return |
| 49 | 49 | sprintf( |
| 50 | - self::COUNTER . '[%s]: ' . |
|
| 51 | - self::VALUE . ': %s, ' . |
|
| 52 | - self::STEP . ': %s, ' . |
|
| 53 | - self::BUMPED . ': %s, ' . |
|
| 54 | - self::PATH . ': %s, ' . |
|
| 55 | - self::LENGTH . ': %s, ' . |
|
| 56 | - self::MAX . ': %s, ' . |
|
| 57 | - self::MIN . ': %s, ' . |
|
| 58 | - self::DIFF . ': %s %s', |
|
| 50 | + self::COUNTER.'[%s]: '. |
|
| 51 | + self::VALUE.': %s, '. |
|
| 52 | + self::STEP.': %s, '. |
|
| 53 | + self::BUMPED.': %s, '. |
|
| 54 | + self::PATH.': %s, '. |
|
| 55 | + self::LENGTH.': %s, '. |
|
| 56 | + self::MAX.': %s, '. |
|
| 57 | + self::MIN.': %s, '. |
|
| 58 | + self::DIFF.': %s %s', |
|
| 59 | 59 | $report->getName(), |
| 60 | 60 | (string)$report->getValue(), |
| 61 | 61 | (string)$report->getStep(), |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | return |
| 79 | 79 | sprintf( |
| 80 | - self::FORWARD . '%s ' . self::BACKWARD . '%s', |
|
| 80 | + self::FORWARD.'%s '.self::BACKWARD.'%s', |
|
| 81 | 81 | $report->getBumped(), |
| 82 | 82 | $report->getBumpedBack() |
| 83 | 83 | ); |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | public function check(?int $iterationNumber = null): self |
| 68 | 68 | { |
| 69 | 69 | if ($this->isStopped()) { |
| 70 | - throw new \RuntimeException('Timer[' . $this->name . '] is already stopped.'); |
|
| 70 | + throw new \RuntimeException('Timer['.$this->name.'] is already stopped.'); |
|
| 71 | 71 | } |
| 72 | 72 | if ($this->isNotStarted()) { |
| 73 | 73 | $this->start(); |
@@ -4,4 +4,4 @@ |
||
| 4 | 4 | |
| 5 | 5 | // @codeCoverageIgnoreStart |
| 6 | 6 | /** @internal */ |
| 7 | -define(__NAMESPACE__ .'\HRTIMER_VALUE_COEFFICIENT', 1E9); |
|
| 7 | +define(__NAMESPACE__.'\HRTIMER_VALUE_COEFFICIENT', 1E9); |
|
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | protected function wrongReportable(string $expected, ReportableInterface $reportable): void |
| 28 | 28 | { |
| 29 | 29 | throw new \RuntimeException( |
| 30 | - 'Instance of [' . $expected . '] expected, [' . typeOf($reportable) . '] given' |
|
| 30 | + 'Instance of ['.$expected.'] expected, ['.typeOf($reportable).'] given' |
|
| 31 | 31 | ); |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | return |
| 38 | 38 | sprintf( |
| 39 | - self::ELAPSED . ': %s %s', |
|
| 39 | + self::ELAPSED.': %s %s', |
|
| 40 | 40 | $this->refineElapsed($report->getElapsed()), |
| 41 | 41 | $eol ? PHP_EOL : '' |
| 42 | 42 | ); |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | $values = |
| 74 | 74 | 0 < $count ? |
| 75 | 75 | sprintf( |
| 76 | - self::AVERAGE . ': %s, ' . |
|
| 77 | - self::LAST . ': %s, ' . |
|
| 78 | - self::MIN . '(%s): %s, ' . |
|
| 79 | - self::MAX . '(%s): %s, ' . |
|
| 80 | - self::MARKS . ': %s, ', |
|
| 76 | + self::AVERAGE.': %s, '. |
|
| 77 | + self::LAST.': %s, '. |
|
| 78 | + self::MIN.'(%s): %s, '. |
|
| 79 | + self::MAX.'(%s): %s, '. |
|
| 80 | + self::MARKS.': %s, ', |
|
| 81 | 81 | $this->refineSeconds($r->getAverageValue()), |
| 82 | 82 | $this->refineSeconds($r->getLastValue()), |
| 83 | 83 | $r->getMinValueIteration(), |
@@ -85,13 +85,12 @@ discard block |
||
| 85 | 85 | $r->getMaxValueIteration(), |
| 86 | 86 | $this->refineSeconds($r->getMaxValue()), |
| 87 | 87 | $count |
| 88 | - ) : |
|
| 89 | - ''; |
|
| 88 | + ) : ''; |
|
| 90 | 89 | |
| 91 | 90 | return |
| 92 | 91 | sprintf( |
| 93 | - self::TIMER . '%s: %s' . |
|
| 94 | - self::ELAPSED . ': %s%s', |
|
| 92 | + self::TIMER.'%s: %s'. |
|
| 93 | + self::ELAPSED.': %s%s', |
|
| 95 | 94 | $this->refineName($r->getName()), |
| 96 | 95 | $values, |
| 97 | 96 | $this->refineElapsed($r->getElapsed()), |
@@ -110,6 +109,6 @@ discard block |
||
| 110 | 109 | if (DEFAULT_NAME === $name) { |
| 111 | 110 | return ''; |
| 112 | 111 | } |
| 113 | - return '[' . $name . ']'; |
|
| 112 | + return '['.$name.']'; |
|
| 114 | 113 | } |
| 115 | 114 | } |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | protected function build(BenchmarkReport $report): string |
| 46 | 46 | { |
| 47 | 47 | $this->report = $report; |
| 48 | - $str = static::RESULTS . PHP_EOL; |
|
| 48 | + $str = static::RESULTS.PHP_EOL; |
|
| 49 | 49 | $this->computeVariables(); |
| 50 | 50 | if ($this->benchmarkedAny) { |
| 51 | - $str .= static::BENCHMARK . PHP_EOL; |
|
| 51 | + $str .= static::BENCHMARK.PHP_EOL; |
|
| 52 | 52 | } |
| 53 | 53 | /** @var BenchmarkFunction $function */ |
| 54 | 54 | foreach ($report->getFunctions() as $name => $function) { |
@@ -120,8 +120,7 @@ discard block |
||
| 120 | 120 | '%s%s%s', |
| 121 | 121 | $aRAE, |
| 122 | 122 | $this->benchmarkedMoreThanOne && $this->report->isShowReturns() ? |
| 123 | - ':' . PHP_EOL . BenchmarkFunctionFormatter::returnToString($this->lastReturn) : |
|
| 124 | - $dLM, |
|
| 123 | + ':'.PHP_EOL.BenchmarkFunctionFormatter::returnToString($this->lastReturn) : $dLM, |
|
| 125 | 124 | PHP_EOL |
| 126 | 125 | ); |
| 127 | 126 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** @var CounterValuesInterface $report */ |
| 36 | 36 | return |
| 37 | 37 | sprintf( |
| 38 | - self::COUNTER . ': %s%s', |
|
| 38 | + self::COUNTER.': %s%s', |
|
| 39 | 39 | (string)$report->getValue(), |
| 40 | 40 | $eol ? PHP_EOL : '' |
| 41 | 41 | ); |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | return |
| 52 | 52 | sprintf( |
| 53 | - self::COUNTER . '[%s]: ' . |
|
| 54 | - self::VALUE . ': %s, ' . |
|
| 55 | - self::STEP . ': %s, ' . |
|
| 56 | - self::BUMPED . ': %s%s', |
|
| 53 | + self::COUNTER.'[%s]: '. |
|
| 54 | + self::VALUE.': %s, '. |
|
| 55 | + self::STEP.': %s, '. |
|
| 56 | + self::BUMPED.': %s%s', |
|
| 57 | 57 | $report->getName(), |
| 58 | 58 | (string)$report->getValue(), |
| 59 | 59 | (string)$report->getStep(), |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | return |
| 72 | 72 | sprintf( |
| 73 | - self::FORWARD . '%s ', |
|
| 73 | + self::FORWARD.'%s ', |
|
| 74 | 74 | $report->getBumped() |
| 75 | 75 | ); |
| 76 | 76 | } |
@@ -18,13 +18,13 @@ |
||
| 18 | 18 | $this->progressBarWidth = $this->advanceSteps = $progressBarWidth ?? $this->advanceSteps; |
| 19 | 19 | |
| 20 | 20 | $progressAdvance = |
| 21 | - function (): void { |
|
| 21 | + function(): void { |
|
| 22 | 22 | echo '*'; |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | $progressFinish = |
| 26 | - function (): void { |
|
| 27 | - echo "\e[" . $this->progressBarWidth . 'D'; |
|
| 26 | + function(): void { |
|
| 27 | + echo "\e[".$this->progressBarWidth.'D'; |
|
| 28 | 28 | echo "\e[K"; |
| 29 | 29 | }; |
| 30 | 30 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | protected function wrongFormattableType(string $expected, Formattable $formattable): void |
| 21 | 21 | { |
| 22 | 22 | throw new \RuntimeException( |
| 23 | - 'Instance of [' . $expected . '] expected, [' . typeOf($formattable) . '] given.' |
|
| 23 | + 'Instance of ['.$expected.'] expected, ['.typeOf($formattable).'] given.' |
|
| 24 | 24 | ); |
| 25 | 25 | } |
| 26 | 26 | } |