Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jan 7, 2025
1 parent 8cb4567 commit 53db374
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/tag/CompoundTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ public function setString(string $name, string $value) : self{
}

/**
* @param int[] $value
* @param int[] $value
* @phpstan-param list<int> $value
*
* @return $this
*/
Expand Down
28 changes: 18 additions & 10 deletions tests/phpstan/configs/impossible-mixed.neon
Original file line number Diff line number Diff line change
@@ -1,47 +1,55 @@
parameters:
ignoreErrors:
-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getByte\\(\\) should return int but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getByte\(\) should return int but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getByteArray\\(\\) should return string but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getByteArray\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getDouble\\(\\) should return float but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getDouble\(\) should return float but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getFloat\\(\\) should return float but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getFloat\(\) should return float but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getInt\\(\\) should return int but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getInt\(\) should return int but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getIntArray\\(\\) should return array\\<int\\> but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getIntArray\(\) should return array\<int\> but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getLong\\(\\) should return int but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getLong\(\) should return int but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getShort\\(\\) should return int but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getShort\(\) should return int but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

-
message: "#^Method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:getString\\(\\) should return string but returns mixed\\.$#"
message: '#^Method pocketmine\\nbt\\tag\\CompoundTag\:\:getString\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: ../../../src/tag/CompoundTag.php

8 changes: 7 additions & 1 deletion tests/phpstan/configs/phpstan-bugs.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
parameters:
ignoreErrors:
-
message: "#^Call to function is_int\\(\\) with int will always evaluate to true\\.$#"
message: '#^Call to function is_int\(\) with int will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../src/tag/IntArrayTag.php

-
message: '#^Parameter \#1 \$array \(list\<int\>\) of array_values is already a list, call has no effect\.$#'
identifier: arrayValues.list
count: 1
path: ../../../src/tag/IntArrayTag.php

0 comments on commit 53db374

Please sign in to comment.