@param  array<int, PhpParser\Node\Stmt>  $stmts

@return array<int, PhpParser\Node\Stmt>
495434
public function populateCheckers(array $stmts)
    {
        $leftover_stmts = [];

        foreach ($stmts as $stmt) {
            if ($stmt instanceof PhpParser\Node\Stmt\ClassLike) {
                $this->populateClassLikeAnalyzers($stmt);
            } elseif ($stmt instanceof PhpParser\Node\Stmt\Namespace_) {
                $namespace_name = $stmt->name ? implode('\\', $stmt->name->parts) : '';

                $namespace_analyzer = new NamespaceAnalyzer($stmt, $this);
                $namespace_analyzer->collectAnalyzableInformation();

                $this->namespace_aliased_classes[$namespace_name] = $namespace_analyzer->getAliases()->uses;
                $this->namespace_aliased_classes_flipped[$namespace_name] =
                    $namespace_analyzer->getAliasedClassesFlipped();
            } elseif ($stmt instanceof PhpParser\Node\Stmt\Use_) {
                $this->visitUse($stmt);
            } elseif ($stmt instanceof PhpParser\Node\Stmt\GroupUse) {
                $this->visitGroupUse($stmt);
            } else {
                if ($stmt instanceof PhpParser\Node\Stmt\If_) {
                    foreach ($stmt->stmts as $if_stmt) {
                        if ($if_stmt instanceof PhpParser\Node\Stmt\ClassLike) {
                            $this->populateClassLikeAnalyzers($if_stmt);
                        }
                    }
                }

                $leftover_stmts[] = $stmt;
            }
        }

        return $leftover_stmts;
    }
662103
public function insertStmts(array $stmts, $offset = 0, $remove = 0)
    {
        if (false === $offset) {
            $offset = count($this->stmts);
        } elseif (false === $remove) {
            $remove = count($this->stmts);
        }
        array_splice($this->stmts, $offset, $remove, $stmts);
        return $this;
    }
208746
public function getList($model, $stmt)
    {
        $container = new EntityObjectStorage();
        /**
         * @var $stmt \PDOStatement
         */
        while ($row = $stmt->fetchObject()) {
            $container->attach($this->hydrate(clone $model, $row));
        }

        return $container;
    }
441647
protected function _process( array $stmts )
	{
		$table = 'mshop_plugin';
		$constraint = 'fk_msplu_typeid';

		$this->_msg( 'Adding constraint for table mshop_plugin', 0 ); $this->_status( '' );

		$this->_msg( sprintf( 'Checking constraint "%1$s": ', $constraint ), 1 );

		if( $this->_schema->tableExists( $table ) === true
			&& $this->_schema->columnExists( $table, 'typeid' )
			&& $this->_schema->constraintExists( $table, $constraint ) === false )
		{
			$this->_execute( $stmts[ $constraint ] );
			$this->_status( 'added' );
		}
		else
		{
			$this->_status( 'OK' );
		}
	}
1173887
protected function _process( array $stmts )
	{
		$this->_msg( 'Optimize list indexes', 0 ); $this->_status( '' );

		foreach( $stmts['add'] as $table => $stmtList )
		{
			foreach ( $stmtList as $name => $stmt )
			{
				$this->_msg( sprintf( 'Adding constraint "%1$s": ', $name ), 1 );

				if( $this->_schema->tableExists( $table ) === true
					&& $this->_schema->constraintExists( $table, $name ) === false
				) {
					$this->_execute( $stmt );
					$this->_status( 'done' );
				} else {
					$this->_status( 'OK' );
				}
			}
		}

		foreach( $stmts['delete'] as $table => $stmtList )
		{
			foreach ( $stmtList as $name => $stmt )
			{
				$this->_msg( sprintf( 'Deleting constraint "%1$s": ', $name ), 1 );

				if( $this->_schema->tableExists( $table ) === true
					&& $this->_schema->constraintExists( $table, $name ) === true
				) {
					$this->_execute( $stmt );
					$this->_status( 'done' );
				} else {
					$this->_status( 'OK' );
				}
			}
		}

		foreach( $stmts['indexes'] as $table => $stmtList )
		{
			foreach ( $stmtList as $name => $stmt )
			{
				$this->_msg( sprintf( 'Dropping index "%1$s": ', $name ), 1 );

				if( $this->_schema->tableExists( $table ) === true
					&& $this->_schema->indexExists( $table, $name ) === true
				) {
					$this->_execute( $stmt );
					$this->_status( 'done' );
				} else {
					$this->_status( 'OK' );
				}
			}
		}
	}
813362
public function execBound(\PDOStatement $stmt, array $values)
    {
        $ord = 1;
        foreach ($values as $val) {

            if (is_bool($val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_BOOL);

            } elseif (is_resource($val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_LOB);

            } elseif ((string)$val === ((string)(int)$val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_INT);

            } else {

                $stmt->bindValue($ord, $val, \PDO::PARAM_STR);
            }
            $ord++;
        }

        return $stmt->execute();
    }
1265713
protected function get_default_atts( $atts ) {

		if ( false === isset( $atts['type'] ) ) {
			$atts['type'] = 'file';
		}

		if ( 'file' === $atts['type'] ) {
			$defaults = array( 'contents' => '', 'mode' => 0644, 'size' => 0, );
		} elseif ( 'dir' === $atts['type'] ) {
			$defaults = array( 'contents' => new stdClass(), 'mode' => 0755 );
		} else {
			$defaults = array();
		}

		$atts = array_merge(
			array(
				'atime' => time(),
				'mtime' => time(),
				'owner' => '',
				'group' => '',
			)
			, $defaults
			, $atts
		);

		if ( ! empty( $atts['contents'] ) && 'file' === $atts['type'] ) {
			$atts['size'] = mb_strlen( $atts['contents'], '8bit' );
		}

		return (object) $atts;
	}
