-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
944b629
commit 01259f5
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace WebmozartAssertBug150; | ||
|
||
use Webmozart\Assert\Assert; | ||
use function PHPStan\Testing\assertType; | ||
|
||
class Bug150 | ||
{ | ||
|
||
public function doFoo($data): void | ||
{ | ||
Assert::isArray($data); | ||
Assert::keyExists($data, 'sniffs'); | ||
Assert::isArray($data['sniffs']); | ||
assertType("array&hasOffsetValue('sniffs', array)", $data); | ||
|
||
foreach ($data['sniffs'] as $sniffName) { | ||
Assert::string($sniffName); | ||
Assert::classExists($sniffName); | ||
assertType('class-string', $sniffName); | ||
Assert::implementsInterface($sniffName, SniffInterface::class); | ||
assertType('class-string<WebmozartAssertBug150\SniffInterface>', $sniffName); | ||
} | ||
} | ||
|
||
} | ||
|
||
interface SniffInterface {} |