From 980bcfc4c1c78c6c9eeaf74ef8745027cb25ecd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kucha=C5=99?= <honza.kuchar@grifart.cz>
Date: Thu, 27 Apr 2017 19:25:08 +0200
Subject: [PATCH] rename: FunctionAssertionError ->
 FunctionSignatureAssertionError

---
 src/SignatureAssertionUtil.php | 12 ++++++------
 src/exceptions.php             |  2 +-
 src/functions.php              |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/SignatureAssertionUtil.php b/src/SignatureAssertionUtil.php
index d037290..05c74b9 100644
--- a/src/SignatureAssertionUtil.php
+++ b/src/SignatureAssertionUtil.php
@@ -19,7 +19,7 @@ final class SignatureAssertionUtil
 		// NUMBER OF PARAMETERS CHECK:
 		$numberOfParameters = $reflection->getNumberOfParameters();
 		if($numberOfParameters !== count($parameters)) {
-			throw FunctionAssertionError::wrongNumberOrArguments($reflection, count($parameters), $numberOfParameters);
+			throw FunctionSignatureAssertionError::wrongNumberOrArguments($reflection, count($parameters), $numberOfParameters);
 		}
 
 		// PARAMETER TYPES CHECK:
@@ -42,7 +42,7 @@ final class SignatureAssertionUtil
 		// RETURN TYPE:
 		if($expectedReturnType !== NULL) {
 			if(!$reflection->hasReturnType()) {
-				throw FunctionAssertionError::missingReturnType($reflection, $expectedReturnType);
+				throw FunctionSignatureAssertionError::missingReturnType($reflection, $expectedReturnType);
 			}
 
 			if ($reflection->hasReturnType()) {
@@ -51,14 +51,14 @@ final class SignatureAssertionUtil
 
 				$actuallyNullable = $returnTypeReflection->allowsNull();
 				if ($expectingNullable !== $actuallyNullable) {
-					throw FunctionAssertionError::wrongReturnTypeNullability(
+					throw FunctionSignatureAssertionError::wrongReturnTypeNullability(
 						$reflection,
 						$expectingNullable,
 						$actuallyNullable
 					);
 				}
 				if ($expectedReturnType !== (string) $reflection->getReturnType()) {
-					throw FunctionAssertionError::wrongReturnType(
+					throw FunctionSignatureAssertionError::wrongReturnType(
 						$reflection,
 						$expectedReturnType,
 						(string) $reflection->getReturnType()
@@ -92,7 +92,7 @@ final class SignatureAssertionUtil
 		// checks:
 		$actuallyOptional = $reflectionType->allowsNull();
 		if ($expectedOptional !== $actuallyOptional) {
-			throw FunctionAssertionError::parameterNullability(
+			throw FunctionSignatureAssertionError::parameterNullability(
 				$functionReflection,
 				$parameterReflection,
 				$expectedOptional,
@@ -100,7 +100,7 @@ final class SignatureAssertionUtil
 			);
 		}
 		if ($expectedParameterType !== (string) $reflectionType) {
-			throw FunctionAssertionError::wrongParameterType(
+			throw FunctionSignatureAssertionError::wrongParameterType(
 				$functionReflection,
 				$parameterReflection,
 				$expectedParameterType,
diff --git a/src/exceptions.php b/src/exceptions.php
index f1d214b..c227449 100644
--- a/src/exceptions.php
+++ b/src/exceptions.php
@@ -1,7 +1,7 @@
 <?php declare(strict_types=1);
 namespace Grifart\AssertFunction;
 
-final class FunctionAssertionError extends \AssertionError {
+final class FunctionSignatureAssertionError extends \AssertionError {
 
 	const PATH_DEPTH = 2;
 
diff --git a/src/functions.php b/src/functions.php
index 54821f7..be14bca 100644
--- a/src/functions.php
+++ b/src/functions.php
@@ -3,7 +3,7 @@
  * Used to load functions.
  */
 
-// todo: TESTS: better assertion messages + throw FunctionAssertionError + catch in fn + pass it to assert -> compatible with PHP assert config
+// todo: TESTS: better assertion messages + throw FunctionSignatureAssertionError + catch in fn + pass it to assert -> compatible with PHP assert config
 // todo: covariance and contra-variance
 
 namespace Grifart\AssertFunction;
@@ -27,7 +27,7 @@ function assertSignature(callable $function, array $parameters, ?string $expecte
 			$expectedReturnType
 		);
 
-	} catch (FunctionAssertionError $error) {
+	} catch (FunctionSignatureAssertionError $error) {
 		// todo: add callee position
 		assert(FALSE, $error);
 	}
-- 
GitLab