Null Validator
This commit is contained in:
parent
b685f6c928
commit
d1376d824a
14
src/Encoding/NullValidator.php
Normal file
14
src/Encoding/NullValidator.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
namespace Ratchet\RFC6455\Encoding;
|
||||||
|
|
||||||
|
class NullValidator implements ValidatorInterface {
|
||||||
|
/**
|
||||||
|
* What value to return when checkEncoding is valled
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
public $validationResponse = true;
|
||||||
|
|
||||||
|
public function checkEncoding($str, $encoding) {
|
||||||
|
return (boolean)$this->validationResponse;
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Ratchet\RFC6455\Encoding;
|
namespace Ratchet\RFC6455\Encoding;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated - Use NullValidator
|
||||||
|
*/
|
||||||
class ToggleableValidator implements ValidatorInterface {
|
class ToggleableValidator implements ValidatorInterface {
|
||||||
/**
|
/**
|
||||||
* Toggle if checkEncoding checks the encoding or not
|
* Toggle if checkEncoding checks the encoding or not
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Ratchet\RFC6455\Encoding;
|
namespace Ratchet\RFC6455\Encoding;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Probably move this into Messaging\Validation
|
||||||
|
*/
|
||||||
interface ValidatorInterface {
|
interface ValidatorInterface {
|
||||||
/**
|
/**
|
||||||
* Verify a string matches the encoding type
|
* Verify a string matches the encoding type
|
||||||
|
Loading…
Reference in New Issue
Block a user