<commit_before><?php

/**
 * @license MIT
 * @license http://opensource.org/licenses/MIT
 */
namespace Slim\PDO\Statement;

use Slim\PDO\AbstractStatement;
use Slim\PDO\Database;

class Insert extends AbstractStatement
{
    /** @var string[] $columns */
    protected $columns = array();

    /** @var array $values */
    protected $values = array();

    /**
     * @param Database $dbh
     * @param array $pairs
     */
    public function __construct(Database $dbh, array $pairs = [])
    {
        parent::__construct($dbh);

        $this->columns(array_keys($pairs));
        $this->values(array_values($pairs));
    }

    /**
     * @param $table
     * @return $this
     */
    public function into($table)
    {
        $this->setTable($table);

        return $this;
    }

    /**
     * @param array $columns
     * @return $this
     */
    public function columns(array $columns)
    {
        $this->columns += $columns;

        return $this;
    }

    /**
     * @param array $values
     * @return $this
     */
    public function values(array $values)
    {
        $this->values += $values;

        return $this;
    }

    /**
     * @return string
     */
    public function __toString()
    {
        if (! isset($this->table)) {
            trigger_error("No table is set for insertion", E_USER_ERROR);
        }

        if (empty($this->columns)) {
            trigger_error("Missing columns for insertion", E_USER_ERROR);
        }

        if (empty($this->values)) {
            trigger_error("Missing values for insertion", E_USER_ERROR);
        }<commit_msg>Fixed value set in Insert.<commit_after><?php

/**
 * @license MIT
 * @license http://opensource.org/licenses/MIT
 */
namespace Slim\PDO\Statement;

use Slim\PDO\AbstractStatement;
use Slim\PDO\Database;

class Insert extends AbstractStatement
{
    /** @var string[] $columns */
    protected $columns = array();

    /** @var array $values */
    protected $values = array();

    /**
     * @param Database $dbh
     * @param array $pairs
     */
    public function __construct(Database $dbh, array $pairs = [])
    {
        parent::__construct($dbh);

        $this->columns(array_keys($pairs));
        $this->values(array_values($pairs));
    }

    /**
     * @param $table
     * @return $this
     */
    public function into($table)
    {
        $this->setTable($table);

        return $this;
    }

    /**
     * @param array $columns
     * @return $this
     */
    public function columns(array $columns)
    {
        $this->columns = array_merge($this->columns, $columns);

        return $this;
    }

    /**
     * @param array $values
     * @return $this
     */
    public function values(array $values)
    {
        $this->values = array_merge($this->values, $values);
        
        return $this;
    }

    /**
     * @return string
     */
    public function __toString()
    {
        if (! isset($this->table)) {
            trigger_error("No table is set for insertion", E_USER_ERROR);
        }

        if (empty($this->columns)) {
            trigger_error("Missing columns for insertion", E_USER_ERROR);
        }

        if (empty($this->values)) {
            trigger_error("Missing values for insertion", E_USER_ERROR);
        }
{'fraction_non_alphanumeric': 0.14508246792913868, 'fraction_numerical': 0.0, 'mean_word_length': 2.060747663551402, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3685288', 'n_tokens_mistral': 990, 'n_tokens_neox': 963, 'n_words': 218}