composer update
This commit is contained in:
@@ -1,62 +1,43 @@
|
||||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\DBAL\Cache;
|
||||
|
||||
use ArrayIterator;
|
||||
use Doctrine\DBAL\Driver\ResultStatement;
|
||||
use Doctrine\DBAL\FetchMode;
|
||||
use InvalidArgumentException;
|
||||
use IteratorAggregate;
|
||||
use PDO;
|
||||
use function array_merge;
|
||||
use function array_values;
|
||||
use function count;
|
||||
use function reset;
|
||||
|
||||
class ArrayStatement implements \IteratorAggregate, ResultStatement
|
||||
class ArrayStatement implements IteratorAggregate, ResultStatement
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
/** @var mixed[] */
|
||||
private $data;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
private $columnCount = 0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
private $num = 0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
private $defaultFetchMode = FetchMode::MIXED;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param mixed[] $data
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
if (count($data)) {
|
||||
$this->columnCount = count($data[0]);
|
||||
if (! count($data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->columnCount = count($data[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +45,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
|
||||
*/
|
||||
public function closeCursor()
|
||||
{
|
||||
unset ($this->data);
|
||||
unset($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +62,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
|
||||
public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
|
||||
{
|
||||
if ($arg2 !== null || $arg3 !== null) {
|
||||
throw new \InvalidArgumentException("Caching layer does not support 2nd/3rd argument to setFetchMode()");
|
||||
throw new InvalidArgumentException('Caching layer does not support 2nd/3rd argument to setFetchMode()');
|
||||
}
|
||||
|
||||
$this->defaultFetchMode = $fetchMode;
|
||||
@@ -96,13 +77,13 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
|
||||
{
|
||||
$data = $this->fetchAll();
|
||||
|
||||
return new \ArrayIterator($data);
|
||||
return new ArrayIterator($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function fetch($fetchMode = null, $cursorOrientation = \PDO::FETCH_ORI_NEXT, $cursorOffset = 0)
|
||||
public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEXT, $cursorOffset = 0)
|
||||
{
|
||||
if (! isset($this->data[$this->num])) {
|
||||
return false;
|
||||
@@ -127,7 +108,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
|
||||
return reset($row);
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('Invalid fetch-style given for fetching result.');
|
||||
throw new InvalidArgumentException('Invalid fetch-style given for fetching result.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user