| Total Complexity | 1 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class QueryBuilder extends AbstractQueryBuilder |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var array mapping from abstract column types (keys) to physical column types (values). |
||
| 16 | * |
||
| 17 | * @psalm-var string[] $typeMap |
||
| 18 | */ |
||
| 19 | protected array $typeMap = [ |
||
| 20 | Schema::TYPE_PK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL', |
||
| 21 | Schema::TYPE_UPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL', |
||
| 22 | Schema::TYPE_BIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL', |
||
| 23 | Schema::TYPE_UBIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL', |
||
| 24 | Schema::TYPE_CHAR => 'char(1)', |
||
| 25 | Schema::TYPE_STRING => 'varchar(255)', |
||
| 26 | Schema::TYPE_TEXT => 'text', |
||
| 27 | Schema::TYPE_TINYINT => 'tinyint', |
||
| 28 | Schema::TYPE_SMALLINT => 'smallint', |
||
| 29 | Schema::TYPE_INTEGER => 'integer', |
||
| 30 | Schema::TYPE_BIGINT => 'bigint', |
||
| 31 | Schema::TYPE_FLOAT => 'float', |
||
| 32 | Schema::TYPE_DOUBLE => 'double', |
||
| 33 | Schema::TYPE_DECIMAL => 'decimal(10,0)', |
||
| 34 | Schema::TYPE_DATETIME => 'datetime', |
||
| 35 | Schema::TYPE_TIMESTAMP => 'timestamp', |
||
| 36 | Schema::TYPE_TIME => 'time', |
||
| 37 | Schema::TYPE_DATE => 'date', |
||
| 38 | Schema::TYPE_BINARY => 'blob', |
||
| 39 | Schema::TYPE_BOOLEAN => 'boolean', |
||
| 40 | Schema::TYPE_MONEY => 'decimal(19,4)', |
||
| 41 | ]; |
||
| 42 | private DDLQueryBuilder $ddlBuilder; |
||
| 43 | private DMLQueryBuilder $dmlBuilder; |
||
| 44 | private DQLQueryBuilder $dqlBuilder; |
||
| 45 | |||
| 46 | 338 | public function __construct(QuoterInterface $quoter, SchemaInterface $schema) |
|
| 54 |
Let?s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let?s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: