Skip to content

Commit

Permalink
Add CallMethodsRuleTest
Browse files Browse the repository at this point in the history
  • Loading branch information
blankse committed Nov 28, 2022
1 parent c94e9d8 commit bd268c5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2675,4 +2675,13 @@ public function testBug5623(): void
$this->analyse([__DIR__ . '/data/bug-5623.php'], []);
}

public function testImagickPixel(): void
{
$this->checkThisOnly = false;
$this->checkNullables = false;
$this->checkUnionTypes = true;
$this->checkExplicitMixed = false;
$this->analyse([__DIR__ . '/data/imagick-pixel.php'], []);
}

}
16 changes: 16 additions & 0 deletions tests/PHPStan/Rules/Methods/data/imagick-pixel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php declare(strict_types = 1);

namespace ImagickPixelParam;

use ImagickPixel;

class HelloWorld
{
public function sayHello(ImagickPixel $pixel): void
{
$pixel->getColor();
$pixel->getColor(0);
$pixel->getColor(1);
$pixel->getColor(2);
}
}

0 comments on commit bd268c5

Please sign in to comment.