diff --git a/src/Internal/functions.php b/src/Internal/functions.php index fc945b4..6776ff8 100644 --- a/src/Internal/functions.php +++ b/src/Internal/functions.php @@ -30,27 +30,6 @@ function formatStacktrace(array $trace): string }, $trace, \array_keys($trace))); } -/** - * Creates a `TypeError` with a standardized error message. - * - * @param string[] $expected Expected types. - * @param mixed $given Given value. - * - * @internal - */ -function createTypeError(array $expected, mixed $given): \TypeError -{ - $givenType = \is_object($given) ? \sprintf("instance of %s", \get_class($given)) : \gettype($given); - - if (\count($expected) === 1) { - $expectedType = "Expected the following type: " . \array_pop($expected); - } else { - $expectedType = "Expected one of the following types: " . \implode(", ", $expected); - } - - return new \TypeError("{$expectedType}; {$givenType} given"); -} - /** * @return bool True if AMP_DEBUG is set to a truthy value. */