Skip to content

Commit b3edb30

Browse files
authored
Exceptions at end (representer), less methods (#657)
1 parent ef59243 commit b3edb30

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

exercises/practice/circular-buffer/CircularBuffer.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,10 @@
2424

2525
declare(strict_types=1);
2626

27-
class BufferFullError extends Exception
28-
{
29-
}
30-
31-
class BufferEmptyError extends Exception
32-
{
33-
}
34-
3527
class CircularBuffer
3628
{
29+
// You need to add more methods yourself!
30+
3731
public function read()
3832
{
3933
throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
@@ -43,14 +37,12 @@ public function write($item): void
4337
{
4438
throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
4539
}
40+
}
4641

47-
public function forceWrite($item): void
48-
{
49-
throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
50-
}
42+
class BufferFullError extends Exception
43+
{
44+
}
5145

52-
public function clear(): void
53-
{
54-
throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
55-
}
46+
class BufferEmptyError extends Exception
47+
{
5648
}

0 commit comments

Comments
 (0)