for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Yii\Cycle\Data\Reader\Processor;
use Cycle\ORM\Select\QueryBuilder;
final class All extends GroupProcessor
{
public function getOperator(): string
return 'and';
}
public function getAsWhereArguments(array $arguments, array $processors): array
$this->validateArguments($arguments);
return [
static function (QueryBuilder $select) use ($arguments, $processors) {
foreach ($arguments[0] as $subFilter) {
$operation = array_shift($subFilter);
$processor = $processors[$operation] ?? null;
if ($processor === null) {
throw new \RuntimeException(sprintf('Filter operator "%s" is not supported.', $operation));
/* @var $processor QueryBuilderProcessor */
$select->where(...$processor->getAsWhereArguments($subFilter, $processors));
},
];