doctrine1 icon indicating copy to clipboard operation
doctrine1 copied to clipboard

Doctrine_Adapter_Statement methods signature

Open connorhu opened this issue 1 year ago • 2 comments

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

connorhu avatar Jan 24 '24 18:01 connorhu

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

alquerci avatar Jan 24 '24 19:01 alquerci

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.

connorhu avatar Feb 10 '24 14:02 connorhu