Вход Регистрация
Файл: vendor/doctrine/dbal/src/Portability/OptimizeFlags.php
Строк: 30
<?php

declare(strict_types=1);

namespace 
DoctrineDBALPortability;

use 
DoctrineDBALPlatformsAbstractPlatform;
use 
DoctrineDBALPlatformsDB2Platform;
use 
DoctrineDBALPlatformsOraclePlatform;
use 
DoctrineDBALPlatformsPostgreSQLPlatform;
use 
DoctrineDBALPlatformsSqlitePlatform;
use 
DoctrineDBALPlatformsSQLServerPlatform;

final class 
OptimizeFlags
{
    
/**
     * Platform-specific portability flags that need to be excluded from the user-provided mode
     * since the platform already operates in this mode to avoid unnecessary conversion overhead.
     *
     * @var array<class-string, int>
     */
    
private static array $platforms = [
        
DB2Platform::class        => 0,
        
OraclePlatform::class     => Connection::PORTABILITY_EMPTY_TO_NULL,
        
PostgreSQLPlatform::class => 0,
        
SqlitePlatform::class     => 0,
        
SQLServerPlatform::class  => 0,
    ];

    public function 
__invoke(AbstractPlatform $platformint $flags): int
    
{
        foreach (
self::$platforms as $class => $mask) {
            if (
$platform instanceof $class) {
                
$flags &= ~$mask;

                break;
            }
        }

        return 
$flags;
    }
}
Онлайн: 0
Реклама