Skip to content

Commit 4ac00ea

Browse files
andrey-helldargithub-actions[bot]
authored andcommitted
🦋 The code style has been fixed
1 parent ae058df commit 4ac00ea

8 files changed

Lines changed: 19 additions & 57 deletions

File tree

src/Benchmark.php

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ public function __construct(
3636
protected DeviationService $deviation = new DeviationService,
3737
) {}
3838

39-
/**
40-
* Creates a new benchmark instance.
41-
*/
39+
/** Creates a new benchmark instance. */
4240
public static function make(): static
4341
{
4442
return new static;
@@ -178,9 +176,7 @@ public function toData(): array
178176
return $this->mapResult();
179177
}
180178

181-
/**
182-
* Outputs benchmark results to the console as a table.
183-
*/
179+
/** Outputs benchmark results to the console as a table. */
184180
public function toConsole(): void
185181
{
186182
if (! $data = $this->toData()) {
@@ -194,9 +190,7 @@ public function toConsole(): void
194190
);
195191
}
196192

197-
/**
198-
* Returns the assertion service for performing result checks.
199-
*/
193+
/** Returns the assertion service for performing result checks. */
200194
public function toAssert(): AssertService
201195
{
202196
if (! $data = $this->toData()) {
@@ -206,29 +200,23 @@ public function toAssert(): AssertService
206200
return new AssertService($data);
207201
}
208202

209-
/**
210-
* Performs the benchmark: simple comparison or with deviation calculation.
211-
*/
203+
/** Performs the benchmark: simple comparison or with deviation calculation. */
212204
protected function perform(): void
213205
{
214206
$this->deviations === 1
215207
? $this->performCompare()
216208
: $this->performDeviation();
217209
}
218210

219-
/**
220-
* Transforms collected data into an array of results.
221-
*/
211+
/** Transforms collected data into an array of results. */
222212
protected function mapResult(): array
223213
{
224214
return $this->result->get(
225215
$this->collector->all()
226216
);
227217
}
228218

229-
/**
230-
* Performs a simple comparison of callback functions.
231-
*/
219+
/** Performs a simple comparison of callback functions. */
232220
protected function performCompare(): void
233221
{
234222
$callbacks = $this->callbacks->compare;
@@ -239,9 +227,7 @@ protected function performCompare(): void
239227
);
240228
}
241229

242-
/**
243-
* Performs a comparison with deviation calculation through multiple runs.
244-
*/
230+
/** Performs a comparison with deviation calculation through multiple runs. */
245231
protected function performDeviation(): void
246232
{
247233
$results = [];
@@ -357,9 +343,7 @@ protected function push(mixed $name, float $time, float $memory): void
357343
$this->collector->push($name, [$time, $memory]);
358344
}
359345

360-
/**
361-
* Clears results and collected data.
362-
*/
346+
/** Clears results and collected data. */
363347
protected function clear(): void
364348
{
365349
$this->result->clear();

src/Exceptions/NoComparisonsException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
class NoComparisonsException extends RuntimeException
1010
{
11-
/**
12-
* Creates an exception indicating that the "compare" method was not called.
13-
*/
11+
/** Creates an exception indicating that the "compare" method was not called. */
1412
public function __construct()
1513
{
1614
parent::__construct('Method "compare" was not called. No comparisons were made.');

src/Services/CollectorService.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@ public function push(int|string $name, array $values): static
2222
return $this;
2323
}
2424

25-
/**
26-
* Returns all collected measurement data.
27-
*/
25+
/** Returns all collected measurement data. */
2826
public function all(): array
2927
{
3028
return $this->data;
3129
}
3230

33-
/**
34-
* Clears all collected data.
35-
*/
31+
/** Clears all collected data. */
3632
public function clear(): void
3733
{
3834
$this->data = [];

src/Services/MemoryService.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ public function diff(int $memory): int
3939
return memory_get_peak_usage(true) - $memory;
4040
}
4141

42-
/**
43-
* Resets peak memory usage and runs the garbage collector.
44-
*/
42+
/** Resets peak memory usage and runs the garbage collector. */
4543
public function reset(): void
4644
{
4745
gc_collect_cycles();

src/Services/ResultService.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ public function __construct(
2222
protected MeasurementErrorService $measurement = new MeasurementErrorService,
2323
) {}
2424

25-
/**
26-
* Checks whether results have already been calculated.
27-
*/
25+
/** Checks whether results have already been calculated. */
2826
public function has(): bool
2927
{
3028
return $this->data !== null;
@@ -51,9 +49,7 @@ public function get(array $collections): array
5149
return $this->data ??= $this->map($collections);
5250
}
5351

54-
/**
55-
* Clears the stored results.
56-
*/
52+
/** Clears the stored results. */
5753
public function clear(): void
5854
{
5955
$this->data = null;

src/Services/RunnerService.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ public function call(Closure $callback, array $parameters = []): array
2828
return $this->run($callback, $parameters);
2929
}
3030

31-
/**
32-
* Resets the memory state before measurement.
33-
*/
31+
/** Resets the memory state before measurement. */
3432
protected function clean(): void
3533
{
3634
$this->memory->reset();

src/Services/ViewService.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ public function __construct(
2121
protected SilentProgressBarView $silentProgressBar = new SilentProgressBarView,
2222
) {}
2323

24-
/**
25-
* @return $this
26-
*/
24+
/** @return $this */
2725
public function disable(): static
2826
{
2927
$this->enabled = false;
@@ -41,9 +39,7 @@ public function table(array $data): void
4139
$this->table->show($data);
4240
}
4341

44-
/**
45-
* Returns the progress bar instance.
46-
*/
42+
/** Returns the progress bar instance. */
4743
public function progressBar(): ProgressBar
4844
{
4945
return $this->enabled

src/View/ProgressBarView.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ public function advance(int $step = 1): void
4747
$this->display();
4848
}
4949

50-
/**
51-
* Finishes the progress bar by setting the current value equal to the total.
52-
*/
50+
/** Finishes the progress bar by setting the current value equal to the total. */
5351
public function finish(): void
5452
{
5553
$this->current = $this->total;
@@ -59,9 +57,7 @@ public function finish(): void
5957
$this->write(PHP_EOL);
6058
}
6159

62-
/**
63-
* Renders the current state of the progress bar.
64-
*/
60+
/** Renders the current state of the progress bar. */
6561
protected function display(): void
6662
{
6763
$percent = $this->percent();

0 commit comments

Comments
 (0)