for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helix\DB;
/**
* A basic expression, exempt from being quoted.
*
* @method static ExpressionInterface avg($column)
* @method static ExpressionInterface count($column)
* @method static ExpressionInterface max($column)
* @method static ExpressionInterface min($column)
* @method static ExpressionInterface sum($column)
*/
class Expression implements ExpressionInterface {
* @var string
protected $string;
* Converts a camelCase method call to an UPPER_SNAKE_CASE function call,
* with all arguments separated by spaces.
* `NAME(argument [argument...])`
* @param string $name
* @param array $arguments
* @return ExpressionInterface
public static function __callStatic (string $name, array $arguments): ExpressionInterface {
$arguments = implode(' ', $arguments);
$name = strtoupper(preg_replace('/(?<!^)[A-Z]/', '_$0', $name));
return new static("{$name}({$arguments})");
}
* @param string $string
public function __construct (string $string) {
$this->string = $string;
* @return string
public function __toString () {
return $this->string;