Skip to content
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

Doctrine_Adapter_Statement methods signature #114

Open
connorhu opened this issue Jan 24, 2024 · 2 comments
Open

Doctrine_Adapter_Statement methods signature #114

connorhu opened this issue Jan 24, 2024 · 2 comments

Comments

@connorhu
Copy link
Collaborator

connorhu commented Jan 24, 2024

We have to figure out why do not follow the methods signature of Doctrine_Adapter_Statement the methods signature of Doctrine_Connection_Statement and PDOStatement.

// Doctrine_Adapter_Statement
public function bindValue($no, $value);
public function fetch();
public function execute();
public function setFetchMode($mode);
// Doctrine_Adapter_Statement_Interface
    public function bindValue($param, $value, $type = null);
    public function execute($params = null);
    public function fetch(
        $fetchStyle = Doctrine_Core::FETCH_BOTH,
        $cursorOrientation = Doctrine_Core::FETCH_ORI_NEXT,
        $cursorOffset = null
    );
    public function setFetchMode($mode, $arg1 = null, $arg2 = null);
  • Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interface
  • There is no Doctrine_Adapter_Statement used anywhere
  • Doctrine_Adapter_Statement_Interface used by Doctrine_Adapter_Statement_Oracle, Doctrine_Adapter_Statement_Mock and Doctrine_Connection_Statement
@alquerci
Copy link

Doctrine_Adapter_Statement it is more generic with fewer features than Doctrine_Adapter_Statement_Interface

On the doctrine1 source code, we can find 5 occurrences.

As lying type hints.

lib/Doctrine/Connection/Mssql.php:293:29: * @return PDOStatement|Doctrine_Adapter_Statement
lib/Doctrine/Connection/Mssql.php:309:29: * @return PDOStatement|Doctrine_Adapter_Statement
lib/Doctrine/Connection/Statement.php:42:83: * @var mixed $_stmt PDOStatement object, boolean false or Doctrine_Adapter_Statement object
lib/Doctrine/Connection.php:994:29: * @return PDOStatement|Doctrine_Adapter_Statement
lib/Doctrine/Connection.php:1006:29: * @return PDOStatement|Doctrine_Adapter_Statement

@connorhu
Copy link
Collaborator Author

bindValue implementations
kép

setFetchMode implmentations
kép

fetch implementations:
kép

No one implements the signature of Doctrine_Adapter_Statement methods. The Doctrine_Adapter_Statement feels more like an interface than an abstract class.

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