Skip to content

Commit

Permalink
Add PHPDoc return types
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Jul 19, 2022
1 parent 5eff342 commit 5ccf74c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public function setFilters($filters)
$this->filters = $filters;
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($k)
{
Expand Down
3 changes: 3 additions & 0 deletions lib/SearchResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public function setFilters($filters)
$this->filters = $filters;
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($k)
{
Expand Down
22 changes: 21 additions & 1 deletion lib/StripeObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public function __set($k, $v)
$this->_unsavedValues->add($k);
}

/**
* @return bool
*/
public function __isset($k)
{
return isset($this->_values[$k]);
Expand Down Expand Up @@ -187,31 +190,48 @@ public function &__get($k)
return $nullval;
}

// Magic method for var_dump output. Only works with PHP >= 5.6
/**
* Magic method for var_dump output. Only works with PHP >= 5.6
*
* @return array
*/
public function __debugInfo()
{
return $this->_values;
}

// ArrayAccess methods

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($k, $v)
{
$this->{$k} = $v;
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($k)
{
return \array_key_exists($k, $this->_values);
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($k)
{
unset($this->{$k});
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($k)
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Util/CaseInsensitiveArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public function __construct($initial_array = [])
$this->container = \array_change_key_case($initial_array, \CASE_LOWER);
}

/**
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
{
Expand Down

0 comments on commit 5ccf74c

Please sign in to comment.