Connection.php
2 years ago
Converter.php
2 years ago
Driver.php
2 years ago
Middleware.php
2 years ago
OptimizeFlags.php
2 years ago
Result.php
2 years ago
Statement.php
2 years ago
index.php
2 years ago
Middleware.php
25 lines
| 1 | <?php |
| 2 | declare (strict_types=1); |
| 3 | namespace MailPoetVendor\Doctrine\DBAL\Portability; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | use MailPoetVendor\Doctrine\DBAL\ColumnCase; |
| 6 | use MailPoetVendor\Doctrine\DBAL\Driver as DriverInterface; |
| 7 | use MailPoetVendor\Doctrine\DBAL\Driver\Middleware as MiddlewareInterface; |
| 8 | final class Middleware implements MiddlewareInterface |
| 9 | { |
| 10 | private int $mode; |
| 11 | private int $case; |
| 12 | public function __construct(int $mode, int $case) |
| 13 | { |
| 14 | $this->mode = $mode; |
| 15 | $this->case = $case; |
| 16 | } |
| 17 | public function wrap(DriverInterface $driver) : DriverInterface |
| 18 | { |
| 19 | if ($this->mode !== 0) { |
| 20 | return new Driver($driver, $this->mode, $this->case); |
| 21 | } |
| 22 | return $driver; |
| 23 | } |
| 24 | } |
| 25 |