Skip to content

Commit

Permalink
Exceptions at end (representer), less methods (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-mxp authored Mar 5, 2024
1 parent ef59243 commit b3edb30
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions exercises/practice/circular-buffer/CircularBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,10 @@

declare(strict_types=1);

class BufferFullError extends Exception
{
}

class BufferEmptyError extends Exception
{
}

class CircularBuffer
{
// You need to add more methods yourself!

public function read()
{
throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
Expand All @@ -43,14 +37,12 @@ public function write($item): void
{
throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
}
}

public function forceWrite($item): void
{
throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
}
class BufferFullError extends Exception
{
}

public function clear(): void
{
throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
}
class BufferEmptyError extends Exception
{
}

0 comments on commit b3edb30

Please sign in to comment.