Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"phpnomad/logger": "^1.0"
},
"require-dev": {
"phpnomad/event": "^1.0",
"phpnomad/tests": "^0.1.0 || ^0.3.0"
},
"config": {
Expand Down
42 changes: 41 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/Abstracts/JunctionTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @var mixed|null
*/
protected LoggerStrategy $logger;

Check failure on line 28 in lib/Abstracts/JunctionTable.php

View workflow job for this annotation

GitHub Actions / phpstan

PHPDoc tag @var for property PHPNomad\Database\Abstracts\JunctionTable::$logger with type mixed is not subtype of native type PHPNomad\Logger\Interfaces\LoggerStrategy.

public function __construct(
HasLocalDatabasePrefix $localPrefixProvider,
Expand All @@ -39,10 +39,10 @@
)
{
$args = func_get_args();
$this->logger = array_pop($args);

Check failure on line 42 in lib/Abstracts/JunctionTable.php

View workflow job for this annotation

GitHub Actions / phpstan

Property PHPNomad\Database\Abstracts\JunctionTable::$logger (PHPNomad\Logger\Interfaces\LoggerStrategy) does not accept mixed.
$this->rightTable = array_pop($args);

Check failure on line 43 in lib/Abstracts/JunctionTable.php

View workflow job for this annotation

GitHub Actions / phpstan

Property PHPNomad\Database\Abstracts\JunctionTable::$rightTable (PHPNomad\Database\Abstracts\Table) does not accept mixed.
$this->leftTable = array_pop($args);

Check failure on line 44 in lib/Abstracts/JunctionTable.php

View workflow job for this annotation

GitHub Actions / phpstan

Property PHPNomad\Database\Abstracts\JunctionTable::$leftTable (PHPNomad\Database\Abstracts\Table) does not accept mixed.
parent::__construct(...$args);

Check failure on line 45 in lib/Abstracts/JunctionTable.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter #1 $localPrefixProvider of method PHPNomad\Database\Abstracts\Table::__construct() expects PHPNomad\Database\Interfaces\HasLocalDatabasePrefix, mixed given.
}

/**
Expand Down Expand Up @@ -104,7 +104,7 @@
*/
public function getLeftColumnName(): string
{
return $this->tableSchemaService->getJunctionColumnNameFromTableUncached($this->leftTable);
return $this->tableSchemaService->getJunctionColumnNameFromTable($this->leftTable);
}

/**
Expand All @@ -114,7 +114,7 @@
*/
public function getRightColumnName(): string
{
return $this->tableSchemaService->getJunctionColumnNameFromTableUncached($this->rightTable);
return $this->tableSchemaService->getJunctionColumnNameFromTable($this->rightTable);
}

/**
Expand Down Expand Up @@ -146,7 +146,7 @@
{
try {
// Find the corresponding primary column by the column name
$primaryColumn = $this->tableSchemaService->getPrimaryColumnNameForTableUncached($primaryTable);
$primaryColumn = $this->tableSchemaService->getPrimaryColumnNameForTable($primaryTable);
}catch(ColumnNotFoundException $e){
$this->logger->logException($e, '', [], LoggerLevel::Emergency);
throw $e;
Expand Down
18 changes: 10 additions & 8 deletions lib/Services/TableSchemaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public function getPrimaryColumnsForTable(TableInterface $table): array
}

/**
* Read the supplied descriptor without consulting or changing shared cache.
* Returns the same primary-column metadata that the cached lookup computes
* after a cache miss.
* Read the supplied descriptor without this service consulting or changing
* its shared cache. Returns the same primary-column metadata that the cached
* lookup computes after a cache miss.
* Descriptor failures propagate unchanged. This does not inspect storage.
* Custom descriptors must provide stable, side-effect-free metadata.
* Descriptor callbacks may invoke cached methods or perform other side effects.
*
* @return Column[]
*/
Expand All @@ -48,8 +48,9 @@ public function getPrimaryColumnsForTableUncached(TableInterface $table): array
}

/**
* Return the descriptor's sole primary Column without shared cache access.
* Preserves the cached helper's cardinality rule and original Column object.
* Return the descriptor's sole primary Column without this service accessing
* its shared cache. Preserves the cached helper's cardinality rule and original
* Column object. Descriptor callbacks may cross their own cache boundaries.
*
* @throws ColumnNotFoundException When there is not exactly one primary column.
*/
Expand All @@ -68,8 +69,9 @@ public function getPrimaryColumnNameForTableUncached(TableInterface $table): Col
}

/**
* Compose the existing junction-column name without shared cache access.
* Descriptor failures propagate unchanged.
* Compose the existing junction-column name without this service accessing
* its shared cache. Descriptor failures propagate unchanged. Descriptor
* callbacks may cross their own cache boundaries.
*
* @throws ColumnNotFoundException When there is not exactly one primary column.
*/
Expand Down
Loading
Loading