Skip to content
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

Add some PHPDoc return types and fixes #1273

Merged
merged 4 commits into from
Jul 25, 2022
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
6 changes: 2 additions & 4 deletions lib/ApiRequestor.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,8 @@ private static function _formatAppInfo($appInfo)
/**
* @static
*
* @param string $disabledFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions')
* @param string $disableFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions')
* @param string $functionName - Name of the function we are interesting in seeing whether or not it is disabled
* @param mixed $disableFunctionsOutput
*
* @return bool
*/
Expand Down Expand Up @@ -474,8 +473,7 @@ private function _requestRaw($method, $url, $params, $headers)
* @param string $url
* @param array $params
* @param array $headers
* @param callable $readBodyChunk
* @param mixed $readBodyChunkCallable
* @param callable $readBodyChunkCallable
*
* @throws Exception\AuthenticationException
* @throws Exception\ApiConnectionException
Expand Down
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
24 changes: 23 additions & 1 deletion lib/StripeObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ public function __set($k, $v)
$this->_unsavedValues->add($k);
}

/**
* @param mixed $k
*
* @return bool
*/
public function __isset($k)
{
return isset($this->_values[$k]);
Expand Down Expand Up @@ -187,31 +192,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