Skip to content

Commit 9f12ada

Browse files
committed
Harmonize exception throwing
1 parent 3cd71e4 commit 9f12ada

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Exception/NoInverseException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class NoInverseException extends RuntimeException implements MathException
1414
/**
1515
* @pure
1616
*/
17-
public static function noModularInverse(): self
17+
public static function noModularInverse(): NoInverseException
1818
{
1919
return new self('The modular inverse does not exist.');
2020
}

src/Exception/NumberFormatException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class NumberFormatException extends RuntimeException implements MathExcept
1919
/**
2020
* @pure
2121
*/
22-
public static function invalidFormat(string $value): self
22+
public static function invalidFormat(string $value): NumberFormatException
2323
{
2424
return new self(sprintf(
2525
'The given value "%s" does not represent a valid number.',
@@ -32,7 +32,7 @@ public static function invalidFormat(string $value): self
3232
*
3333
* @pure
3434
*/
35-
public static function charNotInAlphabet(string $char): self
35+
public static function charNotInAlphabet(string $char): NumberFormatException
3636
{
3737
return new self(sprintf(
3838
'Character %s is not valid in the given alphabet.',

0 commit comments

Comments
 (0)