Skip to content

Add dedicated StreamBucket class#13111

Merged
kocsismate merged 4 commits into
php:masterfrom
kocsismate:stream-bucket-class
Apr 11, 2024
Merged

Add dedicated StreamBucket class#13111
kocsismate merged 4 commits into
php:masterfrom
kocsismate:stream-bucket-class

Conversation

@kocsismate

@kocsismate kocsismate commented Jan 9, 2024

Copy link
Copy Markdown
Member

Comment thread ext/standard/user_filters.c Outdated
Comment thread ext/standard/user_filters.c Outdated
Comment thread ext/standard/user_filters.c Outdated

@bukka bukka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is not right way. You are trying to use StreamBucket for two distinct things. I think the primary work here should be to get rid of resource bucket object. This is visible to users only through the bucket property. I would imaging we should rather call it StreamBucketHandle and it should be opaque. Another thing is replacing the actual object returned by changed function which is currently just stdClass. It would make sense to eventually change it to typed class that could be called StreamBucket but that's really something different and those two things should not be combined together IMO

Comment thread ext/standard/user_filters.c Outdated
Comment thread ext/standard/user_filters.c Outdated
Comment thread ext/standard/user_filters.c Outdated
Comment thread ext/standard/basic_functions.stub.php Outdated
Comment thread ext/standard/user_filters.stub.php Outdated
Comment thread ext/standard/user_filters.stub.php Outdated

@bukka bukka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry I somehow thought that it's supposed to replace the stream bucket resource which is not the case here.

Comment thread ext/standard/user_filters.c Outdated
Comment thread ext/standard/user_filters.c Outdated
Comment thread ext/standard/basic_functions.stub.php Outdated
Comment thread ext/standard/tests/file/bug39551.phpt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As you're really only interested in the class, perhaps use:

echo get_class($bucket), "\n";

Then you don't have to update the test later when bucket becomes an object, or datalen becomes dataLength.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It would be good idea if there were other tests which ensured the structure of StreamBucket. But I'd prefer to keep this test as-is in this case, since that's the only place where the properties are displayed.

Comment thread ext/standard/user_filters.c Outdated
@kocsismate kocsismate force-pushed the stream-bucket-class branch from 1db667c to 26ae64d Compare April 9, 2024 20:40
Comment thread ext/standard/user_filters.c Outdated

@bukka bukka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants