Skip to content

Commit

Permalink
fix GenericPlatform, impl all AbstractPlatfort abstract methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Aug 15, 2023
1 parent 5d4d431 commit 0253620
Showing 1 changed file with 74 additions and 23 deletions.
97 changes: 74 additions & 23 deletions src/Persistence/GenericPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,113 @@

namespace Atk4\Data\Persistence;

use Doctrine\DBAL\Exception as DbalException;
use Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\DateIntervalUnit;
use Doctrine\DBAL\Platforms\Exception\NotSupported;
use Doctrine\DBAL\Platforms\Keywords\KeywordList;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\TransactionIsolationLevel;

class GenericPlatform extends Platforms\AbstractPlatform
class GenericPlatform extends AbstractPlatform
{
private function createNotSupportedException(): \Exception
protected function initializeDoctrineTypeMappings(): void
{
return DbalException::notSupported('SQL');
}

public function getName(): string
protected function _getCommonIntegerTypeDeclarationSQL(array $column): string
{
return 'atk4_data_generic';
throw NotSupported::new(__METHOD__);
}

protected function initializeDoctrineTypeMappings(): void
public function getBigIntTypeDeclarationSQL(array $column): string
{
throw NotSupported::new(__METHOD__);
}

public function getBlobTypeDeclarationSQL(array $column): string
{
throw NotSupported::new(__METHOD__);
}

protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef): string
public function getBooleanTypeDeclarationSQL(array $column): string
{
throw $this->createNotSupportedException();
throw NotSupported::new(__METHOD__);
}

public function getBigIntTypeDeclarationSQL(array $columnDef): string
public function getClobTypeDeclarationSQL(array $column): string
{
throw $this->createNotSupportedException();
throw NotSupported::new(__METHOD__);
}

public function getBlobTypeDeclarationSQL(array $field): string
public function getDateTimeTypeDeclarationSQL(array $column): string
{
throw $this->createNotSupportedException();
throw NotSupported::new(__METHOD__);
}

public function getBooleanTypeDeclarationSQL(array $columnDef): string
public function getDateTypeDeclarationSQL(array $column): string
{
throw $this->createNotSupportedException();
throw NotSupported::new(__METHOD__);
}

public function getClobTypeDeclarationSQL(array $field): string
public function getIntegerTypeDeclarationSQL(array $column): string
{
throw $this->createNotSupportedException();
throw NotSupported::new(__METHOD__);
}

public function getIntegerTypeDeclarationSQL(array $columnDef): string
public function getSmallIntTypeDeclarationSQL(array $column): string
{
throw $this->createNotSupportedException();
throw NotSupported::new(__METHOD__);
}

public function getSmallIntTypeDeclarationSQL(array $columnDef): string
public function getTimeTypeDeclarationSQL(array $column): string
{
throw $this->createNotSupportedException();
throw NotSupported::new(__METHOD__);
}

public function getCurrentDatabaseExpression(): string
{
throw $this->createNotSupportedException();
throw NotSupported::new(__METHOD__);
}

public function getLocateExpression(string $string, string $substring, string $start = null): string
{
throw NotSupported::new(__METHOD__);
}

public function getDateDiffExpression(string $date1, string $date2): string
{
throw NotSupported::new(__METHOD__);
}

protected function getDateArithmeticIntervalExpression(string $date, string $operator, string $interval, DateIntervalUnit $unit): string
{
throw NotSupported::new(__METHOD__);
}

public function getAlterTableSQL(TableDiff $diff): array
{
throw NotSupported::new(__METHOD__);
}

public function getListViewsSQL(string $database): string
{
throw NotSupported::new(__METHOD__);
}

public function getSetTransactionIsolationSQL(TransactionIsolationLevel $level): string
{
throw NotSupported::new(__METHOD__);
}

protected function createReservedKeywordsList(): KeywordList
{
throw NotSupported::new(__METHOD__);
}

public function createSchemaManager(Connection $connection): AbstractSchemaManager

Check failure on line 112 in src/Persistence/GenericPlatform.php

View workflow job for this annotation

GitHub Actions / Smoke (latest, StaticAnalysis)

Method Atk4\Data\Persistence\GenericPlatform::createSchemaManager() return type with generic class Doctrine\DBAL\Schema\AbstractSchemaManager does not specify its types: T

Check failure on line 112 in src/Persistence/GenericPlatform.php

View workflow job for this annotation

GitHub Actions / Smoke (latest, StaticAnalysis)

Method Atk4\Data\Persistence\GenericPlatform::createSchemaManager() return type with generic class Doctrine\DBAL\Schema\AbstractSchemaManager does not specify its types: T
{
throw NotSupported::new(__METHOD__);
}
}

0 comments on commit 0253620

Please sign in to comment.