Skip to content

Commit

Permalink
[Components] Convert to native return types
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj authored and nicolas-grekas committed Jul 5, 2023
1 parent aa4aa9e commit 7bbfa3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 3 additions & 9 deletions Stopwatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ public function getSections(): array
*
* @param string|null $id The id of the session to re-open, null to create a new one
*
* @return void
*
* @throws \LogicException When the section to re-open is not reachable
*/
public function openSection(string $id = null)
public function openSection(string $id = null): void
{
$current = end($this->activeSections);

Expand All @@ -81,11 +79,9 @@ public function openSection(string $id = null)
*
* @see getSectionEvents()
*
* @return void
*
* @throws \LogicException When there's no started section to be stopped
*/
public function stopSection(string $id)
public function stopSection(string $id): void
{
$this->stop('__section__');

Expand Down Expand Up @@ -149,10 +145,8 @@ public function getSectionEvents(string $id): array

/**
* Resets the stopwatch to its original state.
*
* @return void
*/
public function reset()
public function reset(): void
{
$this->sections = $this->activeSections = ['__root__' => new Section(null, $this->morePrecision)];
}
Expand Down
4 changes: 1 addition & 3 deletions StopwatchEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ public function lap(): static

/**
* Stops all non already stopped periods.
*
* @return void
*/
public function ensureStopped()
public function ensureStopped(): void
{
while (\count($this->started)) {
$this->stop();
Expand Down

0 comments on commit 7bbfa3d

Please sign in to comment.