mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-29 11:10:18 +02:00
[ticket/17530] Better classes naming
PHPBB-17530
This commit is contained in:
@@ -15,8 +15,8 @@ namespace phpbb\db\doctrine;
|
||||
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use phpbb\db\middleware\postgresql\phpbb_postgresql_platform;
|
||||
use phpbb\db\middleware\oracle\phpbb_oracle_platform;
|
||||
use phpbb\db\middleware\oracle\platform as oracle_platform;
|
||||
use phpbb\db\middleware\postgresql\platform as postgresql_platform;
|
||||
|
||||
/**
|
||||
* Case-insensitive string type (only supported by Postgres).
|
||||
@@ -30,7 +30,7 @@ class case_insensitive_string extends Type
|
||||
*/
|
||||
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
|
||||
{
|
||||
if ($platform instanceof phpbb_postgresql_platform)
|
||||
if ($platform instanceof postgresql_platform)
|
||||
{
|
||||
return 'varchar_ci';
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class case_insensitive_string extends Type
|
||||
// we used 3 times larger capacity for strings on oracle for unicode strings
|
||||
// as on other platforms. This is not the case with varchar_ci, which uses
|
||||
// the same length as other platforms.
|
||||
if ($platform instanceof phpbb_oracle_platform)
|
||||
if ($platform instanceof oracle_platform)
|
||||
{
|
||||
return $platform->getAsciiStringTypeDeclarationSQL($column);
|
||||
}
|
||||
|
@@ -20,10 +20,10 @@ use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use InvalidArgumentException;
|
||||
use phpbb\config_php_file;
|
||||
use phpbb\db\middleware\mysql\phpbb_mysql_middleware;
|
||||
use phpbb\db\middleware\oracle\phpbb_oracle_middleware;
|
||||
use phpbb\db\middleware\postgresql\phpbb_postgresql_middleware;
|
||||
use phpbb\db\middleware\sqlsrv\phpbb_sqlsrv_middleware;
|
||||
use phpbb\db\middleware\mysql\middleware as mysql_middleware;
|
||||
use phpbb\db\middleware\oracle\middleware as oracle_middleware;
|
||||
use phpbb\db\middleware\postgresql\middleware as postgresql_middleware;
|
||||
use phpbb\db\middleware\sqlsrv\middleware as sqlsrv_middleware;
|
||||
use phpbb\exception\runtime_exception;
|
||||
|
||||
/**
|
||||
@@ -101,10 +101,10 @@ class connection_factory
|
||||
|
||||
$middleware = match($driver)
|
||||
{
|
||||
'pdo_mysql', 'mysqli' => [new phpbb_mysql_middleware()],
|
||||
'pdo_oci', 'oci8' => [new phpbb_oracle_middleware()],
|
||||
'pdo_pgsql', 'pgsql' => [new phpbb_postgresql_middleware()],
|
||||
'pdo_sqlsrv', 'sqlsrv' => [new phpbb_sqlsrv_middleware()],
|
||||
'pdo_mysql', 'mysqli' => [new mysql_middleware()],
|
||||
'pdo_oci', 'oci8' => [new oracle_middleware()],
|
||||
'pdo_pgsql', 'pgsql' => [new postgresql_middleware()],
|
||||
'pdo_sqlsrv', 'sqlsrv' => [new sqlsrv_middleware()],
|
||||
default => [],
|
||||
};
|
||||
|
||||
|
@@ -13,8 +13,6 @@
|
||||
|
||||
namespace phpbb\db\doctrine;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Helper class to generate Doctrine DBAL configuration.
|
||||
*/
|
||||
@@ -32,7 +30,7 @@ class connection_parameter_factory
|
||||
*
|
||||
* @return array Doctrine DBAL connection parameters.
|
||||
*
|
||||
* @throws InvalidArgumentException If a required parameter is empty or null.
|
||||
* @throws \InvalidArgumentException If a required parameter is empty or null.
|
||||
*/
|
||||
public static function get_configuration(
|
||||
string $driver,
|
||||
@@ -68,7 +66,7 @@ class connection_parameter_factory
|
||||
*
|
||||
* @return array Doctrine's DBAL configuration for SQLite.
|
||||
*
|
||||
* @throws InvalidArgumentException If a required parameter is empty or null.
|
||||
* @throws \InvalidArgumentException If a required parameter is empty or null.
|
||||
*/
|
||||
private static function build_connection_parameters(
|
||||
array $params,
|
||||
@@ -87,7 +85,7 @@ class connection_parameter_factory
|
||||
|
||||
if (empty($user) || empty($name))
|
||||
{
|
||||
throw new InvalidArgumentException('Required database parameter is not set.');
|
||||
throw new \InvalidArgumentException('Required database parameter is not set.');
|
||||
}
|
||||
|
||||
$params = array_merge($params, [
|
||||
|
Reference in New Issue
Block a user