for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Type validator
*
* @category Venus
* @package Venus\lib\Validator
* @author Judicaël Paquet <[email protected]>
* @copyright Copyright (c) 2013-2014 PAQUET Judicaël FR Inc. (https://github.com/las93)
* @license https://github.com/las93/venus2/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël
* @version Release: 1.0.0
* @filesource https://github.com/las93/venus2
* @link https://github.com/las93
* @since 1.0
*/
namespace Venus\lib\Validator;
class Type extends Common
{
* type
* @var type
private $_sType = '';
* constructor
* @access public
* @param string $sType type
* @return Type
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct(string $sType)
$this->_sType = $sType;
$sType
string
object<Venus\lib\Validator\Type>
$_sType
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
* validate the Type
* @param string $sValue
* @return bool
public function validate(string $sValue = null) : bool
if ($this->_sType == 'DateTime') {
if (preg_match('#^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}#', $sValue)) {
return true;
return false;
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.