thephpleague / flysystem

Abstraction for local and remote filesystems

Home Page:https://flysystem.thephpleague.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StreamWrapper and assertIsResource compatibility

vitvavra opened this issue · comments

Question

I have question about
League\Flysystem\Filesystem::assertIsResource method.

Is there any reason i do not understand, why the method should not accept "stream_context" alongside with "stream"?
As far as i know, it is produced when streamWrapper type class is used for the get_resource_type(); call. And the use for this case should be identical, or am i missing something?

Q A
Flysystem Version 3.27.0
Adapter Name N/A
Adapter version N/A

I've added an explicit test for writing using a stream-wrapper, which succeeds. Not sure what problem you're running into: b744531

Ok, yes, I am dumb and should not be using Copilot no more.
I was mislead around the api of StreamWrapper from Guzzle with the ::getResource and ::createStreamContext methods

Anyways the message is incorrect. When you pass something that is not stream, it gets evaluated correctly but there are missing parentheses, so it does end up as a 1 instead of context type.