1<?php
2
3declare(strict_types=1);
4
5namespace Antlr\Antlr4\Runtime\Comparison;
6
7final class DefaultEquivalence implements Equivalence
8{
9    public function equivalent(Hashable $left, Hashable $right) : bool
10    {
11        return $left->equals($right);
12    }
13
14    public function hash(Hashable $value) : int
15    {
16        return $value->hashCode();
17    }
18
19    public function equals(object $other) : bool
20    {
21        return $other instanceof self;
22    }
23}
24