diff --git a/composer.json b/composer.json index baeec8ec..8ec0440a 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "illuminate/support": "^10.0|^11.0", "nesbot/carbon": "^2.67|^3.0", "pestphp/pest": "^2.36", - "phpstan/phpstan": "^1.11.5", + "phpstan/phpstan": "^2.0", "symfony/var-dumper": "^6.2.0|^7.0.0" }, "autoload": { diff --git a/phpstan.neon b/phpstan.neon index a8ba1c62..fc62d2bc 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,5 +7,5 @@ parameters: - identifier: missingType.generics reportUnmatchedIgnoredErrors: true excludePaths: - - 'src/Support/ReflectionClosure' - - 'src/Serializers/Native' + - 'src/Support/ReflectionClosure.php' + - 'src/Serializers/Native.php' diff --git a/src/SerializableClosure.php b/src/SerializableClosure.php index dff7fb88..83a96320 100644 --- a/src/SerializableClosure.php +++ b/src/SerializableClosure.php @@ -98,7 +98,7 @@ public static function resolveUseVariablesUsing($resolver) /** * Get the serializable representation of the closure. * - * @return array + * @return array{serializable: \Laravel\SerializableClosure\Serializers\Signed|\Laravel\SerializableClosure\Contracts\Serializable} */ public function __serialize() { @@ -110,7 +110,7 @@ public function __serialize() /** * Restore the closure after serialization. * - * @param array $data + * @param array{serializable: \Laravel\SerializableClosure\Serializers\Signed|\Laravel\SerializableClosure\Contracts\Serializable} $data * @return void * * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException diff --git a/src/Serializers/Signed.php b/src/Serializers/Signed.php index 391d20d6..16f9593f 100644 --- a/src/Serializers/Signed.php +++ b/src/Serializers/Signed.php @@ -72,7 +72,7 @@ public function __serialize() /** * Restore the closure after serialization. * - * @param array $signature + * @param array{serializable: string, hash: string} $signature * @return void * * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException diff --git a/src/Signers/Hmac.php b/src/Signers/Hmac.php index d94b0a2a..41ed01ae 100644 --- a/src/Signers/Hmac.php +++ b/src/Signers/Hmac.php @@ -41,7 +41,7 @@ public function sign($serialized) /** * Verify the given signature. * - * @param array $signature + * @param array{serializable: string, hash: string} $signature * @return bool */ public function verify($signature) diff --git a/src/Support/ClosureStream.php b/src/Support/ClosureStream.php index 9f3ef6c8..717ae053 100644 --- a/src/Support/ClosureStream.php +++ b/src/Support/ClosureStream.php @@ -7,6 +7,8 @@ class ClosureStream { /** * The stream protocol. + * + * @var string */ const STREAM_PROTO = 'laravel-serializable-closure'; diff --git a/src/UnsignedSerializableClosure.php b/src/UnsignedSerializableClosure.php index f487d6d7..afc2127e 100644 --- a/src/UnsignedSerializableClosure.php +++ b/src/UnsignedSerializableClosure.php @@ -47,7 +47,7 @@ public function getClosure() /** * Get the serializable representation of the closure. * - * @return array + * @return array{serializable: \Laravel\SerializableClosure\Contracts\Serializable} */ public function __serialize() { @@ -59,7 +59,7 @@ public function __serialize() /** * Restore the closure after serialization. * - * @param array $data + * @param array{serializable: \Laravel\SerializableClosure\Contracts\Serializable} $data * @return void */ public function __unserialize($data)