Skip to content

Commit

Permalink
Fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Oct 11, 2023
1 parent c7f27fa commit e5008bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/ApiClient/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ private function execute(
$guzzleResponse->getHeaders()
);
}
}
}
2 changes: 1 addition & 1 deletion lib/ApiClient/Http/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public function postForm(string $url, array $formData, array $headers): Response
public function patch(string $url, string $content, array $headers): Response;

public function delete(string $url, array $headers): Response;
}
}
11 changes: 5 additions & 6 deletions lib/ApiClient/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ public function __construct(
private readonly int $statusCode,
private readonly string $content,
private readonly array $headers
)
{
) {
}

public function getStatusCode(): int
Expand All @@ -40,7 +39,7 @@ public function isSuccessful(): bool
* After creating a single record with POST, use this method
* to get the PID of the newly created record.
*/
function getGeneratedPid(): ?string
public function getGeneratedPid(): ?string
{
$lastElement = $this->getLastElementOfLocationHeader();

Expand All @@ -55,7 +54,7 @@ function getGeneratedPid(): ?string
* After creating multiple records with POST, use this method
* to get the URL where the newly created elements can be fetched with a new GET request.
*/
function getGeneratedListLink(): ?string
public function getGeneratedListLink(): ?string
{
$lastElement = $this->getLastElementOfLocationHeader();

Expand All @@ -80,12 +79,12 @@ private function getLastElementOfLocationHeader(): ?string

private function getLocationHeaderContent(): ?string
{
foreach($this->getHeaders() as $header){
foreach($this->getHeaders() as $header) {
if (str_starts_with(strtolower($header), 'location:')) {
return trim(preg_replace('/^.+?:/', '', $header));
}
}

return null;
}
}
}

0 comments on commit e5008bd

Please sign in to comment.