Pass statement block.

@param array $statements
164800
public function passStatementBlock(array $statements)
    {
        foreach ($statements as $statement) {
            switch ($statement['type']) {
                case 'let':
                    $this->passLetStatement($statement);
                    break;

                case 'echo':
                    if (isset($statement['expressions'])) {
                        foreach ($statement['expressions'] as $expr) {
                            $this->passExpression($expr);
                        }
                    }
                    break;

                case 'declare':
                    $this->declareVariables($statement);
                    break;

                case 'if':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    if (isset($statement['else_statements'])) {
                        $this->passStatementBlock($statement['else_statements']);
                    }
                    if (isset($statement['elseif_statements'])) {
                        $this->passStatementBlock($statement['elseif_statements']);
                    }
                    break;

                case 'switch':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    if (isset($statement['clauses'])) {
                        foreach ($statement['clauses'] as $clause) {
                            if (isset($clause['expr'])) {
                                $this->passExpression($clause['expr']);
                            }
                            if (isset($clause['statements'])) {
                                $this->passStatementBlock($clause['statements']);
                            }
                        }
                    }
                    break;

                case 'while':
                case 'do-while':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    break;

                case 'for':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    if (isset($statement['value'])) {
                        $this->increaseMutations($statement['value']);
                    }
                    if (isset($statement['key'])) {
                        $this->increaseMutations($statement['key']);
                    }
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    break;

                case 'return':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    break;

                case 'loop':
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    break;

                case 'try-catch':
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    if (isset($statement['catches'])) {
                        foreach ($statement['catches'] as $catch) {
                            if (isset($catch['variable'])) {
                                $this->increaseMutations($catch['variable']['value']);
                            }
                            if (isset($catch['statements'])) {
                                $this->passStatementBlock($catch['statements']);
                            }
                        }
                    }
                    break;

                case 'throw':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    break;

                case 'fetch':
                    $this->passExpression($statement['expr']);
                    break;

                case 'mcall':
                case 'scall':
                case 'fcall':
                case 'require':
                    $this->passCall($statement['expr']);
                    break;

                case 'unset':
                    if ('array-access' == $statement['expr']['type']) {
                        if ('variable' == $statement['expr']['left']['type']) {
                            $this->increaseMutations($statement['expr']['left']['value']);
                        }
                    } else {
                        if ('list' == $statement['expr']['type']) {
                            if ('array-access' == $statement['expr']['left']['type']) {
                                if ('variable' == $statement['expr']['left']['left']['type']) {
                                    $this->increaseMutations($statement['expr']['left']['left']['value']);
                                }
                            }
                        }
                    }
                    break;

                case 'break':
                case 'continue':
                case 'empty':
                case 'cblock':
                case 'comment':
                    break;

                default:
                    echo 'MutateGathererPassStatement=', $statement['type'], PHP_EOL;
            }
        }
    }
674323
private function beforePut(array &$values): void {
    $keys = array_keys($values);

    foreach($keys as &$column) {
      if(array_key_exists($column, $this->to_db)) {
        $column = $this->to_db[$column];
      }
    }

    unset($column);

    $values = array_combine($keys, array_values($values));
  }
415093
protected function processStatements(array $statements, string $prefix = ''): void
    {
        $uses = [];

        foreach ($statements as $statement) {
            if ($statement instanceof Namespace_) {
                $this->processStatements($statement->stmts, (string)$statement->name);

                return;
            }

            if ($statement instanceof Use_) {
                foreach ($statement->uses as $use) {
                    /** @var Identifier $aliasIdentifier */
                    $aliasIdentifier = $use->alias;
                    if (empty($aliasIdentifier->name)) {
                        $parts = $use->name->parts;
                        $alias = (string)end($parts);
                    } else {
                        $alias = $aliasIdentifier->name;
                    }

                    $uses[$alias] = $use->name->toString();
                }
            }

            if ($statement instanceof Class_) {
                $this->processClassStatement($statement, $prefix, $uses);
            }
        }
    }
331266
public function setUpBlockManagers(array $blocks)
    {
        foreach ($blocks as $block) {
            $blockManager = $this->blockManagerFactory->createBlockManager($block);
            if (null === $blockManager) {
                continue;
            }
            $this->blockManagersCollection->addBlockManager($blockManager);
        }
    }
1268504
public function insert($data, $statements = null)
    {
        $this->settings['type'] = 'INSERT';
        $this->settings['data'] = $data;
        $this->settings['statements'] = $statements;

        return $this;
    }
758967
public function setSequences(array $sequences)
    {
        $this->sequences = array();

        foreach ($sequences as $sequence) {
            $this->addSequence($sequence);
        }
    }
792008
public function replace($data, $statements = null)
    {
        $this->settings['type'] = 'REPLACE';
        $this->settings['data'] = $data;
        $this->settings['statements'] = $statements;

        return $this;
    }
