Skip to content

Commit

Permalink
doctrine#6167 Code review updates, better readability
Browse files Browse the repository at this point in the history
(cherry picked from commit 571115c)
  • Loading branch information
mkurzeja authored and Alexey Snigirev committed Nov 27, 2017
1 parent e21217d commit de4b40b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/Doctrine/Tests/Mocks/ConnectionMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function lastInsertId($seqName = null)
*/
public function fetchColumn($statement, array $params = [], $colnum = 0, array $types = [])
{
if ($this->_fetchOneException != null) {
if (null !== $this->_fetchOneException) {
throw $this->_fetchOneException;
}

Expand Down Expand Up @@ -136,7 +136,7 @@ public function setFetchOneResult($fetchOneResult)
}

/**
* @param \Exception $exception
* @param \Exception|null $exception
*
* @return void
*/
Expand Down Expand Up @@ -168,7 +168,7 @@ public function setLastInsertId($id)
/**
* @param Statement $result
*/
public function setQueryResult($result)
public function setQueryResult(Statement $result)
{
$this->_queryResult = $result;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/ORM/Id/SequenceGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ protected function setUp()
public function testGeneration()
{
$this->_em->getConnection()->setFetchOneException(
new \Exception('Fetch* method used. Query method should be used instead, as NEXTVAL should be run on a master server in master-slave setup.')
new \RuntimeException('Fetch* method used. Query method should be used instead, as NEXTVAL should be run on a master server in master-slave setup.')
);

for ($i=0; $i < 42; ++$i) {
if ($i % 10 == 0) {
$nextId = array(array((int)($i / 10) * 10));
$nextId = [[(int)($i / 10) * 10]];
$this->_em->getConnection()->setQueryResult(new StatementArrayMock($nextId));
}
$id = $this->_seqGen->generate($this->_em, null);
Expand Down

0 comments on commit de4b40b

Please sign in to comment.