Skip to content

Commit

Permalink
Add void return type
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkary committed Oct 17, 2022
1 parent a3bfd81 commit a98cdad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The `SpeedTrap` Extension must be registered differently in `phpunit.xml`:
If you have extended the old `JohnKary\PHPUnit\Listener\SpeedTrapListener`, you
must extend the new `JohnKary\PHPUnit\Extension\SpeedTrap`. There are various
method name changes that may affect your custom subclass. See [PR #83](https://github.com/johnkary/phpunit-speedtrap/pull/83)
for how the new class has changed.
for many of the new class has changed.

UPGRADE FROM 3.x to 4.0
=======================
Expand Down
10 changes: 5 additions & 5 deletions src/SpeedTrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected function isSlow(int $time, int $slowThreshold): bool
*
* @param int $time Test execution time that was considered slow, in milliseconds
*/
protected function addSlowTest(string $test, int $time)
protected function addSlowTest(string $test, int $time): void
{
$label = $this->makeLabel($test);

Expand Down Expand Up @@ -193,15 +193,15 @@ protected function getHiddenCount(): int
/**
* Renders slowness report header.
*/
protected function renderHeader()
protected function renderHeader(): void
{
echo sprintf("\n\nYou should really speed up these slow tests (>%sms)...\n", $this->slowThreshold);
}

/**
* Renders slowness report body.
*/
protected function renderBody()
protected function renderBody(): void
{
$slowTests = $this->slow;

Expand All @@ -217,7 +217,7 @@ protected function renderBody()
/**
* Renders slowness report footer.
*/
protected function renderFooter()
protected function renderFooter(): void
{
if ($hidden = $this->getHiddenCount()) {
printf("...and there %s %s more above your threshold hidden from view\n", $hidden == 1 ? 'is' : 'are', $hidden);
Expand All @@ -227,7 +227,7 @@ protected function renderFooter()
/**
* Populate options into class internals.
*/
protected function loadOptions(array $options)
protected function loadOptions(array $options): void
{
$this->slowThreshold = $options['slowThreshold'] ?? 500;
$this->reportLength = $options['reportLength'] ?? 10;
Expand Down

0 comments on commit a98cdad

Please sign in to comment.