<commit_before><?php

namespace Neoxygen\NeoClient\Transaction;

use Neoxygen\NeoClient\Extension\NeoClientCoreExtension;
use Neoxygen\NeoClient\Exception\Neo4jException;

class Transaction
{
    /**
     * @var \Neoxygen\NeoClient\Extension\NeoClientCoreExtension
     */
    private $client;

    /**
     * @var bool
     */
    private $active;

    /**
     * @var null
     */
    private $conn;

    /**
     * @var
     */
    private $commitUrl;

    /**
     * @var
     */
    private $transactionId;

    /**
     * @var string
     */
    private $queryMode;

    /**
     * @var array
     */
    private $results = [];

    /**
     * @param null $conn
     * @param \Neoxygen\NeoClient\Extension\NeoClientCoreExtension $extension
     */
    public function __construct($conn = null, NeoClientCoreExtension $extension, $queryMode)
    {
        $this->conn = $conn;
        $this->queryMode = $queryMode;
        $this->client = $extension;
        $response = $this->handleResponse($this->client->openTransaction($this->conn, $this->queryMode));
        $this->commitUrl = $response->getBody()['commit'];
        $this->parseTransactionId();
        $this->active = true;

        return $this;
    }

    /**
     * @param $query
     * @param array $parameters
     * @return \Neoxygen\NeoClient\Formatter\Response
     * @throws \Neoxygen\NeoClient\Exception\Neo4jException
     */
    public function pushQuery($query, array $parameters = array())
    {
        $this->checkIfOpened();
        $response = $this->handleResponse($this->client->pushToTransaction($this->transactionId, $query, $parameters, $this->conn));
        $result = $response->getResult();
        $this->results[] = $result;

        return $result;
    }

    /**
     * @param array $statements
     * @return $this
     * @throws \Neoxygen\NeoClient\Exception\Neo4jException
     */
    public function pushMultiple(array $statements)
    {
        $this->checkIfOpened();<commit_msg>fix bad return type<commit_after><?php

namespace Neoxygen\NeoClient\Transaction;

use Neoxygen\NeoClient\Extension\NeoClientCoreExtension;
use Neoxygen\NeoClient\Exception\Neo4jException;

class Transaction
{
    /**
     * @var \Neoxygen\NeoClient\Extension\NeoClientCoreExtension
     */
    private $client;

    /**
     * @var bool
     */
    private $active;

    /**
     * @var null
     */
    private $conn;

    /**
     * @var
     */
    private $commitUrl;

    /**
     * @var
     */
    private $transactionId;

    /**
     * @var string
     */
    private $queryMode;

    /**
     * @var array
     */
    private $results = [];

    /**
     * @param null $conn
     * @param \Neoxygen\NeoClient\Extension\NeoClientCoreExtension $extension
     */
    public function __construct($conn = null, NeoClientCoreExtension $extension, $queryMode)
    {
        $this->conn = $conn;
        $this->queryMode = $queryMode;
        $this->client = $extension;
        $response = $this->handleResponse($this->client->openTransaction($this->conn, $this->queryMode));
        $this->commitUrl = $response->getBody()['commit'];
        $this->parseTransactionId();
        $this->active = true;

        return $this;
    }

    /**
     * @param $query
     * @param array $parameters
     * @return \Neoxygen\NeoClient\Formatter\Result
     * @throws \Neoxygen\NeoClient\Exception\Neo4jException
     */
    public function pushQuery($query, array $parameters = array())
    {
        $this->checkIfOpened();
        $response = $this->handleResponse($this->client->pushToTransaction($this->transactionId, $query, $parameters, $this->conn));
        $result = $response->getResult();
        $this->results[] = $result;

        return $result;
    }

    /**
     * @param array $statements
     * @return $this
     * @throws \Neoxygen\NeoClient\Exception\Neo4jException
     */
    public function pushMultiple(array $statements)
    {
        $this->checkIfOpened();
{'fraction_non_alphanumeric': 0.14581231079717458, 'fraction_numerical': 0.0015136226034308778, 'mean_word_length': 2.3946917808219177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '222666', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1175, 'n_words': 208}