Ratchet\WebSocket\Version\RFC6455::__construct PHP Method

__construct() public method

public __construct ( Ratchet\WebSocket\Encoding\ValidatorInterface $validator = null )
$validator Ratchet\WebSocket\Encoding\ValidatorInterface
    public function __construct(ValidatorInterface $validator = null)
    {
        $this->_verifier = new HandshakeVerifier();
        $this->setCloseCodes();
        if (null === $validator) {
            $validator = new Validator();
        }
        $this->validator = $validator;
    }

Usage Example

Example #1
0
 /**
  * @param ValidatorInterface|null $validator
  */
 public function __construct(ValidatorInterface $validator = null)
 {
     parent::__construct($validator);
     $this->verifier = new HandshakeVerifier();
 }