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
OptimizeFlags.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\Platforms\AbstractPlatform; |
| 6 | use MailPoetVendor\Doctrine\DBAL\Platforms\DB2Platform; |
| 7 | use MailPoetVendor\Doctrine\DBAL\Platforms\OraclePlatform; |
| 8 | use MailPoetVendor\Doctrine\DBAL\Platforms\PostgreSQLPlatform; |
| 9 | use MailPoetVendor\Doctrine\DBAL\Platforms\SqlitePlatform; |
| 10 | use MailPoetVendor\Doctrine\DBAL\Platforms\SQLServerPlatform; |
| 11 | final class OptimizeFlags |
| 12 | { |
| 13 | private static array $platforms = [DB2Platform::class => 0, OraclePlatform::class => Connection::PORTABILITY_EMPTY_TO_NULL, PostgreSQLPlatform::class => 0, SqlitePlatform::class => 0, SQLServerPlatform::class => 0]; |
| 14 | public function __invoke(AbstractPlatform $platform, int $flags) : int |
| 15 | { |
| 16 | foreach (self::$platforms as $class => $mask) { |
| 17 | if ($platform instanceof $class) { |
| 18 | $flags &= ~$mask; |
| 19 | break; |
| 20 | } |
| 21 | } |
| 22 | return $flags; |
| 23 | } |
| 24 | } |
| 25 |