Skip to content

Commit

Permalink
More code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeder committed Jan 7, 2025
1 parent d448373 commit 0d17251
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
9 changes: 2 additions & 7 deletions modules/common/src/Storage/AbstractDatabaseTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ abstract class AbstractDatabaseTable implements DatabaseTableInterface {
*/
const EVENT_TABLE_CREATE = 'dkan_common_table_create';

/**
* Real table name.
*/
protected string $tableName;

/**
* A schema. Should be a drupal schema array.
*
Expand All @@ -45,7 +40,7 @@ abstract class AbstractDatabaseTable implements DatabaseTableInterface {
* Transform the string data given into what should be use by the insert
* query.
*/
abstract protected function prepareData(string $data, string $id = NULL): array;
abstract protected function prepareData(string $data, ?string $id = NULL): array;

/**
* Get the primary key used in the table.
Expand Down Expand Up @@ -110,7 +105,7 @@ public function retrieveAll(): array {
/**
* Store data.
*/
public function store($data, string $id = NULL): string {
public function store($data, ?string $id = NULL): string {
$this->setTable();

$existing = (isset($id)) ? $this->retrieve($id) : NULL;
Expand Down
1 change: 0 additions & 1 deletion modules/datastore/src/Storage/DatabaseTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public function __construct(

if ($this->tableExist($this->getTableName())) {
$this->setSchemaFromTable();
$this->tableName = $this->getTableName();
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/datastore/src/Storage/DatabaseTableFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DatabaseTableFactory implements FactoryInterface {
*/
public function __construct(
Connection $connection,
LoggerInterface $loggerChannel
LoggerInterface $loggerChannel,
) {
$this->connection = $connection;
$this->logger = $loggerChannel;
Expand Down

0 comments on commit 0d17251

Please sign in to comment.