Skip to content

Commit 16c4cbd

Browse files
committed
style: Disable not_operator_with_successor_space rule
1 parent 843348c commit 16c4cbd

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

pint.json

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"no_useless_nullsafe_operator": true,
6161
"no_useless_return": true,
6262
"no_whitespace_before_comma_in_array": true,
63+
"not_operator_with_successor_space": false,
6364
"nullable_type_declaration": true,
6465
"object_operator_without_whitespace": true,
6566
"ordered_imports": {

src/Http/Message.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function getHeaders(): array
6565
#[Override]
6666
public function getBody(): StreamInterface
6767
{
68-
if (! $this->body instanceof StreamInterface) {
68+
if (!$this->body instanceof StreamInterface) {
6969
return Stream::fromFileMode('r+');
7070
}
7171

@@ -188,7 +188,7 @@ public function withoutHeader(string $name): MessageInterface
188188
#[Override]
189189
public function withBody(StreamInterface $body): MessageInterface
190190
{
191-
if (! $body->isReadable()) {
191+
if (!$body->isReadable()) {
192192
throw new InvalidArgumentException('Body stream must be readable');
193193
}
194194

@@ -211,7 +211,7 @@ private function assertHeader(string $name, array | float | int | string $value)
211211

212212
if (is_array($value)) {
213213
foreach ($value as &$val) {
214-
if (! is_string($val) && ! is_numeric($val)) {
214+
if (!is_string($val) && !is_numeric($val)) {
215215
throw new InvalidArgumentException('Values must a string or numeric');
216216
}
217217
}

src/Http/Request.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ public function withUri(UriInterface $uri, bool $preserveHost = false): self
250250

251251
if ($preserveHost === true) {
252252
// Update only if the Host header is missing or empty, and the new URI contains a host component
253-
if ($cloned->headers->isEmpty(HeaderField::HOST) && ! empty($uri->getHost())) {
253+
if ($cloned->headers->isEmpty(HeaderField::HOST) && !empty($uri->getHost())) {
254254
$cloned->headers->replace($newHost);
255255
}
256-
} elseif (! empty($uri->getHost())) {
256+
} elseif (!empty($uri->getHost())) {
257257
// Default: Update the Host header if the URI contains a host component
258258
$cloned->headers->replace($newHost);
259259
}
@@ -339,7 +339,7 @@ private function assertValidMethod(string $method): void
339339
self::METHOD_HEAD,
340340
];
341341

342-
if (! in_array(strtoupper($method), $validMethods)) {
342+
if (!in_array(strtoupper($method), $validMethods)) {
343343
throw new InvalidArgumentException("method: $method is invalid");
344344
}
345345
}

src/Stream/Stream.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Stream implements AppendableStream
4040
*/
4141
private function __construct(mixed $resource)
4242
{
43-
if (! is_resource($resource)) {
43+
if (!is_resource($resource)) {
4444
throw new RuntimeException('Invalid resource');
4545
}
4646

@@ -99,7 +99,7 @@ public static function fromFile(string $file, string $mode = 'r+'): self
9999
{
100100
$resource = fopen($file, $mode);
101101

102-
if (! is_resource($resource)) {
102+
if (!is_resource($resource)) {
103103
throw new RuntimeException("Can't open file $file");
104104
}
105105

@@ -131,7 +131,7 @@ public function appendStream(AppendableStream $stream): int
131131
$this->assertStreamIsNotDetached();
132132
$this->assertStreamIsWriteable();
133133

134-
if (! $stream->isReadable()) {
134+
if (!$stream->isReadable()) {
135135
throw new RuntimeException("Can't append not readable stream");
136136
}
137137

@@ -160,7 +160,7 @@ public function getResource(): mixed
160160
#[Override]
161161
public function close(): void
162162
{
163-
if (! is_resource($this->resource)) {
163+
if (!is_resource($this->resource)) {
164164
return;
165165
}
166166

@@ -186,7 +186,7 @@ public function detach()
186186
#[Override]
187187
public function getSize(): ?int
188188
{
189-
if (! is_resource($this->resource)) {
189+
if (!is_resource($this->resource)) {
190190
return null;
191191
}
192192

@@ -217,7 +217,7 @@ public function tell(): int
217217
#[Override]
218218
public function eof(): bool
219219
{
220-
if (! is_resource($this->resource)) {
220+
if (!is_resource($this->resource)) {
221221
// php.net doc: feof returns TRUE if the file pointer is at EOF or an error occurs
222222
return true;
223223
}
@@ -231,7 +231,7 @@ public function eof(): bool
231231
#[Override]
232232
public function isSeekable(): bool
233233
{
234-
if (! is_resource($this->resource)) {
234+
if (!is_resource($this->resource)) {
235235
return false;
236236
}
237237

@@ -267,7 +267,7 @@ public function rewind(): void
267267
{
268268
$this->assertStreamIsNotDetached();
269269

270-
if (! $this->isSeekable()) {
270+
if (!$this->isSeekable()) {
271271
throw new RuntimeException('Stream is not seekable');
272272
}
273273

@@ -298,7 +298,7 @@ public function write(string $string): int
298298
#[Override]
299299
public function isWritable(): bool
300300
{
301-
if (! is_resource($this->resource)) {
301+
if (!is_resource($this->resource)) {
302302
return false;
303303
}
304304

@@ -319,7 +319,7 @@ public function isWritable(): bool
319319
#[Override]
320320
public function isReadable(): bool
321321
{
322-
if (! is_resource($this->resource)) {
322+
if (!is_resource($this->resource)) {
323323
return false;
324324
}
325325

@@ -401,7 +401,7 @@ private function assertStreamIsNotDetached(): void
401401
*/
402402
private function assertStreamIsReadable(): void
403403
{
404-
if (! $this->isReadable()) {
404+
if (!$this->isReadable()) {
405405
throw new RuntimeException('Stream is not readable');
406406
}
407407
}
@@ -411,7 +411,7 @@ private function assertStreamIsReadable(): void
411411
*/
412412
private function assertStreamIsWriteable(): void
413413
{
414-
if (! $this->isWritable()) {
414+
if (!$this->isWritable()) {
415415
throw new RuntimeException('Stream is not writeable');
416416
}
417417
}

0 commit comments

Comments
 (0)