Файл: vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/OptimizeFlags.php
Строк: 33
<?php
declare(strict_types=1);
namespace DoctrineDBALPortability;
use DoctrineDBALPlatformsAbstractPlatform;
use DoctrineDBALPlatformsDB2Platform;
use DoctrineDBALPlatformsOraclePlatform;
use DoctrineDBALPlatformsPostgreSQL94Platform;
use DoctrineDBALPlatformsSQLAnywhere16Platform;
use DoctrineDBALPlatformsSqlitePlatform;
use DoctrineDBALPlatformsSQLServer2012Platform;
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<string,int>
*/
private static $platforms = [
DB2Platform::class => 0,
OraclePlatform::class => Connection::PORTABILITY_EMPTY_TO_NULL,
PostgreSQL94Platform::class => 0,
SQLAnywhere16Platform::class => 0,
SqlitePlatform::class => 0,
SQLServer2012Platform::class => 0,
];
public function __invoke(AbstractPlatform $platform, int $flags): int
{
foreach (self::$platforms as $class => $mask) {
if ($platform instanceof $class) {
$flags &= ~$mask;
break;
}
}
return $flags;
}
}