for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WsdlToPhp\PackageGenerator\File\Validation;
class StringRule extends AbstractRule
{
/**
* @return string
*/
public function name()
return 'string';
}
* @param string $parameterName
* @param mixed $value
* @param bool $itemType
public function testConditions($parameterName, $value, $itemType = false)
return sprintf('!is_null($%1$s) && !is_string($%1$s)', $parameterName);
public function exceptionMessageOnTestFailure($parameterName, $value, $itemType = false)
return sprintf('sprintf(\'Invalid value %%s, please provide a string, %%s given\', var_export($%1$s, true), gettype($%1$s))', $parameterName);