Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ignore missing parameter and return types in tests
  • Loading branch information
Art4 committed Oct 8, 2024
commit 43446d521999cc1660a5a2ff8b4979658bc7b34c
14 changes: 14 additions & 0 deletions .phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,17 @@ parameters:
- vendor

treatPhpDocTypesAsCertain: false

ignoreErrors:
-
# Ignore missing or imprecise parameter types for methods in tests
message: '(^Method .+ has parameter .+ with no.* type specified.*\.$)'
path: tests
-
# Ignore imprecise return types for methods in tests
message: '(^Method .+ return type has no.* type specified.+\.$)'
path: tests
-
# Ignore missing return types for methods in tests
message: '(^Method .+ has no return type specified\.$)'
path: tests
4 changes: 2 additions & 2 deletions tests/Unit/Serializer/JsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function getEncodedToNormalizedData(): array
* @dataProvider getEncodedToNormalizedData
*/
#[DataProvider('getEncodedToNormalizedData')]
public function testCreateFromStringDecodesToExpectedNormalizedData(string $data, $expected): void
public function testCreateFromStringDecodesToExpectedNormalizedData(string $data, string $expected): void
{
$serializer = JsonSerializer::createFromString($data);

Expand Down Expand Up @@ -184,7 +184,7 @@ public static function getNormalizedToEncodedData(): array
* @dataProvider getNormalizedToEncodedData
*/
#[DataProvider('getNormalizedToEncodedData')]
public function testCreateFromArrayEncodesToExpectedString(array $data, $expected): void
public function testCreateFromArrayEncodesToExpectedString(array $data, string $expected): void
{
$serializer = JsonSerializer::createFromArray($data);

Expand Down
8 changes: 0 additions & 8 deletions tests/Unit/Serializer/XmlSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ public function testCreateFromArrayEncodesToExpectedString(array $data, $expecte
$this->assertXmlStringEqualsXmlString($expected, $serializer->__toString());
}

/**
* @return array<string,mixed>
*/
public static function getNormalizedToEncodedData(): array
{
return [
Expand Down Expand Up @@ -301,8 +298,6 @@ public static function getNormalizedToEncodedData(): array

/**
* @dataProvider getInvalidSerializedData
*
* @param array<int,mixed> $data
*/
#[DataProvider('getInvalidSerializedData')]
public function testCreateFromArrayWithInvalidDataThrowsException(string $message, array $data): void
Expand All @@ -313,9 +308,6 @@ public function testCreateFromArrayWithInvalidDataThrowsException(string $messag
XmlSerializer::createFromArray($data);
}

/**
* @return array<string,mixed>
*/
public static function getInvalidSerializedData(): array
{
return [
Expand Down
Loading