Skip to content

Commit

Permalink
Update codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Apr 26, 2024
1 parent 9ed8e9f commit 702a11c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"composer/composer": "^2",
"ergebnis/composer-normalize": "^2.13",
"guzzlehttp/guzzle": "^7",
"infection/infection": "~0.21",
"infection/infection": "^0.21",
"jangregor/phpstan-prophecy": "^1",
"mll-lab/php-cs-fixer-config": "^5",
"mockery/mockery": "^1.4",
Expand Down Expand Up @@ -59,13 +59,13 @@
},
"autoload-dev": {
"psr-4": {
"Spawnia\\Sailor\\Tests\\": "tests/",
"Spawnia\\Sailor\\CustomTypes\\": "examples/custom-types/expected/",
"Spawnia\\Sailor\\CustomTypesSrc\\": "examples/custom-types/src/",
"Spawnia\\Sailor\\CustomTypes\\": "examples/custom-types/expected/",
"Spawnia\\Sailor\\Input\\": "examples/input/expected/",
"Spawnia\\Sailor\\Simple\\": "examples/simple/expected/",
"Spawnia\\Sailor\\PhpKeywords\\": "examples/php-keywords/expected/",
"Spawnia\\Sailor\\Polymorphic\\": "examples/polymorphic/expected/"
"Spawnia\\Sailor\\Polymorphic\\": "examples/polymorphic/expected/",
"Spawnia\\Sailor\\Simple\\": "examples/simple/expected/",
"Spawnia\\Sailor\\Tests\\": "tests/"
},
"files": [
"vendor/symfony/var-dumper/Resources/functions/dump.php"
Expand All @@ -77,10 +77,10 @@
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"ocramius/package-versions": true,
"phpstan/extension-installer": true,
"infection/extension-installer": true,
"php-http/discovery": false
"ocramius/package-versions": true,
"php-http/discovery": false,
"phpstan/extension-installer": true
},
"platform": {
"php": "7.4.15"
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
interface Client
{
/** Execute a GraphQL query against an endpoint and return a Response. */
public function request(string $query, \stdClass $variables = null): Response;
public function request(string $query, ?\stdClass $variables = null): Response;
}
2 changes: 1 addition & 1 deletion src/Client/Guzzle.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(string $uri, array $config = [])
$this->guzzle = new GuzzleClient($config);
}

public function request(string $query, \stdClass $variables = null): Response
public function request(string $query, ?\stdClass $variables = null): Response
{
$json = ['query' => $query];
if (! is_null($variables)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(string $filename)
$this->filename = $filename;
}

public function request(string $query, \stdClass $variables = null): Response
public function request(string $query, ?\stdClass $variables = null): Response
{
$log = \Safe\json_encode([
'query' => $query,
Expand Down
8 changes: 4 additions & 4 deletions src/Client/Psr18.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ class Psr18 implements Client
public function __construct(
ClientInterface $client,
string $url = '',
RequestFactoryInterface $requestFactory = null,
StreamFactoryInterface $streamFactory = null
?RequestFactoryInterface $requestFactory = null,
?StreamFactoryInterface $streamFactory = null
) {
$this->client = $client;
$this->url = $url;
$this->requestFactory = $requestFactory ?? new Psr17Factory();
$this->streamFactory = $streamFactory ?? new Psr17Factory();
}

public function request(string $query, \stdClass $variables = null): Response
public function request(string $query, ?\stdClass $variables = null): Response
{
$response = $this->client->sendRequest(
$this->composeRequest($query, $variables)
Expand All @@ -43,7 +43,7 @@ public function request(string $query, \stdClass $variables = null): Response
return Response::fromResponseInterface($response);
}

protected function composeRequest(string $query, \stdClass $variables = null): RequestInterface
protected function composeRequest(string $query, ?\stdClass $variables = null): RequestInterface
{
$request = $this->requestFactory->createRequest('POST', $this->url);

Expand Down
2 changes: 1 addition & 1 deletion src/Testing/MockClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(callable $request)
$this->request = $request;
}

public function request(string $query, \stdClass $variables = null): Response
public function request(string $query, ?\stdClass $variables = null): Response
{
$this->storedRequests[] = new MockRequest($query, $variables);

Expand Down
2 changes: 1 addition & 1 deletion src/Testing/MockRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MockRequest

public ?\stdClass $variables;

public function __construct(string $query, \stdClass $variables = null)
public function __construct(string $query, ?\stdClass $variables = null)
{
$this->query = $query;
$this->variables = $variables;
Expand Down

0 comments on commit 702a11c

Please sign in to comment.