Skip to content

Commit

Permalink
style: fix (updated) code style
Browse files Browse the repository at this point in the history
  • Loading branch information
JaZo committed Mar 12, 2024
1 parent 936d401 commit 963f92b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Api/Areas.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Areas extends AbstractApi
{
protected AreaParser $areaParser;

public function __construct(Client $client, AreaParser $areaParser = null)
public function __construct(Client $client, ?AreaParser $areaParser = null)
{
parent::__construct($client);

Expand Down
4 changes: 2 additions & 2 deletions src/Api/Situations.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Situations extends AbstractApi
{
protected SituationParser $situationParser;

public function __construct(Client $client, SituationParser $situationParser = null)
public function __construct(Client $client, ?SituationParser $situationParser = null)
{
parent::__construct($client);

Expand All @@ -34,7 +34,7 @@ public function __construct(Client $client, SituationParser $situationParser = n
/**
* @return \Swis\Melvin\Models\Situation[]
*/
public function export(SituationFilterParameters $parameters = null): array
public function export(?SituationFilterParameters $parameters = null): array
{
$result = $this->getHttpClient()->request('POST', 'export', $parameters);

Expand Down
8 changes: 4 additions & 4 deletions src/Exceptions/RequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class RequestException extends \RuntimeException implements Exception
public function __construct(
string $message,
RequestInterface $request,
ResponseInterface $response = null,
\Throwable $previous = null
?ResponseInterface $response = null,
?\Throwable $previous = null
) {
$code = $response ? $response->getStatusCode() : 0;
parent::__construct($message, $code, $previous);
Expand All @@ -27,8 +27,8 @@ public function __construct(

public static function create(
RequestInterface $request,
ResponseInterface $response = null,
\Throwable $previous = null
?ResponseInterface $response = null,
?\Throwable $previous = null
): self {
if (!$response) {
return new self(
Expand Down
1 change: 1 addition & 0 deletions src/Parsers/PeriodParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function parse(\stdClass $object, int $index, int $situationId): Period
$repeatingAt[6]
);
}

return new Period(
$object->id ?? $situationId,
($object->name ?? '') ?: sprintf('Uitvoerperiode %d', $index + 1),
Expand Down
2 changes: 1 addition & 1 deletion src/Parsers/SituationParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(

public function parse(\stdClass $object, array $restrictions, array $detours = []): Situation
{
$situationId = (int)$object->id;
$situationId = (int) $object->id;

if ($roadAuthority = $object->properties->roadAuthority ?? null) {
$roadAuthority = new RoadAuthority(
Expand Down

0 comments on commit 963f92b

Please sign in to comment.