for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Puzzle\QueryBuilder\Conditions;
use Puzzle\QueryBuilder\Escaper;
use Puzzle\QueryBuilder\Query;
class Statement extends AbstractCondition
{
private
$statement;
$statement
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
class A { var $property; }
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.
public function __construct($statement)
$this->statement = $statement;
}
public function toString(Escaper $escaper): string
if($this->isEmpty())
return '';
$statement = $this->statement;
if($this->statement instanceof Query)
$this->statement->setEscaper($escaper);
$statement = $this->wrapWithParenthesis($this->statement->toString());
return (string) $statement;
private function wrapWithParenthesis(string $value): string
return sprintf('(%s)', $value);
public function isEmpty(): bool
return empty($this->statement);
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.