classPlatformFactory
final class PlatformFactory
Factory for creating platform-specific implementations.
Constants§
public const DRIVER_MYSQL = 'mysql'PDO driver name for MySQL.
public const DRIVER_SQLITE = 'sqlite'PDO driver name for SQLite.
public const DRIVER_PGSQL = 'pgsql'PDO driver name for PostgreSQL.
Methods§
public static function createSchemaParser(string $driver): SchemaParserInterfaceCreate a schema parser for the given driver.
Parameters
$driver | string |
Returns
Throws
UnsupportedDriverException If the driver is not supportedTest cases 3
Called from 4
- static-call SqlFixture\DatabaseFixtureProvider::__construct() packages/sql-fixture/src/DatabaseFixtureProvider.php:51
- static-call SqlFixture\FileFixtureProvider::__construct() packages/sql-fixture/src/FileFixtureProvider.php:40
- static-call SqlFixture\FixtureProvider::__construct() packages/sql-fixture/src/FixtureProvider.php:57
- static-call SqlFixture\Provider\SqlSchemaProvider::getSchema() packages/sql-fixture/src/Provider/SqlSchemaProvider.php:35
Calls 7
- class-const PlatformFactory::DRIVER_MYSQL() line 49
- new MySqlSchemaParser line 49
- class-const PlatformFactory::DRIVER_SQLITE() line 50
- new SqliteSchemaParser line 50
- class-const PlatformFactory::DRIVER_PGSQL() line 51
- new PostgreSqlSchemaParser line 51
- new UnsupportedDriverException line 52
public static function createTypeMapper(string $driver): TypeMapperInterfaceCreate a type mapper for the given driver.
Parameters
$driver | string |
Returns
Throws
UnsupportedDriverException If the driver is not supportedTest cases 3
Called from 3
- static-call SqlFixture\DatabaseFixtureProvider::__construct() packages/sql-fixture/src/DatabaseFixtureProvider.php:50
- static-call SqlFixture\FileFixtureProvider::__construct() packages/sql-fixture/src/FileFixtureProvider.php:39
- static-call SqlFixture\FixtureProvider::__construct() packages/sql-fixture/src/FixtureProvider.php:56
Calls 7
- class-const PlatformFactory::DRIVER_MYSQL() line 64
- new MySqlTypeMapper line 64
- class-const PlatformFactory::DRIVER_SQLITE() line 65
- new SqliteTypeMapper line 65
- class-const PlatformFactory::DRIVER_PGSQL() line 66
- new PostgreSqlTypeMapper line 66
- new UnsupportedDriverException line 67
public static function createSchemaFetcher(string $driver): SchemaFetcherInterfaceCreate a schema fetcher for the given driver.
Parameters
$driver | string |
Returns
Throws
UnsupportedDriverException If the driver is not supportedTest cases 3
Called from 1
Calls 7
- class-const PlatformFactory::DRIVER_MYSQL() line 79
- new MySqlSchemaFetcher line 79
- class-const PlatformFactory::DRIVER_SQLITE() line 80
- new SqliteSchemaFetcher line 80
- class-const PlatformFactory::DRIVER_PGSQL() line 81
- new PostgreSqlSchemaFetcher line 81
- new UnsupportedDriverException line 82
public static function detectDriver(PDO $pdo): stringDetect the driver name from a PDO connection.
Parameters
$pdo | PDO |
Returns
stringThrows
DriverDetectionException If the connection does not report a driver nameUnsupportedDriverException If the reported driver is not supportedTest cases 2
Called from 1
Calls 8
- method-call
PDO::getAttribute()line 94 - class-const
PDO::ATTR_DRIVER_NAME()line 94 - function-call
is_stringline 96 - new DriverDetectionException line 97
- class-const PlatformFactory::DRIVER_MYSQL() line 101
- class-const PlatformFactory::DRIVER_SQLITE() line 102
- class-const PlatformFactory::DRIVER_PGSQL() line 103
- new UnsupportedDriverException line 104
public static function getSupportedDrivers(): list<string>Get the list of supported drivers.
Returns
list<string>Test cases 1
Calls 3
- class-const PlatformFactory::DRIVER_MYSQL() line 116
- class-const PlatformFactory::DRIVER_SQLITE() line 117
- class-const PlatformFactory::DRIVER_PGSQL() line 118
Test cases 28§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 12
PlatformFactoryTest::testCreateSchemaFetcherForMysqlcallsPlatformFactoryTest::testCreateSchemaFetcherForPgsqlcallsPlatformFactoryTest::testCreateSchemaFetcherForSqlitecallsPlatformFactoryTest::testCreateSchemaParserForMysqlcallsPlatformFactoryTest::testCreateSchemaParserForPgsqlcallsPlatformFactoryTest::testCreateSchemaParserForSqlitecallsPlatformFactoryTest::testCreateTypeMapperForMysqlcallsPlatformFactoryTest::testCreateTypeMapperForPgsqlcallsPlatformFactoryTest::testCreateTypeMapperForSqlitecallsPlatformFactoryTest::testDetectDriverForSqlitecallsPlatformFactoryTest::testDetectDriverReadsTheNativeConnectioncallsPlatformFactoryTest::testGetSupportedDriverscalls
Other tests reaching this symbol 16
PostgreSqlEndToEndTest::fixtureReproducibleWithSeedcallsPostgreSqlEndToEndTest::fixtureWithArrayTypescallsPostgreSqlEndToEndTest::fixtureWithCommonTypescallsPostgreSqlEndToEndTest::fixtureWithGeneratedColumncallsPostgreSqlEndToEndTest::fixtureWithNumericPrecisioncallsPostgreSqlEndToEndTest::fixtureWithOverridescallsPostgreSqlEndToEndTest::fixtureWithPgSpecificTypescallsPostgreSqlEndToEndTest::fixtureWithSerialTypescallsPostgreSqlEndToEndTest::fixtureWithTimestampVariantscallsSqliteIntegrationTest::databaseFixtureProviderWithSqlitecallsSqliteIntegrationTest::fixtureProviderDialectOverridecallsSqliteIntegrationTest::fixtureProviderWithSqliteDialectcallsDatabaseFixtureProviderTestcallsFileFixtureProviderTestcallsFixtureProviderTestcallsSqlSchemaProviderTestcalls
Relations§
Static calls 9
- static-call SqlFixture\DatabaseFixtureProvider::__construct() packages/sql-fixture/src/DatabaseFixtureProvider.php:48
- static-call SqlFixture\DatabaseFixtureProvider::__construct() packages/sql-fixture/src/DatabaseFixtureProvider.php:50
- static-call SqlFixture\DatabaseFixtureProvider::__construct() packages/sql-fixture/src/DatabaseFixtureProvider.php:51
- static-call SqlFixture\DatabaseFixtureProvider::__construct() packages/sql-fixture/src/DatabaseFixtureProvider.php:53
- static-call SqlFixture\FileFixtureProvider::__construct() packages/sql-fixture/src/FileFixtureProvider.php:39
- static-call SqlFixture\FileFixtureProvider::__construct() packages/sql-fixture/src/FileFixtureProvider.php:40
- static-call SqlFixture\FixtureProvider::__construct() packages/sql-fixture/src/FixtureProvider.php:56
- static-call SqlFixture\FixtureProvider::__construct() packages/sql-fixture/src/FixtureProvider.php:57
- static-call SqlFixture\Provider\SqlSchemaProvider::getSchema() packages/sql-fixture/src/Provider/SqlSchemaProvider.php:35