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

Replace HeaderBag attributes with simple Message properties #132

Merged
merged 2 commits into from
Jul 9, 2019

Conversation

clue
Copy link
Member

@clue clue commented Jul 9, 2019

This changeset replaces the existing HeaderBag class with a simpler API using properties in the Message class. This class is quite low level and directly maps to the field names in the DNS protocol messages, so it shares the same names for its properties. These APIs are somewhat internal and it's unlikely this will affect many consumers of this package.

// old
assert($message->header->get('id') !== 0);
assert($message->header->isTruncated() === false);

// new
assert($message->id !== 0);
assert($message->tc === false);

Among others, this also resolves a temporal dependence in the previous layout, because the headers now longer have to be "prepared" after performing modifications on the message.

Builds on top of #130
Refs #128

@clue clue added this to the v1.0.0 milestone Jul 9, 2019
@WyriHaximus WyriHaximus requested review from WyriHaximus and jsor July 9, 2019 18:28
@jsor jsor merged commit 1b331dd into reactphp:master Jul 9, 2019
@clue clue deleted the message-properties branch July 9, 2019 20:27
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.

3 participants