| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 40 | public function __construct($pdo, $database = '', $tablePrefix = '', array $config = []) |
|
| 21 | { |
||
| 22 | 40 | parent::__construct($pdo, $database, $tablePrefix, $config); |
|
| 23 | 40 | if (class_exists(Type::class)) { |
|
| 24 | // Prevent geometry type fields from throwing a 'type not found' error when changing them |
||
| 25 | $geometries = [ |
||
| 26 | 40 | 'geometry', |
|
| 27 | 'point', |
||
| 28 | 'linestring', |
||
| 29 | 'polygon', |
||
| 30 | 'multipoint', |
||
| 31 | 'multilinestring', |
||
| 32 | 'multipolygon', |
||
| 33 | 'geomcollection', |
||
| 34 | 'geometrycollection', |
||
| 35 | ]; |
||
| 36 | 40 | $dbPlatform = $this->getDoctrineSchemaManager()->getDatabasePlatform(); |
|
| 37 | 40 | foreach ($geometries as $type) { |
|
| 38 | 40 | $dbPlatform->registerDoctrineTypeMapping($type, 'string'); |
|
| 39 | } |
||
| 51 |