Skip to content

Commit

Permalink
Add native types for php8.1 compatibility - calcinai#840
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Karfik committed Mar 21, 2022
1 parent a4b79dd commit f0016b0
Showing 1 changed file with 7 additions and 30 deletions.
37 changes: 7 additions & 30 deletions src/XeroPHP/Remote/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,51 +541,28 @@ public static function supportsMethod($method)
return in_array($method, static::getSupportedMethods(), true);
}

/**
* JSON Encode overload to pull out hidden properties.
*
* @return array
*/
public function jsonSerialize()
/** JSON Encode overload to pull out hidden properties. */
public function jsonSerialize(): mixed
{
return $this->toStringArray();
}

/**
* @param mixed $offset
*
* @return bool
*/
public function offsetExists($offset)
public function offsetExists(mixed $offset): bool
{
return $this->__isset($offset);
}

/**
* @param mixed $offset
*
* @return mixed
*/
public function offsetGet($offset)
public function offsetGet(mixed $offset): mixed
{
return $this->__get($offset);
}

/**
* @param mixed $offset
* @param mixed $value
*
* @return mixed
*/
public function offsetSet($offset, $value)
public function offsetSet(mixed $offset, mixed $value): void
{
return $this->__set($offset, $value);
$this->__set($offset, $value);
}

/**
* @param mixed $offset
*/
public function offsetUnset($offset)
public function offsetUnset(mixed $offset): void
{
unset($this->_data[$offset]);
}
Expand Down

0 comments on commit f0016b0

Please sign in to comment.