126475
public function addJoin(array $joins): void
    {
        if (empty($joins)) {
            return;
        }

        foreach ($joins as $join) {
            $keyword = strtoupper($join['type']);
            $pattern = '%s JOIN %s ON %s %s %s';
            $this->statement .= sprintf(
                $pattern,
                $keyword,
                $this->quoteName($join['table']),
                $this->quoteName($join['key']),
                $join['operator'],
                $this->quoteName($join['value'])
            );
            $this->statement .= PHP_EOL;
        }
    }
344884
public function passLetStatement($branchNumber, $statement)
    {
        foreach ($statement['assignments'] as $assignment) {
            if ('variable' == $assignment['assign-type']) {
                if ('assign' == $assignment['operator']) {
                    switch ($assignment['expr']['type']) {
                        case 'variable':
                        case 'array-access':
                        case 'property-access':
                        case 'static-property-access':
                        case 'fcall':
                        case 'mcall':
                        case 'scall':
                            break;
                        default:
                            $this->variablesToSkip[$branchNumber][$assignment['variable']] = 1;
                            break;
                    }
                }
            }
        }
    }
906413
protected function processEmphasisBlock(array $block)
	{
		$this->emPos     = null;
		$this->strongPos = null;
		foreach ($block as list($matchPos, $matchLen))
		{
			$this->processEmphasisMatch($matchPos, $matchLen);
		}
	}
251652
public static function sql(...$messages): void
    {
        static::init();

        if (!static::isTemporaryDisabled('sql')) {
            foreach (static::$adapters as $adapter) {
                /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
                if ($adapter->isLevelEnabled(self::SQL)) {
                    $adapter->sql((new Message(self::SQL))->setMessages($messages));
                }
            }
        }
    }
1055366
public function handleBatch(array $records)
    {
        $records = $this->recordFilter($records);
        if (empty($records)) {
            return true;
        }

        $lines = array_column($records, 'formatted');

        $this->write($lines);
    }
1210011
public function bindValues($values): void
    {
        $params = func_get_args();
        if (isset($params[0]) && is_array($params[0])) {
            $this->bindedValues = new \ArrayObject($params[0]);
        } else {
            $this->bindedValues = new \ArrayObject($params);
        }
    }
805481
public static function set(array &$array, ...$keys): void
    {
        if (\count($keys) < 2) {
            throw new \InvalidArgumentException('Method `Collection::set()` is required minimum one key and value');
        }

        $value = array_pop($keys);
        while (\count($keys) > 1) {
            $key = array_shift($keys);
            if (!isset($array[$key]) || !\is_array($array[$key])) {
                $array[$key] = [];
            }
            $array = &$array[$key];
        }
        $array[array_shift($keys)] = $value;
    }
1196571
public function addRows(array $rows): void
    {
        if (empty($rows)) {
            throw new DatabaseException('Can not perform insert with empty rows.');
        }

        // Collect column names and add to statement:
        $cols = array_keys(reset($rows));
        foreach ($cols as $i => $col) {
            $cols[$i] = $this->quoteName($col);
        }
        $pattern = " (%s) VALUES" . PHP_EOL;
        $this->statement .= sprintf($pattern, implode(',', $cols));

        // Add values for each row to insert statement:
        $rowValues = [];
        foreach ($rows as $row) {
            $placeholders = $this->bindRowValues($row);
            array_push($rowValues, sprintf('(%s)', implode(',', $placeholders)));
        }
        $this->statement .= implode(',', $rowValues);
    }
966807
public function setAll(array $values): void {
		$skipped = array();
		
		foreach ($values as $key => $value) {
			try {
				$this->set($key, $value);
			} catch (EntityException $e) {
				$skipped[$key] = $value;
			}
		}
		
		if (($skippedCount = sizeof($skipped)) > 0) {
			$message = sprintf("Unknown %s (%s) in %s.",
				$skippedCount === 1 ? "property" : "properties",
				join(", ", $skipped),
				get_class()
			);
			
			throw new EntityException($message, EntityException::UNKNOWN_PROPERTY);
		}
	}
396197
protected function bulkSend(array $records): void
    {
        try {
            $params = [
                'body' => [],
            ];

            foreach ($records as $record) {
                $params['body'][] = [
                    'index' => [
                        '_index' => $record['_index'],
                        '_type'  => $record['_type'],
                    ],
                ];
                unset($record['_index'], $record['_type']);

                $params['body'][] = $record;
            }

            $responses = $this->client->bulk($params);

            if ($responses['errors'] === true) {
                throw new ElasticsearchRuntimeException('Elasticsearch returned error for one of the records');
            }
        } catch (Throwable $e) {
            if (! $this->options['ignore_error']) {
                throw new RuntimeException('Error sending messages to Elasticsearch', 0, $e);
            }
        }
    }