From 996259e6a1a04f91179d2b83cc19e3fbb371cd33 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 26 Feb 2024 13:21:22 +0900 Subject: feat: implement some of instructions --- src/Structure/Types/ResultType.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Structure/Types/ResultType.php') diff --git a/src/Structure/Types/ResultType.php b/src/Structure/Types/ResultType.php index 267916b..a826805 100644 --- a/src/Structure/Types/ResultType.php +++ b/src/Structure/Types/ResultType.php @@ -13,4 +13,17 @@ final readonly class ResultType public array $types, ) { } + + public function equals(ResultType $other): bool + { + if (count($this->types) !== count($other->types)) { + return false; + } + foreach ($this->types as $i => $type) { + if (!$type->equals($other->types[$i])) { + return false; + } + } + return true; + } } -- cgit v1.2.3-70-g09d2