Skip to content

Commit

Permalink
Merge pull request #138 from LenaDooms/issue/137
Browse files Browse the repository at this point in the history
fix: make implicitly nullable parameter declarations explicit (Resolves #137)
  • Loading branch information
christeredvartsen authored Jan 7, 2025
2 parents a60b71d + 6f027fb commit 890d712
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/Context/ApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,17 @@ public function setBasicAuth(string $username, string $password): static
/**
* Send OAuth request using password grant and set Authorization header.
*
* @param string $path The path to get the token from
* @param string $username The username to authenticate with
* @param string $password The password to authenticate with
* @param string $scope The scope to authenticate in
* @param string $clientId The client_id to send
* @param string $clientSecret Optional client_secret to send
* @param string $path The path to get the token from
* @param string $username The username to authenticate with
* @param string $password The password to authenticate with
* @param string $scope The scope to authenticate in
* @param string $clientId The client_id to send
* @param string|null $clientSecret Optional client_secret to send
*
* @Given I get an OAuth token using password grant from :path with :username and :password in scope :scope using client ID :clientId
* @Given I get an OAuth token using password grant from :path with :username and :password in scope :scope using client ID :clientId and client secret :clientSecret
*/
public function oauthWithPasswordGrantInScope(string $path, string $username, string $password, string $scope, string $clientId, string $clientSecret = null): static
public function oauthWithPasswordGrantInScope(string $path, string $username, string $password, string $scope, string $clientId, ?string $clientSecret = null): static
{
$this->requestOptions['form_params'] = array_filter([
'grant_type' => 'password',
Expand Down Expand Up @@ -435,12 +435,12 @@ public function setQueryStringParameters(TableNode $params): static
* Request a path
*
* @param string $path The path to request
* @param string $method The HTTP method to use
* @param string|null $method The HTTP method to use
*
* @When I request :path
* @When I request :path using HTTP :method
*/
public function requestPath(string $path, string $method = null): static
public function requestPath(string $path, ?string $method = null): static
{
$this->setRequestPath($path);

Expand Down Expand Up @@ -1426,11 +1426,11 @@ protected function getResponseBodyArray(): array
* Convert some variable to a JSON-array
*
* @param string $value The value to decode
* @param string $errorMessage Optional error message
* @param string|null $errorMessage Optional error message
* @throws InvalidArgumentException
* @return array<mixed>
*/
protected function jsonDecode(string $value, string $errorMessage = null): array
protected function jsonDecode(string $value, ?string $errorMessage = null): array
{
/** @var array<mixed> */
$decoded = json_decode($value, true);
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ArrayContainsComparatorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
class ArrayContainsComparatorException extends AssertionFailedException
{
public function __construct(string $message, int $code = 0, Exception $previous = null, mixed $needle = null, mixed $haystack = null)
public function __construct(string $message, int $code = 0, ?Exception $previous = null, mixed $needle = null, mixed $haystack = null)
{
$message .= PHP_EOL . PHP_EOL . sprintf(
<<<MESSAGE
Expand Down

0 comments on commit 890d712

Please sign in to comment.