20344
protected function _process( array $stmts )
	{
		$this->_msg( 'Migrating catalog suggest tables', 0 ); $this->_status( '' );
		$this->_msg( sprintf( 'Checking table "%1$s": ', 'mshop_catalog_suggest' ), 1 );

		if( $this->_schema->tableExists( 'mshop_catalog_suggest' ) === true )
		{
			$result = $this->_conn->create( $stmts['gettypeid'] )->execute();

			if( ( $row = $result->fetch( MW_DB_Result_Abstract::FETCH_NUM ) ) === false ) {
				throw new MW_Setup_Exception( 'Product list type "suggestion" is missing' );
			}

			$result->finish();


			$result = $this->_conn->create( str_replace( ':typeid', $row[0], $stmts['migrate'] ) )->execute();
			$count = $result->affectedRows();
			$result->finish();


			$this->_executeList( $stmts['drop'] );

			$this->_status( sprintf( 'migrated (%1$d)', $count ) );
		}
		else
		{
			$this->_status( 'OK' );
		}
	}
1156848
private function fetchIteration(Statement $stmt, $iterationCount)
    {
        do {
            $contentIds = [];
            for ($i = 0; $i < $iterationCount; ++$i) {
                if ($contentId = $stmt->fetch(PDO::FETCH_COLUMN)) {
                    $contentIds[] = $contentId;
                } else {
                    break;
                }
            }

            yield $contentIds;
        } while (!empty($contentId));
    }
212178
protected function fetchAsAssoc(Statement $stmt)
    {
        $stmt->setFetchMode(\PDO::FETCH_ASSOC);

        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
    }
1197036
public function prettyPrintFile(array $stmts)
    {
        $p = rtrim($this->prettyPrint($stmts));
        $p = preg_replace('/^\?>\n?/', '', $p, -1, $count);
        $p = preg_replace('/<\?php$/', '', $p);
        if (!$count) {
            $p = sprintf("%s\n\n%s", $this->color('<?php', SyntaxHighlighterConfig::TYPE_OPEN_TAG), $p);
        }
        return $p;
    }
1327146
protected static function getYieldTypeFromExpression(PhpParser\Node\Expr $stmt)
    {
        if ($stmt instanceof PhpParser\Node\Expr\Yield_) {
            $key_type = null;

            if (isset($stmt->key->inferredType)) {
                $key_type = $stmt->key->inferredType;
            }

            if (isset($stmt->inferredType)) {
                $generator_type = new Atomic\TGenericObject(
                    'Generator',
                    [
                        $key_type ?: Type::getInt(),
                        $stmt->inferredType,
                    ]
                );

                return [$generator_type];
            }

            return [new Atomic\TMixed()];
        } elseif ($stmt instanceof PhpParser\Node\Expr\YieldFrom) {
            if (isset($stmt->expr->inferredType)) {
                return array_values($stmt->expr->inferredType->getTypes());
            }

            return [new Atomic\TMixed()];
        } elseif ($stmt instanceof PhpParser\Node\Expr\BinaryOp) {
            return array_merge(
                self::getYieldTypeFromExpression($stmt->left),
                self::getYieldTypeFromExpression($stmt->right)
            );
        } elseif ($stmt instanceof PhpParser\Node\Expr\Assign) {
            return self::getYieldTypeFromExpression($stmt->expr);
        }

        return [];
    }
1294128
public function hydrateAll($stmt, $resultSetMapping, array $hints = array())
    {
        $this->_stmt  = $stmt;
        $this->_rsm   = $resultSetMapping;
        $this->_hints = $hints;

        $this->prepare();

        $result = $this->hydrateAllData();

        $this->cleanup();

        return $result;
    }
1078255
protected function _process( array $stmts )
	{
		$this->_msg( 'Changing customer unique constraint', 0 ); $this->_status( '' );

		foreach( $stmts as $table => $stmtList )
		{
			foreach ( $stmtList as $constraint=>$stmt )
			{
				$this->_msg( sprintf( 'Checking constraint "%1$s": ', $constraint ), 1 );

				if( $this->_schema->tableExists( $table ) && !$this->_schema->constraintExists( $table, $constraint ) )
				{
					$this->_execute( $stmt );
					$this->_status( 'changed' );
				}
				else
				{
					$this->_status( 'OK' );
				}
			}
		}
	}
808859
private function doBind(Statement $stmt)
    {
        foreach ($this->boundValues as $key => $value) {
            $stmt->bindValue($key, $value, $this->boundValuesType[$key]);
        }
        foreach ($this->boundParameters as $key => &$value) {
            $stmt->bindParam($key, $value, $this->boundParametersType[$key]);
        }
    }
880724
protected function getAllMethods($statements)
    {
        $methods = [];
        foreach ($statements as $statement) {
            if (get_class($statement) == ClassMethod::class) {
                $methods[$statement->name] = $statement;
            }
            if (property_exists($statement, 'stmts')) {
                $result = $this->getAllMethods($statement->stmts);
                if (!empty($result)) {
                    $methods = array_merge($methods, $result);
                }
            }
        }

        return $methods;
    }
586005
def _list_stmt(self, stmt: Statement, sctx: SchemaContext) -> None:
        """"""
        self._handle_child(ListNode(), stmt, sctx)