Skip to content

Commit b769763

Browse files
committed
Upgrade Coding Standard
1 parent e259a3f commit b769763

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"require-dev": {
4545
"ext-xdebug": "*",
46-
"aplus/coding-standard": "^1.14",
46+
"aplus/coding-standard": "^2.0",
4747
"ergebnis/composer-normalize": "^2.25",
4848
"jetbrains/phpstorm-attributes": "^1.0",
4949
"phpmd/phpmd": "^2.13",

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function runMulti(array $requests) : Generator
105105
$info = (array) \curl_getinfo($handle);
106106
}
107107
$objectId = \spl_object_id($handle);
108-
if ( ! isset($this->parsed[$objectId])) {
108+
if (!isset($this->parsed[$objectId])) {
109109
unset($handles[$id]);
110110
break;
111111
}
@@ -144,7 +144,7 @@ protected function parseHeaderLine(CurlHandle $curlHandle, string $line) : int
144144
return $lineLength;
145145
}
146146
$id = \spl_object_id($curlHandle);
147-
if ( ! \str_contains($trimmedLine, ':')) {
147+
if (!\str_contains($trimmedLine, ':')) {
148148
if (\str_starts_with($trimmedLine, 'HTTP/')) {
149149
$parts = \explode(' ', $trimmedLine, 3);
150150
$this->parsed[$id]['protocol'] = $parts[0];

src/Request.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ public function __toString() : string
8686
if ($this->parseContentType() === 'multipart/form-data') {
8787
$this->setBody($this->getMultipartBody());
8888
}
89-
if ( ! $this->hasHeader(RequestHeader::ACCEPT)) {
89+
if (!$this->hasHeader(RequestHeader::ACCEPT)) {
9090
$accept = '*/*';
9191
$this->setHeader(RequestHeader::ACCEPT, $accept);
9292
}
9393
$options = $this->getOptions();
9494
if (isset($options[\CURLOPT_ENCODING])
95-
&& ! $this->hasHeader(RequestHeader::ACCEPT_ENCODING)
95+
&& !$this->hasHeader(RequestHeader::ACCEPT_ENCODING)
9696
) {
9797
$encoding = $options[\CURLOPT_ENCODING] === ''
9898
? 'deflate, gzip, br, zstd'
@@ -198,7 +198,7 @@ protected function getFileInfo(CURLFile | CURLStringFile | string $file) : array
198198
*/
199199
public function setUrl(string | URL $url) : static
200200
{
201-
if ( ! $url instanceof URL) {
201+
if (!$url instanceof URL) {
202202
$url = new URL($url);
203203
}
204204
$this->setHeader(RequestHeader::HOST, $url->getHost());
@@ -316,7 +316,7 @@ public function setPost(array $data) : static
316316
#[Pure]
317317
public function hasFiles() : bool
318318
{
319-
return ! empty($this->files);
319+
return !empty($this->files);
320320
}
321321

322322
/**
@@ -479,7 +479,8 @@ public function removeHeaders() : static
479479
*/
480480
public function setBasicAuth(
481481
string $username,
482-
#[SensitiveParameter] string $password
482+
#[SensitiveParameter]
483+
string $password
483484
) : static {
484485
return $this->setHeader(
485486
RequestHeader::AUTHORIZATION,
@@ -633,7 +634,7 @@ public function getOption(int $option) : mixed
633634
*/
634635
public function getPostAndFiles() : array | string
635636
{
636-
if ( ! $this->hasFiles()) {
637+
if (!$this->hasFiles()) {
637638
return $this->getBody();
638639
}
639640
\parse_str($this->getBody(), $post);
@@ -648,7 +649,7 @@ public function getPostAndFiles() : array | string
648649
if ($file instanceof CURLFile || $file instanceof CURLStringFile) {
649650
continue;
650651
}
651-
if ( ! \is_file($file)) {
652+
if (!\is_file($file)) {
652653
throw new InvalidArgumentException(
653654
"Field '{$field}' does not match a file: {$file}"
654655
);

0 commit comments

Comments
 (0)