Skip to content

Add missing parameter & return types #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 5 additions & 5 deletions src/Infusionsoft/Api/Rest/RestModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public function toJson($options = 0)
*
* @return array
*/
public function jsonSerialize()
public function jsonSerialize(): mixed
{
return $this->toArray();
}
Expand Down Expand Up @@ -982,7 +982,7 @@ public function __set($key, $value)
*
* @return bool
*/
public function offsetExists($offset)
public function offsetExists(mixed $offset): bool
{
return isset($this->$offset);
}
Expand All @@ -994,7 +994,7 @@ public function offsetExists($offset)
*
* @return mixed
*/
public function offsetGet($offset)
public function offsetGet(mixed $offset): mixed
{
return $this->$offset;
}
Expand All @@ -1007,7 +1007,7 @@ public function offsetGet($offset)
*
* @return void
*/
public function offsetSet($offset, $value)
public function offsetSet(mixed $offset, mixed $value): void
{
$this->$offset = $value;
}
Expand All @@ -1019,7 +1019,7 @@ public function offsetSet($offset, $value)
*
* @return void
*/
public function offsetUnset($offset)
public function offsetUnset(mixed $offset): void
{
unset($this->$offset);
}
Expand Down
14 changes: 7 additions & 7 deletions src/Infusionsoft/InfusionsoftCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function toArray()
*
* @return array
*/
public function jsonSerialize()
public function jsonSerialize(): mixed
{
return $this->toArray();
}
Expand All @@ -133,7 +133,7 @@ public function toJson($options = 0)
*
* @return int
*/
public function count()
public function count(): int
{
return count($this->items);
}
Expand All @@ -144,7 +144,7 @@ public function count()
* @param mixed $key
* @return bool
*/
public function offsetExists($key)
public function offsetExists(mixed $key): bool
{
return array_key_exists($key, $this->items);
}
Expand All @@ -155,7 +155,7 @@ public function offsetExists($key)
* @param mixed $key
* @return mixed
*/
public function offsetGet($key)
public function offsetGet(mixed $key): mixed
{
return $this->items[$key];
}
Expand All @@ -167,7 +167,7 @@ public function offsetGet($key)
* @param mixed $value
* @return void
*/
public function offsetSet($key, $value)
public function offsetSet(mixed $key, mixed $value): void
{
if (is_null($key)) {
$this->items[] = $value;
Expand All @@ -182,7 +182,7 @@ public function offsetSet($key, $value)
* @param string $key
* @return void
*/
public function offsetUnset($key)
public function offsetUnset(mixed $key): void
{
unset($this->items[$key]);
}
Expand Down Expand Up @@ -216,4 +216,4 @@ protected function getArrayableItems($items)
return (array) $items;
}

}
}