We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99755dd commit f97c155Copy full SHA for f97c155
lib/Wrench/Frame/HybiFrame.php
@@ -64,6 +64,10 @@ class HybiFrame extends Frame
64
*/
65
public function encode($payload, $type = Protocol::TYPE_TEXT, $masked = false)
66
{
67
+ if (!is_int($type) || !in_array($type, Protocol::$frameTypes)) {
68
+ throw new InvalidArgumentException('Invalid frame type');
69
+ }
70
+
71
$this->type = $type;
72
$this->masked = $masked;
73
$this->payload = $payload;
0 commit comments