Skip to content

Commit

Permalink
dev: PHPStan updated to v2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Feb 8, 2025
1 parent 9fa4aae commit 35ea587
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"laravel/scout": "^10.8.0",
"larastan/larastan": "^3.0.2",
"orchestra/testbench": "^9.0.0",
"phpstan/phpstan": "2.1.1",
"phpstan/phpstan": "2.1.3",
"phpstan/phpstan-mockery": "^2.0.0",
"phpstan/phpstan-phpunit": "^2.0.3",
"phpstan/phpstan-strict-rules": "^2.0.1",
Expand Down
12 changes: 6 additions & 6 deletions packages/serializer/src/Casts/SerializedAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ public function testGet(): void {
$serializer = $this->app()->make(Serializer::class);
$attribute = new SerializedAttribute($serializer, SerializedAttributeTest__Serializable::class);
$expected = new SerializedAttributeTest__Serializable('value');
$actual = ($attribute->get)('{"property":"value"}');
$actual = ($attribute->get)('{"property":"value"}', []);

self::assertEquals($expected, $actual);
}

public function testGetNull(): void {
$serializer = $this->app()->make(Serializer::class);
$attribute = new SerializedAttribute($serializer, SerializedAttributeTest__Serializable::class);
$actual = ($attribute->get)(null);
$actual = ($attribute->get)(null, []);

self::assertNull($actual);
}
Expand All @@ -48,22 +48,22 @@ public function testGetTypeNotMatch(): void {
$serializer = $this->app()->make(Serializer::class);
$attribute = new SerializedAttribute($serializer, SerializedAttributeTest__Serializable::class);

($attribute->get)(123);
($attribute->get)(123, []);
}

public function testSet(): void {
$serializer = $this->app()->make(Serializer::class);
$attribute = new SerializedAttribute($serializer, SerializedAttributeTest__Serializable::class);
$expected = '{"property":"value"}';
$actual = ($attribute->set)(new SerializedAttributeTest__Serializable('value'));
$actual = ($attribute->set)(new SerializedAttributeTest__Serializable('value'), []);

self::assertEquals($expected, $actual);
}

public function testSetNull(): void {
$serializer = $this->app()->make(Serializer::class);
$attribute = new SerializedAttribute($serializer, SerializedAttributeTest__Serializable::class);
$actual = ($attribute->set)(null);
$actual = ($attribute->set)(null, []);

self::assertNull($actual);
}
Expand All @@ -81,7 +81,7 @@ public function testSetTypeNotMatch(): void {
$serializer = $this->app()->make(Serializer::class);
$attribute = new SerializedAttribute($serializer, SerializedAttributeTest__Serializable::class);

($attribute->set)(new stdClass());
($attribute->set)(new stdClass(), []);
}

public function testModelAttribute(): void {
Expand Down
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ parameters:
count: 1
path: packages/graphql/src/Testing/Package/Directives/ExposeBuilderDirective.php

-
message: '#^Callable callable\(\)\: \(object\|null\) invoked with 1 parameter, 0 required\.$#'
identifier: arguments.count
count: 3
path: packages/serializer/src/Casts/SerializedAttributeTest.php

-
message: '#^Parameter \#2 \$typesMapping of class Symfony\\Component\\Serializer\\Mapping\\ClassDiscriminatorMapping constructor expects array\<string, string\>, array given\.$#'
identifier: argument.type
Expand Down
13 changes: 4 additions & 9 deletions phpstan-larastan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,17 @@ services:
- phpstan.broker.dynamicFunctionReturnTypeExtension

-
class: Larastan\Larastan\ReturnTypes\CollectionFilterRejectDynamicReturnTypeExtension
class: Larastan\Larastan\ReturnTypes\Helpers\LiteralExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
- phpstan.broker.dynamicFunctionReturnTypeExtension

-
class: Larastan\Larastan\ReturnTypes\CollectionWhereNotNullDynamicReturnTypeExtension
class: Larastan\Larastan\ReturnTypes\CollectionFilterRejectDynamicReturnTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension

-
class: Larastan\Larastan\ReturnTypes\EnumerableGenericStaticMethodDynamicMethodReturnTypeExtension
class: Larastan\Larastan\ReturnTypes\CollectionWhereNotNullDynamicReturnTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension

Expand All @@ -277,11 +277,6 @@ services:
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension

-
class: Larastan\Larastan\ReturnTypes\EnumerableGenericStaticMethodDynamicStaticMethodReturnTypeExtension
tags:
- phpstan.broker.dynamicStaticMethodReturnTypeExtension

-
class: Larastan\Larastan\Types\AbortIfFunctionTypeSpecifyingExtension
tags:
Expand Down

0 comments on commit 35ea587

Please sign in to comment.