diff --git a/src/Benchmark.php b/src/Benchmark.php index 9385fbe..d97f9ab 100644 --- a/src/Benchmark.php +++ b/src/Benchmark.php @@ -36,9 +36,7 @@ public function __construct( protected DeviationService $deviation = new DeviationService, ) {} - /** - * Creates a new benchmark instance. - */ + /** Creates a new benchmark instance. */ public static function make(): static { return new static; @@ -178,9 +176,7 @@ public function toData(): array return $this->mapResult(); } - /** - * Outputs benchmark results to the console as a table. - */ + /** Outputs benchmark results to the console as a table. */ public function toConsole(): void { if (! $data = $this->toData()) { @@ -194,9 +190,7 @@ public function toConsole(): void ); } - /** - * Returns the assertion service for performing result checks. - */ + /** Returns the assertion service for performing result checks. */ public function toAssert(): AssertService { if (! $data = $this->toData()) { @@ -206,9 +200,7 @@ public function toAssert(): AssertService return new AssertService($data); } - /** - * Performs the benchmark: simple comparison or with deviation calculation. - */ + /** Performs the benchmark: simple comparison or with deviation calculation. */ protected function perform(): void { $this->deviations === 1 @@ -216,9 +208,7 @@ protected function perform(): void : $this->performDeviation(); } - /** - * Transforms collected data into an array of results. - */ + /** Transforms collected data into an array of results. */ protected function mapResult(): array { return $this->result->get( @@ -226,9 +216,7 @@ protected function mapResult(): array ); } - /** - * Performs a simple comparison of callback functions. - */ + /** Performs a simple comparison of callback functions. */ protected function performCompare(): void { $callbacks = $this->callbacks->compare; @@ -239,9 +227,7 @@ protected function performCompare(): void ); } - /** - * Performs a comparison with deviation calculation through multiple runs. - */ + /** Performs a comparison with deviation calculation through multiple runs. */ protected function performDeviation(): void { $results = []; @@ -357,9 +343,7 @@ protected function push(mixed $name, float $time, float $memory): void $this->collector->push($name, [$time, $memory]); } - /** - * Clears results and collected data. - */ + /** Clears results and collected data. */ protected function clear(): void { $this->result->clear(); diff --git a/src/Exceptions/NoComparisonsException.php b/src/Exceptions/NoComparisonsException.php index 11acf9e..71036ec 100644 --- a/src/Exceptions/NoComparisonsException.php +++ b/src/Exceptions/NoComparisonsException.php @@ -8,9 +8,7 @@ class NoComparisonsException extends RuntimeException { - /** - * Creates an exception indicating that the "compare" method was not called. - */ + /** Creates an exception indicating that the "compare" method was not called. */ public function __construct() { parent::__construct('Method "compare" was not called. No comparisons were made.'); diff --git a/src/Services/CollectorService.php b/src/Services/CollectorService.php index 3283fc0..b4105d5 100644 --- a/src/Services/CollectorService.php +++ b/src/Services/CollectorService.php @@ -22,17 +22,13 @@ public function push(int|string $name, array $values): static return $this; } - /** - * Returns all collected measurement data. - */ + /** Returns all collected measurement data. */ public function all(): array { return $this->data; } - /** - * Clears all collected data. - */ + /** Clears all collected data. */ public function clear(): void { $this->data = []; diff --git a/src/Services/MemoryService.php b/src/Services/MemoryService.php index 40d33f5..30e0a31 100644 --- a/src/Services/MemoryService.php +++ b/src/Services/MemoryService.php @@ -39,9 +39,7 @@ public function diff(int $memory): int return memory_get_peak_usage(true) - $memory; } - /** - * Resets peak memory usage and runs the garbage collector. - */ + /** Resets peak memory usage and runs the garbage collector. */ public function reset(): void { gc_collect_cycles(); diff --git a/src/Services/ResultService.php b/src/Services/ResultService.php index 0677af2..39abb45 100644 --- a/src/Services/ResultService.php +++ b/src/Services/ResultService.php @@ -22,9 +22,7 @@ public function __construct( protected MeasurementErrorService $measurement = new MeasurementErrorService, ) {} - /** - * Checks whether results have already been calculated. - */ + /** Checks whether results have already been calculated. */ public function has(): bool { return $this->data !== null; @@ -51,9 +49,7 @@ public function get(array $collections): array return $this->data ??= $this->map($collections); } - /** - * Clears the stored results. - */ + /** Clears the stored results. */ public function clear(): void { $this->data = null; diff --git a/src/Services/RunnerService.php b/src/Services/RunnerService.php index f214425..1ef174f 100644 --- a/src/Services/RunnerService.php +++ b/src/Services/RunnerService.php @@ -28,9 +28,7 @@ public function call(Closure $callback, array $parameters = []): array return $this->run($callback, $parameters); } - /** - * Resets the memory state before measurement. - */ + /** Resets the memory state before measurement. */ protected function clean(): void { $this->memory->reset(); diff --git a/src/Services/ViewService.php b/src/Services/ViewService.php index fe5de2d..0a095aa 100644 --- a/src/Services/ViewService.php +++ b/src/Services/ViewService.php @@ -21,9 +21,7 @@ public function __construct( protected SilentProgressBarView $silentProgressBar = new SilentProgressBarView, ) {} - /** - * @return $this - */ + /** @return $this */ public function disable(): static { $this->enabled = false; @@ -41,9 +39,7 @@ public function table(array $data): void $this->table->show($data); } - /** - * Returns the progress bar instance. - */ + /** Returns the progress bar instance. */ public function progressBar(): ProgressBar { return $this->enabled diff --git a/src/View/ProgressBarView.php b/src/View/ProgressBarView.php index ac26444..92d3d09 100644 --- a/src/View/ProgressBarView.php +++ b/src/View/ProgressBarView.php @@ -47,9 +47,7 @@ public function advance(int $step = 1): void $this->display(); } - /** - * Finishes the progress bar by setting the current value equal to the total. - */ + /** Finishes the progress bar by setting the current value equal to the total. */ public function finish(): void { $this->current = $this->total; @@ -59,9 +57,7 @@ public function finish(): void $this->write(PHP_EOL); } - /** - * Renders the current state of the progress bar. - */ + /** Renders the current state of the progress bar. */ protected function display(): void { $percent = $this->percent();