Null Validator

This commit is contained in:
Chris Boden 2014-09-10 21:21:00 -04:00
parent b685f6c928
commit d1376d824a
3 changed files with 20 additions and 0 deletions

View 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;
}
}

View File

@ -1,6 +1,9 @@
<?php
namespace Ratchet\RFC6455\Encoding;
/**
* @deprecated - Use NullValidator
*/
class ToggleableValidator implements ValidatorInterface {
/**
* Toggle if checkEncoding checks the encoding or not

View File

@ -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