Skip to content

Commit

Permalink
Merge pull request #3061 from morozov/issues/3060
Browse files Browse the repository at this point in the history
Fixed build failure on SQL Server
  • Loading branch information
Ocramius authored Mar 20, 2018
2 parents c5e8a7c + ef4d96f commit 274e5ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/PDOConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function requiresQueryForServerVersion()
* @param \PDOStatement $stmt
* @return PDOStatement
*/
private function createStatement(\PDOStatement $stmt) : PDOStatement
protected function createStatement(\PDOStatement $stmt) : PDOStatement
{
return new PDOStatement($stmt);
}
Expand Down
18 changes: 9 additions & 9 deletions lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Driver\PDOSqlsrv;

use Doctrine\DBAL\Driver\PDOConnection;
use Doctrine\DBAL\Driver\PDOStatement;
use Doctrine\DBAL\ParameterType;

/**
Expand All @@ -12,15 +13,6 @@
*/
class Connection extends PDOConnection implements \Doctrine\DBAL\Driver\Connection
{
/**
* {@inheritdoc}
*/
public function __construct($dsn, $user = null, $password = null, array $options = null)
{
parent::__construct($dsn, $user, $password, $options);
$this->setAttribute(\PDO::ATTR_STATEMENT_CLASS, [Statement::class, []]);
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -50,4 +42,12 @@ public function quote($value, $type = ParameterType::STRING)

return $val;
}

/**
* {@inheritDoc}
*/
protected function createStatement(\PDOStatement $stmt) : PDOStatement
{
return new Statement($stmt);
}
}
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function setFetchMode($fetchMode, ...$args)
}

if (isset($args[1])) {
$this->defaultFetchClassCtorArgs = (array) $args[2];
$this->defaultFetchClassCtorArgs = (array) $args[1];
}

return true;
Expand Down Expand Up @@ -337,7 +337,7 @@ public function fetchAll($fetchMode = null, ...$args)

switch ($fetchMode) {
case FetchMode::CUSTOM_OBJECT:
while (($row = $this->fetch($fetchMode, $args)) !== false) {
while (($row = $this->fetch($fetchMode, ...$args)) !== false) {
$rows[] = $row;
}
break;
Expand Down

0 comments on commit 274e5ec

Please sign in to comment.