Skip to content

Commit ba80392

Browse files
author
Jonathon Hill
committed
fix: lint
1 parent e3082d7 commit ba80392

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

src/Factory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function configFromArray(array $settings): Config
3232
}
3333

3434
if (isset($settings['serialize_handler'])) {
35-
if (!is_string($settings['serialize_handler']) && !is_null($settings['serialize_handler'])) {
35+
if (!is_string($settings['serialize_handler'])) {
3636
throw new InvalidArgumentException('serialize_handler must be a string or null');
3737
}
3838
$config->setSerializeHandler(

src/Handlers/RedisHandler.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function open($path, $name): bool
5252
throw new InvalidArgumentException('Missing host or socket in $path');
5353
}
5454

55-
$port = isset($config['port']) && !is_null($config['port'])
55+
$port = isset($config['port'])
5656
? (int) $config['port']
5757
: 6379;
5858

@@ -61,7 +61,7 @@ public function open($path, $name): bool
6161
return false;
6262
}
6363

64-
$database = isset($query['database']) && !is_null($query['database'])
64+
$database = isset($query['database'])
6565
? (int) $query['database']
6666
: 0;
6767

src/Serializers/CallbackSerializer.php

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function unserialize(string $contents): array
5757
/** @var array<string, mixed> */
5858
return $decoded;
5959
}
60+
// @phpstan-ignore-next-line
6061
throw new TypeError('$unserialize must return an array when invoked');
6162
} catch (Throwable $e) {
6263
$this->lastError = $e;

src/Session.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function &__get(string $name)
5353
throw new RuntimeException('Session not initialized');
5454
}
5555

56-
if(!isset($this->contents[$name])){
56+
if(!isset($this->contents[$name])) {
5757
\trigger_error("Array key not found: '$name'", \E_USER_NOTICE);
5858
return null;
5959
}
@@ -145,8 +145,8 @@ public function &offsetGet($name): mixed
145145
}
146146

147147

148-
if(!isset($this->contents[$name])){
149-
if($name === null || \is_scalar($name) || $name instanceof Stringable){
148+
if(!isset($this->contents[$name])) {
149+
if($name === null || \is_scalar($name) || $name instanceof Stringable) {
150150
\trigger_error("Array key not found: '$name'", \E_USER_NOTICE);
151151
}
152152
return null;

tests/behavior/IdContext.php

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public function theIdMustBeAllowedCharacters(): void
118118
*/
119119
public function itMustStartWith(string $prefix): void
120120
{
121+
// @phpstan-ignore-next-line
121122
Assert::assertStringStartsWith($prefix, $this->id);
122123
}
123124

0 commit comments

Comments
 (0)