for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SmartWeb\ModuleTesting\ExpressionLanguage\Functions\String;
use SmartWeb\ModuleTesting\ExpressionLanguage\Functions\BaseExpressionFunction;
/**
* ExpressionFunction for converting input string to lower-case.
*
* @package SmartWeb\ModuleTesting\ExpressionLanguage\Functions
*/
class Lowercase extends BaseExpressionFunction
{
* @inheritDoc
protected function init()
}
protected function provideCompiler() : callable
return function ($str)
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str);
};
protected function provideEvaluator() : callable
return function ($arguments, $str)
if (!is_string($str)) {
return $str;
return strtolower($str);