-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test fixture to skip resource (#55)
- Loading branch information
1 parent
9e6a241
commit dc19a23
Showing
4 changed files
with
36 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
tests/Rules/NarrowPublicClassMethodParamTypeRule/Fixture/SkipResource.php
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,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\TypePerfect\Tests\Rules\NarrowPublicClassMethodParamTypeRule\Fixture; | ||
|
||
final class SkipResource | ||
{ | ||
/** | ||
* @param resource $resource | ||
*/ | ||
public function map($resource, string $name): void | ||
{ | ||
} | ||
|
||
public function run() | ||
{ | ||
$resource = @fsockopen('100', 100); | ||
$this->map($resource, 'name'); | ||
|
||
|
||
$resource = $this->getFileResource(); | ||
$this->map($resource, 'surname'); | ||
} | ||
|
||
/** | ||
* @return resource | ||
*/ | ||
private function getFileResource() | ||
{ | ||
return fopen('file.txt', 'r'); | ||
} | ||
} |
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