| Total Complexity | 12 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class NodeHashTable implements \IteratorAggregate, NodeCollectionInterface |
||
| 6 | { |
||
| 7 | /** @var Node[] */ |
||
| 8 | private array $nodes = []; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * {@inheritdoc} |
||
| 12 | */ |
||
| 13 | 7 | public function getIterator(): iterable |
|
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | 13 | public function extractBest(): ?Node |
|
| 22 | { |
||
| 23 | 13 | $bestNode = null; |
|
| 24 | |||
| 25 | 13 | foreach ($this->nodes as $node) { |
|
| 26 | 13 | if ($bestNode === null || $node->getF() < $bestNode->getF()) { |
|
|
|
|||
| 27 | 13 | $bestNode = $node; |
|
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 13 | if ($bestNode !== null) { |
|
| 32 | 13 | $this->remove($bestNode); |
|
| 33 | } |
||
| 34 | |||
| 35 | 13 | return $bestNode; |
|
| 36 | } |
||
| 37 | |||
| 38 | 10 | public function get(string $nodeId): ?Node |
|
| 41 | } |
||
| 42 | |||
| 43 | 20 | public function add(Node $node): void |
|
| 46 | 20 | } |
|
| 47 | |||
| 48 | 14 | public function remove(Node $node): void |
|
| 49 | { |
||
| 50 | 14 | unset($this->nodes[$node->getId()]); |
|
| 51 | 14 | } |
|
| 52 | |||
| 53 | 13 | public function isEmpty(): bool |
|
| 56 | } |
||
| 57 | |||
| 58 | 10 | public function contains(Node $node): bool |
|
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * {@inheritdoc} |
||
| 65 | */ |
||
| 66 | 13 | public function clear(): void |
|
| 69 | 13 | } |
|
| 70 | } |
||
| 71 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.