diff options
| author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
| commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
| tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/dbal/src/Portability/OptimizeFlags.php | |
| parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
| download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.gz AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.bz2 AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip | |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/dbal/src/Portability/OptimizeFlags.php')
| -rw-r--r-- | vendor/doctrine/dbal/src/Portability/OptimizeFlags.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php b/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php new file mode 100644 index 0000000..c985d4b --- /dev/null +++ b/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\DBAL\Portability; | ||
| 6 | |||
| 7 | use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
| 8 | use Doctrine\DBAL\Platforms\DB2Platform; | ||
| 9 | use Doctrine\DBAL\Platforms\OraclePlatform; | ||
| 10 | use Doctrine\DBAL\Platforms\PostgreSQLPlatform; | ||
| 11 | use Doctrine\DBAL\Platforms\SQLitePlatform; | ||
| 12 | use Doctrine\DBAL\Platforms\SQLServerPlatform; | ||
| 13 | |||
| 14 | final class OptimizeFlags | ||
| 15 | { | ||
| 16 | /** | ||
| 17 | * Platform-specific portability flags that need to be excluded from the user-provided mode | ||
| 18 | * since the platform already operates in this mode to avoid unnecessary conversion overhead. | ||
| 19 | * | ||
| 20 | * @var array<class-string, int> | ||
| 21 | */ | ||
| 22 | private static array $platforms = [ | ||
| 23 | DB2Platform::class => 0, | ||
| 24 | OraclePlatform::class => Connection::PORTABILITY_EMPTY_TO_NULL, | ||
| 25 | PostgreSQLPlatform::class => 0, | ||
| 26 | SQLitePlatform::class => 0, | ||
| 27 | SQLServerPlatform::class => 0, | ||
| 28 | ]; | ||
| 29 | |||
| 30 | public function __invoke(AbstractPlatform $platform, int $flags): int | ||
| 31 | { | ||
| 32 | foreach (self::$platforms as $class => $mask) { | ||
| 33 | if ($platform instanceof $class) { | ||
| 34 | $flags &= ~$mask; | ||
| 35 | |||
| 36 | break; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | return $flags; | ||
| 41 | } | ||
| 42 | } | ||
