Support for Members and Membership type, status and include objects#114
Support for Members and Membership type, status and include objects#114
Conversation
| * @param string $ch | ||
| * @return $this | ||
| */ | ||
| public function channel($ch) |
There was a problem hiding this comment.
What about:
public function channel(string $ch): self
?
There was a problem hiding this comment.
I would check all files in this PR for this unification.
There was a problem hiding this comment.
hopefully I didn't miss anything
| protected bool $endpointAuthRequired = true; | ||
| protected string $endpointHttpMethod = PNHttpMethod::PATCH; | ||
| protected int $endpointOperationType = PNOperationType::PNRemoveMembersOperation; | ||
| protected string $endpointName = "ManageMembers"; |
There was a problem hiding this comment.
yep. it's to lower the amount of copypaste between files. Down at the bottom you see that I removed a lot of boilerplate methods and in the meantime in Endpoint class I expose the values through proper methods
|
|
||
| /** | ||
| * @param string $ch | ||
| * @return $this |
There was a problem hiding this comment.
Shouldn't be:
public function channel(string $ch): self
?
There was a problem hiding this comment.
I would check all files in this PR for this unification.
| * | ||
| * @return $this | ||
| */ | ||
| public function uuids($uuids) |
There was a problem hiding this comment.
Shouldn't be:
public function uuids(array $uuids): self
?
There was a problem hiding this comment.
it's a bit more complex than just say it's an array (phpStan watches for doc block describing what type of input it should be and since it is deprecated I omited it
| * @param PNChannelMember[] $members | ||
| * @return $this | ||
| */ | ||
| public function members(array $members) |
There was a problem hiding this comment.
Shouldn't be:
public function members(array $members): self
?
| $this->status = $status; | ||
| } | ||
|
|
||
| public function setchannel(string $channel): self |
| return $this->custom; | ||
| } | ||
|
|
||
| public function getType(): string |
There was a problem hiding this comment.
What about:
public function getType(): ?string
public function getStatus(): ?string
| } | ||
|
|
||
| /** | ||
| * @return string[] | \StdClass |
There was a problem hiding this comment.
well not exactly because mixed says it can be a primitive type yet here we may have an array or an StdClass object so it's a bit more precise
| /** | ||
| * @return string[] | ||
| */ | ||
| public function toArray() |
There was a problem hiding this comment.
What about:
public function toArray(): array
?
| */ | ||
| function __construct($id, $name, $description, $custom = null, $updated = null, $eTag = null) | ||
| { | ||
| public function __construct( |
There was a problem hiding this comment.
What about:
public function __construct(
string $id,
string $name,
string $description,
mixed $custom = null,
?string $updated = null,
?string $eTag = null,
?string $status = null,
?string $type = null
)
?
There was a problem hiding this comment.
no. this object is made from a response so it would require more attention to do a proper strict typing, so I would leave the docblock type hints only
6725275 to
d4fc4a1
Compare
|
@pubnub-release-bot release |
|
🚀 Release successfully completed 🚀 |
feat: Support for Members and Membership type, status and include objects
Extended functionality of Channel Members and User Membership. Now it's possible to use fine-grade includes and set member/membership status and type.