Skip to content

New fetch() and fetchAll() method signatures #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
codebarista opened this issue Aug 18, 2017 · 0 comments
Closed

New fetch() and fetchAll() method signatures #69

codebarista opened this issue Aug 18, 2017 · 0 comments

Comments

@codebarista
Copy link
Contributor

What is this feature about (expected vs actual behaviour)?

MINOR BC BREAK: fetch() and fetchAll() method signatures in Doctrine\DBAL\Driver\ResultStatement

How can I reproduce it?

Composer update doctrine to version 2.6

Does it take minutes, hours or days to fix?

Minutes.

Any additional information?

Changes in Statement.php line 214 & 224

/**
 * {@inheritdoc}
 *
 * @SuppressWarnings("PHPMD.StaticAccess")
 */
public function fetch($fetchMode = NULL, $cursorOrientation = \PDO::FETCH_ORI_NEXT, $cursorOffset = 0) {
    $fetchMode = empty($fetchMode) ? $this->fetchMode : $fetchMode;
    Assertions::assertSupportedFetchMode($fetchMode);

    return count($this->result) === 0 ? false : array_pop($this->result);
}

/**
 * {@inheritdoc}
 */
public function fetchAll($fetchMode = NULL, $fetchArgument = NULL, $ctorArgs = NULL) {
    $result    = [];
    $fetchMode = empty($fetchMode) ? $this->fetchMode : $fetchMode;

    while (($row = $this->fetch($fetchMode))) array_push($result, $row);

    return $result;
}

https://github.com/doctrine/dbal/blob/master/UPGRADE.md

TobiasHauck added a commit that referenced this issue Dec 7, 2017
#69 New fetch() and fetchAll() method signatures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants