From ff9f1dbaea3aab319d8ab4a60c1ee62b564dcb9e Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 16 Nov 2017 12:33:33 +0100 Subject: [PATCH] Improve matrix tests --- Math/Matrix/IdentityMatrix.php | 2 +- Math/Matrix/Matrix.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Math/Matrix/IdentityMatrix.php b/Math/Matrix/IdentityMatrix.php index 10022a3ef..14b95acc2 100644 --- a/Math/Matrix/IdentityMatrix.php +++ b/Math/Matrix/IdentityMatrix.php @@ -33,7 +33,7 @@ class IdentityMatrix extends Matrix * * @since 1.0.0 */ - public function __constrcut(int $n) + public function __construct(int $n) { $this->n = $n; $this->m = $n; diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index 5c3a8810e..f778370db 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -197,7 +197,7 @@ class Matrix implements \ArrayAccess, \Iterator * * @return Matrix * - * @throws \Exception + * @throws \InvalidArgumentException * * @since 1.0.0 */ @@ -209,7 +209,7 @@ class Matrix implements \ArrayAccess, \Iterator return $this->add(-$value); } - throw new \Exception('Type'); + throw new \InvalidArgumentException('Type'); } /** @@ -219,7 +219,7 @@ class Matrix implements \ArrayAccess, \Iterator * * @return Matrix * - * @throws \Exception + * @throws \InvalidArgumentException * * @since 1.0.0 */ @@ -231,7 +231,7 @@ class Matrix implements \ArrayAccess, \Iterator return $this->addScalar($value); } - throw new \Exception(); + throw new \InvalidArgumentException(); } /** @@ -324,7 +324,7 @@ class Matrix implements \ArrayAccess, \Iterator * * @return Matrix * - * @throws \Exception + * @throws \InvalidArgumentException * * @since 1.0.0 */ @@ -336,7 +336,7 @@ class Matrix implements \ArrayAccess, \Iterator return $this->multScalar($value); } - throw new \Exception('Type'); + throw new \InvalidArgumentException('Type'); } /**