Commit 8f119eea authored by Guilherme Blanco's avatar Guilherme Blanco

Merge pull request #372 from javer/hhvm-func_get_args

HHVM compatibility: func_get_args
parents ed7c1c0b 75402954
...@@ -220,14 +220,14 @@ class SQLSrvStatement implements IteratorAggregate, Statement ...@@ -220,14 +220,14 @@ class SQLSrvStatement implements IteratorAggregate, Statement
*/ */
public function fetch($fetchMode = null) public function fetch($fetchMode = null)
{ {
$args = func_get_args();
$fetchMode = $fetchMode ?: $this->defaultFetchMode; $fetchMode = $fetchMode ?: $this->defaultFetchMode;
if (isset(self::$fetchMap[$fetchMode])) { if (isset(self::$fetchMap[$fetchMode])) {
return sqlsrv_fetch_array($this->stmt, self::$fetchMap[$fetchMode]); return sqlsrv_fetch_array($this->stmt, self::$fetchMap[$fetchMode]);
} else if ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) { } else if ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
$className = null; $className = null;
$ctorArgs = null; $ctorArgs = null;
if (func_num_args() >= 2) { if (count($args) >= 2) {
$args = func_get_args();
$className = $args[1]; $className = $args[1];
$ctorArgs = (isset($args[2])) ? $args[2] : array(); $ctorArgs = (isset($args[2])) ? $args[2] : array();
} }
......
...@@ -743,8 +743,8 @@ class QueryBuilder ...@@ -743,8 +743,8 @@ class QueryBuilder
*/ */
public function andWhere($where) public function andWhere($where)
{ {
$where = $this->getQueryPart('where');
$args = func_get_args(); $args = func_get_args();
$where = $this->getQueryPart('where');
if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_AND) { if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_AND) {
$where->addMultiple($args); $where->addMultiple($args);
...@@ -776,8 +776,8 @@ class QueryBuilder ...@@ -776,8 +776,8 @@ class QueryBuilder
*/ */
public function orWhere($where) public function orWhere($where)
{ {
$where = $this->getQueryPart('where');
$args = func_get_args(); $args = func_get_args();
$where = $this->getQueryPart('where');
if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_OR) { if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_OR) {
$where->addMultiple($args); $where->addMultiple($args);
...@@ -869,8 +869,8 @@ class QueryBuilder ...@@ -869,8 +869,8 @@ class QueryBuilder
*/ */
public function andHaving($having) public function andHaving($having)
{ {
$having = $this->getQueryPart('having');
$args = func_get_args(); $args = func_get_args();
$having = $this->getQueryPart('having');
if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_AND) { if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_AND) {
$having->addMultiple($args); $having->addMultiple($args);
...@@ -892,8 +892,8 @@ class QueryBuilder ...@@ -892,8 +892,8 @@ class QueryBuilder
*/ */
public function orHaving($having) public function orHaving($having)
{ {
$having = $this->getQueryPart('having');
$args = func_get_args(); $args = func_get_args();
$having = $this->getQueryPart('having');
if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_OR) { if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_OR) {
$having->addMultiple($args); $having->addMultiple($args);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment