Skip to content

Commit

Permalink
[2.x] Supports PHPStan 2 (#100)
Browse files Browse the repository at this point in the history
* [2.x] Supports PHPStan 2

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

---------

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Nov 12, 2024
1 parent b1861be commit 03e3337
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 2 additions & 2 deletions src/SerializableClosure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Serializers/Signed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Signers/Hmac.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/Support/ClosureStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class ClosureStream
{
/**
* The stream protocol.
*
* @var string
*/
const STREAM_PROTO = 'laravel-serializable-closure';

Expand Down
4 changes: 2 additions & 2 deletions src/UnsignedSerializableClosure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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)
Expand Down

0 comments on commit 03e3337

Please sign in to comment.