From 1e1831efb36ec992947344d90a135e58aaf4cad9 Mon Sep 17 00:00:00 2001 From: azjezz Date: Sat, 15 May 2021 20:35:11 +0100 Subject: [PATCH] [Type] remove redundant scalar type assertation. --- docs/component/type.md | 2 +- src/Psl/Type/literal_scalar.php | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/component/type.md b/docs/component/type.md index 95afcd8a..759fef93 100644 --- a/docs/component/type.md +++ b/docs/component/type.md @@ -34,7 +34,7 @@ - [is_scalar](./../../src/Psl/Type/is_scalar.php#L18) ( deprecated ) - [is_string](./../../src/Psl/Type/is_string.php#L18) ( deprecated ) - [iterable](./../../src/Psl/Type/iterable.php#L20) -- [literal_scalar](./../../src/Psl/Type/literal_scalar.php#L18) +- [literal_scalar](./../../src/Psl/Type/literal_scalar.php#L14) - [map](./../../src/Psl/Type/map.php#L21) - [mixed](./../../src/Psl/Type/mixed.php#L10) - [mutable_map](./../../src/Psl/Type/mutable_map.php#L21) diff --git a/src/Psl/Type/literal_scalar.php b/src/Psl/Type/literal_scalar.php index f6436396..906cba2b 100644 --- a/src/Psl/Type/literal_scalar.php +++ b/src/Psl/Type/literal_scalar.php @@ -4,21 +4,14 @@ namespace Psl\Type; -use Psl; - /** * @template T of string|int|float|bool * * @param T $value * - * @throws Psl\Type\Exception\AssertException If $value is not scalar. - * * @return TypeInterface */ function literal_scalar(string|int|float|bool $value): TypeInterface { - /** @psalm-suppress MissingThrowsDocblock */ - union(string(), bool(), num())->assert($value); - return new Internal\LiteralScalarType($value); }