diff --git a/src/vierbergenlars/LibJs/JSArray.php b/src/vierbergenlars/LibJs/JSArray.php index 43d48c7..0b56b53 100644 --- a/src/vierbergenlars/LibJs/JSArray.php +++ b/src/vierbergenlars/LibJs/JSArray.php @@ -150,49 +150,49 @@ public function __get($name) } - public function current() + public function current(): mixed { return $this->_convert(current($this->array)); } - public function key() + public function key(): mixed { return $this->_convert(key($this->array)); } - public function next() + public function next(): void { - return $this->_convert(next($this->array)); + $this->_convert(next($this->array)); } - public function offsetExists($offset) + public function offsetExists(mixed $offset): bool { return isset($this->array[$offset]); } - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed { if(!$this->offsetExists($offset)) return null; return $this->_convert($this->array[$offset]); } - public function offsetSet($offset, $value) + public function offsetSet(mixed $offset, mixed $value): void { $this->array[$offset] = $value; } - public function offsetUnset($offset) + public function offsetUnset(mixed $offset): void { unset($this->array[$offset]); } - public function rewind() + public function rewind(): void { - return reset($this->array); + reset($this->array); } - public function valid() + public function valid(): bool { return key($this->array) !== null; } diff --git a/src/vierbergenlars/LibJs/JString.php b/src/vierbergenlars/LibJs/JString.php index a006ac6..ff4448f 100644 --- a/src/vierbergenlars/LibJs/JString.php +++ b/src/vierbergenlars/LibJs/JString.php @@ -207,22 +207,22 @@ public function __get($name) } } - public function offsetExists($offset) + public function offsetExists(mixed $offset): bool { return isset($this->str[$offset]); } - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed { return $this->str[$offset]; } - public function offsetSet($offset, $value) + public function offsetSet(mixed $offset, mixed $value): void { $this->str[$offset] = $value; } - public function offsetUnset($offset) + public function offsetUnset(mixed $offset): void { throw new \LogicException('Cannot unset a position in a string'); }