Skip to content

Commit

Permalink
PhpStorm does not know it should import Position in phpstan parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
inxomnyaa committed Dec 23, 2020
1 parent 9cf3030 commit 6b05dc6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/xenialdan/MagicWE2/clipboard/RevertClipboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RevertClipboard extends Clipboard
public $chunks = [];
/**
* @var array[]
* @phpstan-var array<array{int, Position|null}>
* @phpstan-var array<array{int, \pocketmine\world\Position|null}>
*/
public $blocksAfter;

Expand All @@ -25,7 +25,7 @@ class RevertClipboard extends Clipboard
* @param int $worldId
* @param Chunk[] $chunks
* @param array[] $blocksAfter //CHANGED AS HACK
* @phpstan-param array<array{int, Position|null}> $blocksAfter
* @phpstan-param array<array{int, \pocketmine\world\Position|null}> $blocksAfter
*/
public function __construct(int $worldId, array $chunks = [], array $blocksAfter = [])
{
Expand Down
2 changes: 1 addition & 1 deletion src/xenialdan/MagicWE2/task/AsyncFillTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function onRun(): void
* @param Block[] $newBlocks
* @param null|int $changed
* @return Generator|array[]
* @phpstan-return Generator<int, array{int, Position|null}, void, void>
* @phpstan-return Generator<int, array{int, \pocketmine\world\Position|null}, void, void>
* @throws Exception
*/
private function execute(Selection $selection, AsyncChunkManager $manager, array $newBlocks, ?int &$changed): Generator
Expand Down
2 changes: 1 addition & 1 deletion src/xenialdan/MagicWE2/task/AsyncPasteTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function onRun(): void
* @param SingleClipboard $clipboard
* @param null|int $changed
* @return Generator|array[]
* @phpstan-return Generator<int, array{int, Position|null}, void, void>
* @phpstan-return Generator<int, array{int, \pocketmine\world\Position|null}, void, void>
* @throws InvalidArgumentException
*/
private function execute(Selection $selection, AsyncChunkManager $manager, SingleClipboard $clipboard, ?int &$changed): Generator
Expand Down
18 changes: 9 additions & 9 deletions src/xenialdan/MagicWE2/task/AsyncReplaceTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ public function onRun(): void
}

/**
* @param Selection $selection
* @param AsyncChunkManager $manager
* @param array $replaceBlocks
* @param Block[] $newBlocks
* @param null|int $changed
* @return Generator|array[]
* @phpstan-return Generator<int, array{int, Position|null}, void, void>
* @throws Exception
*/
* @param Selection $selection
* @param AsyncChunkManager $manager
* @param array $replaceBlocks
* @param Block[] $newBlocks
* @param null|int $changed
* @return Generator|array[]
* @phpstan-return Generator<int, array{int, \pocketmine\world\Position|null}, void, void>
* @throws Exception
*/
private function execute(Selection $selection, AsyncChunkManager $manager, array $replaceBlocks, array $newBlocks, ?int &$changed): Generator
{
$blockCount = $selection->getShape()->getTotalCount();
Expand Down
4 changes: 2 additions & 2 deletions src/xenialdan/MagicWE2/task/AsyncRevertTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function onRun(): void
* @param AsyncChunkManager $manager
* @param RevertClipboard $clipboard
* @return Generator|array[]
* @phpstan-return Generator<int, array{int, Position|null}, void, void>
* @phpstan-return Generator<int, array{int, \pocketmine\world\Position|null}, void, void>
* @throws InvalidArgumentException
*/
private function undoChunks(AsyncChunkManager $manager, RevertClipboard $clipboard): Generator
Expand All @@ -89,7 +89,7 @@ private function undoChunks(AsyncChunkManager $manager, RevertClipboard $clipboa
* @param AsyncChunkManager $manager
* @param RevertClipboard $clipboard
* @return Generator|array[]
* @phpstan-return Generator<int, array{int, Position|null}, void, void>
* @phpstan-return Generator<int, array{int, \pocketmine\world\Position|null}, void, void>
* @throws InvalidArgumentException
*/
private function redoChunks(AsyncChunkManager $manager, RevertClipboard $clipboard): Generator
Expand Down
2 changes: 1 addition & 1 deletion src/xenialdan/MagicWE2/tool/Flood.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private function getCenter(): Vector3
/**
* Creates a chunk manager used for async editing
* @param Chunk[] $chunks
* @phpstan-param array<int, Chunk>
* @phpstan-param array<int, Chunk> $chunks
* @return AsyncChunkManager
*/
public static function getChunkManager(array $chunks): AsyncChunkManager
Expand Down

0 comments on commit 6b05dc6

Please sign in to comment.