mailpoet
/
vendor-prefixed
/
doctrine
/
dbal
/
src
/
Driver
/
Middleware
/
AbstractStatementMiddleware.php
AbstractConnectionMiddleware.php
2 years ago
AbstractDriverMiddleware.php
2 years ago
AbstractResultMiddleware.php
2 years ago
AbstractStatementMiddleware.php
2 years ago
index.php
2 years ago
AbstractStatementMiddleware.php
36 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Doctrine\DBAL\Driver\Middleware; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Doctrine\DBAL\Driver\Result; |
| 5 | use MailPoetVendor\Doctrine\DBAL\Driver\Statement; |
| 6 | use MailPoetVendor\Doctrine\DBAL\ParameterType; |
| 7 | use MailPoetVendor\Doctrine\Deprecations\Deprecation; |
| 8 | use function func_num_args; |
| 9 | abstract class AbstractStatementMiddleware implements Statement |
| 10 | { |
| 11 | private Statement $wrappedStatement; |
| 12 | public function __construct(Statement $wrappedStatement) |
| 13 | { |
| 14 | $this->wrappedStatement = $wrappedStatement; |
| 15 | } |
| 16 | public function bindValue($param, $value, $type = ParameterType::STRING) |
| 17 | { |
| 18 | if (func_num_args() < 3) { |
| 19 | Deprecation::trigger('doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5558', 'Not passing $type to Statement::bindValue() is deprecated.' . ' Pass the type corresponding to the parameter being bound.'); |
| 20 | } |
| 21 | return $this->wrappedStatement->bindValue($param, $value, $type); |
| 22 | } |
| 23 | public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) |
| 24 | { |
| 25 | Deprecation::trigger('doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5563', '%s is deprecated. Use bindValue() instead.', __METHOD__); |
| 26 | if (func_num_args() < 3) { |
| 27 | Deprecation::trigger('doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5558', 'Not passing $type to Statement::bindParam() is deprecated.' . ' Pass the type corresponding to the parameter being bound.'); |
| 28 | } |
| 29 | return $this->wrappedStatement->bindParam($param, $variable, $type, $length); |
| 30 | } |
| 31 | public function execute($params = null) : Result |
| 32 | { |
| 33 | return $this->wrappedStatement->execute($params); |
| 34 | } |
| 35 | } |
| 36 |