diff --git a/src/ReverseRegex/Generator/Node.php b/src/ReverseRegex/Generator/Node.php index f8d8f48..bb4e3f6 100644 --- a/src/ReverseRegex/Generator/Node.php +++ b/src/ReverseRegex/Generator/Node.php @@ -2,6 +2,7 @@ namespace ReverseRegex\Generator; use \ArrayObject; +use \Closure; use \SplObjectStorage; use \ArrayAccess; use \Countable; @@ -125,7 +126,7 @@ public function contains(Node $node) * Apply a closure to all relations * * @access public - * @param Closer the function to apply + * @param Closure $function the function to apply */ public function map(Closure $function) { @@ -133,61 +134,64 @@ public function map(Closure $function) $function($node); } } - + //------------------------------------------------------------------ # Countable - - public function count() + + public function count(): int { return count($this->links); } - + //------------------------------------------------------------------ # Iterator + #[\ReturnTypeWillChange] public function current() { return $this->links->current(); } + #[\ReturnTypeWillChange] public function key() { return $this->links->key(); } - public function next() + public function next(): void { - return $this->links->next(); + $this->links->next(); } - public function rewind() + public function rewind(): void { - return $this->links->rewind(); + $this->links->rewind(); } - public function valid() + public function valid(): bool { return $this->links->valid(); } - + //------------------------------------------------------------------ # ArrayAccess Implementation + #[\ReturnTypeWillChange] public function offsetGet($key) { return $this->attrs->offsetGet($key); } - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { $this->attrs->offsetSet($key, $value); } - public function offsetExists($key) + public function offsetExists($key): bool { return $this->attrs->offsetExists($key); } - public function offsetUnset($key) + public function offsetUnset($key): void { - return $this->attrs->offsetUnset($key); + $this->attrs->offsetUnset($key); } } -/* End of Class */ \ No newline at end of file +/* End of Class */