diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-02-26 13:21:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-03-03 15:27:26 +0900 |
| commit | 996259e6a1a04f91179d2b83cc19e3fbb371cd33 (patch) | |
| tree | 14ccabf37cc909c8c61899ffb84429fdeb8dfce0 /src/Structure/Types/ResultType.php | |
| parent | 8a789bffe72e93ae24ea39648018e5fecf94c7fa (diff) | |
| download | php-waddiwasi-996259e6a1a04f91179d2b83cc19e3fbb371cd33.tar.gz php-waddiwasi-996259e6a1a04f91179d2b83cc19e3fbb371cd33.tar.zst php-waddiwasi-996259e6a1a04f91179d2b83cc19e3fbb371cd33.zip | |
feat: implement some of instructions
Diffstat (limited to 'src/Structure/Types/ResultType.php')
| -rw-r--r-- | src/Structure/Types/ResultType.php | 13 |
1 files changed, 13 insertions, 0 deletions
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; + } } |
