Skip to content

Commit

Permalink
Merge branch 'cs' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Sep 27, 2023
2 parents e3f9fd0 + b769763 commit 29458b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"require-dev": {
"ext-xdebug": "*",
"aplus/coding-standard": "^1.14",
"aplus/coding-standard": "^2.0",
"ergebnis/composer-normalize": "^2.25",
"jetbrains/phpstorm-attributes": "^1.0",
"phpmd/phpmd": "^2.13",
Expand Down
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function runMulti(array $requests) : Generator
$info = (array) \curl_getinfo($handle);
}
$objectId = \spl_object_id($handle);
if ( ! isset($this->parsed[$objectId])) {
if (!isset($this->parsed[$objectId])) {
unset($handles[$id]);
break;
}
Expand Down Expand Up @@ -144,7 +144,7 @@ protected function parseHeaderLine(CurlHandle $curlHandle, string $line) : int
return $lineLength;
}
$id = \spl_object_id($curlHandle);
if ( ! \str_contains($trimmedLine, ':')) {
if (!\str_contains($trimmedLine, ':')) {
if (\str_starts_with($trimmedLine, 'HTTP/')) {
$parts = \explode(' ', $trimmedLine, 3);
$this->parsed[$id]['protocol'] = $parts[0];
Expand Down
15 changes: 8 additions & 7 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ public function __toString() : string
if ($this->parseContentType() === 'multipart/form-data') {
$this->setBody($this->getMultipartBody());
}
if ( ! $this->hasHeader(RequestHeader::ACCEPT)) {
if (!$this->hasHeader(RequestHeader::ACCEPT)) {
$accept = '*/*';
$this->setHeader(RequestHeader::ACCEPT, $accept);
}
$options = $this->getOptions();
if (isset($options[\CURLOPT_ENCODING])
&& ! $this->hasHeader(RequestHeader::ACCEPT_ENCODING)
&& !$this->hasHeader(RequestHeader::ACCEPT_ENCODING)
) {
$encoding = $options[\CURLOPT_ENCODING] === ''
? 'deflate, gzip, br, zstd'
Expand Down Expand Up @@ -198,7 +198,7 @@ protected function getFileInfo(CURLFile | CURLStringFile | string $file) : array
*/
public function setUrl(string | URL $url) : static
{
if ( ! $url instanceof URL) {
if (!$url instanceof URL) {
$url = new URL($url);
}
$this->setHeader(RequestHeader::HOST, $url->getHost());
Expand Down Expand Up @@ -316,7 +316,7 @@ public function setPost(array $data) : static
#[Pure]
public function hasFiles() : bool
{
return ! empty($this->files);
return !empty($this->files);
}

/**
Expand Down Expand Up @@ -479,7 +479,8 @@ public function removeHeaders() : static
*/
public function setBasicAuth(
string $username,
#[SensitiveParameter] string $password
#[SensitiveParameter]
string $password
) : static {
return $this->setHeader(
RequestHeader::AUTHORIZATION,
Expand Down Expand Up @@ -633,7 +634,7 @@ public function getOption(int $option) : mixed
*/
public function getPostAndFiles() : array | string
{
if ( ! $this->hasFiles()) {
if (!$this->hasFiles()) {
return $this->getBody();
}
\parse_str($this->getBody(), $post);
Expand All @@ -648,7 +649,7 @@ public function getPostAndFiles() : array | string
if ($file instanceof CURLFile || $file instanceof CURLStringFile) {
continue;
}
if ( ! \is_file($file)) {
if (!\is_file($file)) {
throw new InvalidArgumentException(
"Field '{$field}' does not match a file: {$file}"
);
Expand Down

0 comments on commit 29458b3

Please sign in to comment.