Skip to content

Commit

Permalink
Explicit nullable params
Browse files Browse the repository at this point in the history
  • Loading branch information
christeredvartsen committed Jan 6, 2025
1 parent 56cd40e commit d40c0a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Context/ApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function setBasicAuth(string $username, string $password): static
* @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 @@ -440,7 +440,7 @@ public function setQueryStringParameters(TableNode $params): static
* @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 @@ -1430,7 +1430,7 @@ protected function getResponseBodyArray(): array
* @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
4 changes: 2 additions & 2 deletions src/Exception/ArrayContainsComparatorException.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php declare(strict_types=1);
namespace Imbo\BehatApiExtension\Exception;

use Exception;
use Throwable;

/**
* Array contains comparator exception
*/
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, ?Throwable $previous = null, mixed $needle = null, mixed $haystack = null)
{
$message .= PHP_EOL . PHP_EOL . sprintf(
<<<MESSAGE
Expand Down

0 comments on commit d40c0a4

Please sign in to comment.