Commits

guilhermeblanco committed 8f119ee Merge

Merge pull request #372 from javer/hhvm-func_get_args

HHVM compatibility: func_get_args

  • Participants
  • Parent commits ed7c1c0, 7540295

Comments (0)

Files changed (2)

lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php

      */
     public function fetch($fetchMode = null)
     {
+        $args = func_get_args();
         $fetchMode = $fetchMode ?: $this->defaultFetchMode;
         if (isset(self::$fetchMap[$fetchMode])) {
             return sqlsrv_fetch_array($this->stmt, self::$fetchMap[$fetchMode]);
         } else if ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
             $className = null;
             $ctorArgs = null;
-            if (func_num_args() >= 2) {
-                $args = func_get_args();
+            if (count($args) >= 2) {
                 $className = $args[1];
                 $ctorArgs = (isset($args[2])) ? $args[2] : array();
             }

lib/Doctrine/DBAL/Query/QueryBuilder.php

      */
     public function andWhere($where)
     {
-        $where = $this->getQueryPart('where');
         $args = func_get_args();
+        $where = $this->getQueryPart('where');
 
         if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_AND) {
             $where->addMultiple($args);
      */
     public function orWhere($where)
     {
-        $where = $this->getQueryPart('where');
         $args = func_get_args();
+        $where = $this->getQueryPart('where');
 
         if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_OR) {
             $where->addMultiple($args);
      */
     public function andHaving($having)
     {
-        $having = $this->getQueryPart('having');
         $args = func_get_args();
+        $having = $this->getQueryPart('having');
 
         if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_AND) {
             $having->addMultiple($args);
      */
     public function orHaving($having)
     {
-        $having = $this->getQueryPart('having');
         $args = func_get_args();
+        $having = $this->getQueryPart('having');
 
         if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_OR) {
             $having->addMultiple($args);