
Some checks are pending
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (client, ubuntu-22.04, 7.4) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (client, ubuntu-22.04, 8) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (client, ubuntu-22.04, 8.1) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (client, ubuntu-22.04, 8.2) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (client, ubuntu-22.04, 8.3) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (client, ubuntu-22.04, 8.4) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (server, ubuntu-22.04, 7.4) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (server, ubuntu-22.04, 8) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (server, ubuntu-22.04, 8.1) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (server, ubuntu-22.04, 8.2) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (server, ubuntu-22.04, 8.3) (push) Waiting to run
CI / PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }}) on ${{ matrix.os }} (server, ubuntu-22.04, 8.4) (push) Waiting to run
21 lines
544 B
PHP
21 lines
544 B
PHP
<?php
|
|
namespace mfmdevsystem\RFC6455\Messaging;
|
|
|
|
class CloseFrameChecker {
|
|
private array $validCloseCodes = [
|
|
Frame::CLOSE_NORMAL,
|
|
Frame::CLOSE_GOING_AWAY,
|
|
Frame::CLOSE_PROTOCOL,
|
|
Frame::CLOSE_BAD_DATA,
|
|
Frame::CLOSE_BAD_PAYLOAD,
|
|
Frame::CLOSE_POLICY,
|
|
Frame::CLOSE_TOO_BIG,
|
|
Frame::CLOSE_MAND_EXT,
|
|
Frame::CLOSE_SRV_ERR,
|
|
];
|
|
|
|
public function __invoke(int $val): bool {
|
|
return ($val >= 3000 && $val <= 4999) || in_array($val, $this->validCloseCodes);
|
|
}
|
|
}
|