Commit e67b3070 authored by romanb's avatar romanb

[2.0] Changed init() to __construct().

parent aa0792b1
......@@ -21,10 +21,10 @@
namespace Doctrine\ORM\Query;
use Doctrine\Common\DoctrineException;
use Doctrine\ORM\Query;
use Doctrine\ORM\Query\AST;
use Doctrine\ORM\Query\Exec;
use Doctrine\Common\DoctrineException,
Doctrine\ORM\Query,
Doctrine\ORM\Query\AST,
Doctrine\ORM\Query\Exec;
/**
* An LL(*) parser for the context-free grammar of the Doctrine Query Language.
......@@ -257,8 +257,7 @@ class Parser
}
// Create TreeWalker who creates the SQL from the AST
$treeWalker = $this->_treeWalker ?: new SqlWalker();
$treeWalker->init(
$treeWalker = $this->_treeWalker ?: new SqlWalker(
$this->_query, $this->_parserResult, $this->_queryComponents
);
......
......@@ -74,7 +74,7 @@ class SqlWalker implements TreeWalker
/**
* @inheritdoc
*/
public function init($query, $parserResult, array $queryComponents)
public function __construct($query, $parserResult, array $queryComponents)
{
$this->_rsm = $parserResult->getResultSetMapping();
$this->_query = $query;
......
......@@ -36,7 +36,7 @@ interface TreeWalker
* @param ParserResult $parserResult The result of the parsing process.
* @param array $queryComponents Query components (symbol table)
*/
function init($query, $parserResult, array $queryComponents);
function __construct($query, $parserResult, array $queryComponents);
/**
* Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
......
......@@ -33,7 +33,7 @@ abstract class TreeWalkerAdapter implements TreeWalker
/**
* @inheritdoc
*/
public function init($query, $parserResult, array $queryComponents) {}
public function __construct($query, $parserResult, array $queryComponents) {}
/**
* Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
......
......@@ -48,7 +48,7 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
$parser = new \Doctrine\ORM\Query\Parser($query);
// We do NOT test SQL construction here. That only unnecessarily slows down the tests!
$parser->setTreeWalker(new \Doctrine\Tests\Mocks\MockTreeWalker);
$parser->setTreeWalker(new \Doctrine\Tests\Mocks\MockTreeWalker(null, null, array()));
return $parser->parse();
}
......
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