Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/vierbergenlars/LibJs/JSArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,49 +149,57 @@ public function __get($name)
}
}


#[\ReturnTypeWillChange]
public function current()
{
return $this->_convert(current($this->array));
}

#[\ReturnTypeWillChange]
public function key()
{
return $this->_convert(key($this->array));
}

#[\ReturnTypeWillChange]
public function next()
{
return $this->_convert(next($this->array));
}

#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->array[$offset]);
}

#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if(!$this->offsetExists($offset))
return null;
return $this->_convert($this->array[$offset]);
}

#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->array[$offset] = $value;
}

#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->array[$offset]);
}

#[\ReturnTypeWillChange]
public function rewind()
{
return reset($this->array);
}

#[\ReturnTypeWillChange]
public function valid()
{
return key($this->array) !== null;
Expand Down
4 changes: 4 additions & 0 deletions src/vierbergenlars/LibJs/JString.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,25 @@ public function __get($name)
}
}

#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->str[$offset]);
}

#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->str[$offset];
}

#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->str[$offset] = $value;
}

#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
throw new \LogicException('Cannot unset a position in a string');
Expand Down