Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function constructEvent($sigHeader, $payload, $secret, $tolerance)
* @param string $payload Body of the webhook
* @param string $secret Webhook secret from the WorkOS dashboard
* @param int $tolerance Number of seconds old the webhook can be before it's invalid
* @return bool true
* @return string 'pass' if valid, otherwise an error message
*/
public function verifyHeader($sigHeader, $payload, $secret, $tolerance)
Copy link
Contributor

Choose a reason for hiding this comment

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

The docblock now correctly documents the return type as string, but the method signature itself has no enforced PHP return type. Adding : string would make the contract machine-checkable and consistent with the corrected docblock.

Suggested change
public function verifyHeader($sigHeader, $payload, $secret, $tolerance)
public function verifyHeader($sigHeader, $payload, $secret, $tolerance): string

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

{
Expand Down