diff --git a/src/Encoding/NullValidator.php b/src/Encoding/NullValidator.php new file mode 100644 index 0000000..5db53c8 --- /dev/null +++ b/src/Encoding/NullValidator.php @@ -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; + } +} \ No newline at end of file diff --git a/src/Encoding/ToggleableValidator.php b/src/Encoding/ToggleableValidator.php index 46152e4..3178bbc 100644 --- a/src/Encoding/ToggleableValidator.php +++ b/src/Encoding/ToggleableValidator.php @@ -1,6 +1,9 @@ <?php namespace Ratchet\RFC6455\Encoding; +/** + * @deprecated - Use NullValidator + */ class ToggleableValidator implements ValidatorInterface { /** * Toggle if checkEncoding checks the encoding or not diff --git a/src/Encoding/ValidatorInterface.php b/src/Encoding/ValidatorInterface.php index b6f5c84..3870157 100644 --- a/src/Encoding/ValidatorInterface.php +++ b/src/Encoding/ValidatorInterface.php @@ -1,6 +1,9 @@ <?php namespace Ratchet\RFC6455\Encoding; +/** + * @todo Probably move this into Messaging\Validation + */ interface ValidatorInterface { /** * Verify a string matches the encoding type