Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added asResource() method #13

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Added asResource() method #13

wants to merge 4 commits into from

Conversation

pascalbaljet
Copy link
Collaborator

$variable = type($variable)->asResource();

types/AsResourceTest.php Outdated Show resolved Hide resolved
Co-authored-by: Faissal Wahabali <[email protected]>

$resource = fopen('php://memory', 'r');
$variable = random_int(0, 1) !== 0 ? 'string' : $resource;
assertType('resource', $variable = type($variable)->asResource());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the typed variable as the resource can also be false

types/AsResourceTest.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants