Skip to content

Commit f695262

Browse files
committed
added ShouldNotHappenException
1 parent 259c2bf commit f695262

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Utils/Iterables.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ public static function toIterator(iterable $iterable): \Iterator
233233
$iterable instanceof \Iterator => $iterable,
234234
$iterable instanceof \IteratorAggregate => self::toIterator($iterable->getIterator()),
235235
is_array($iterable) => new \ArrayIterator($iterable),
236+
default => throw new Nette\ShouldNotHappenException,
236237
};
237238
}
238239
}

src/exceptions.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,11 @@ class OutOfRangeException extends \OutOfRangeException
104104
class UnexpectedValueException extends \UnexpectedValueException
105105
{
106106
}
107+
108+
109+
/**
110+
* Houston, we have a problem.
111+
*/
112+
class ShouldNotHappenException extends \LogicException
113+
{
114+
}

0 commit comments

Comments
 (0)