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
118 changes: 2 additions & 116 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,122 +7,8 @@ parameters:
path: src/AbstractTDBMObject.php

-
message: '#^Call to an undefined method Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:_getPortableFunctionDefinition\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Call to an undefined method Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:_getPortableFunctionsList\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Call to an undefined method Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:_getPortableTriggerDefinition\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Call to an undefined method Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:_getPortableTriggersList\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Call to an undefined method Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:_getPortableUserDefinition\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Call to an undefined method Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:_getPortableUsersList\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Call to an undefined method Doctrine\\DBAL\\Schema\\AbstractSchemaManager\:\:getFilterSchemaAssetsExpression\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableFunctionDefinition\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableFunctionDefinition\(\) has parameter \$function with no type specified\.$#'
identifier: missingType.parameter
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableFunctionsList\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableFunctionsList\(\) has parameter \$functions with no type specified\.$#'
identifier: missingType.parameter
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableTriggerDefinition\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableTriggerDefinition\(\) has parameter \$trigger with no type specified\.$#'
identifier: missingType.parameter
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableTriggersList\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableTriggersList\(\) has parameter \$triggers with no type specified\.$#'
identifier: missingType.parameter
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableUserDefinition\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableUserDefinition\(\) has parameter \$user with no type specified\.$#'
identifier: missingType.parameter
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableUsersList\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:_getPortableUsersList\(\) has parameter \$users with no type specified\.$#'
identifier: missingType.parameter
count: 1
path: src/Schema/LockFileSchemaManager.php

-
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:getFilterSchemaAssetsExpression\(\) has no return type specified\.$#'
identifier: missingType.return
message: '#^Method TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager\:\:getDatabasePlatform\(\) should return T of Doctrine\\DBAL\\Platforms\\AbstractPlatform but returns Doctrine\\DBAL\\Platforms\\AbstractPlatform\.$#'
identifier: return.type
count: 1
path: src/Schema/LockFileSchemaManager.php

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
// TODO: externalize composer.json file for autoloading (no more parameters for generateAllDaosAndBeans)

Expand Down
2 changes: 1 addition & 1 deletion src/DbRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function _dbLoadIfNotLoaded(): void
$sql = 'SELECT * FROM '.$connection->quoteIdentifier($this->dbTableName).' WHERE '.$sql_where;
$result = $connection->executeQuery($sql, $parameters);

$row = $result->fetch(\PDO::FETCH_ASSOC);
$row = $result->fetchAssociative();

if ($row === false) {
throw new TDBMException("Could not retrieve object from table \"$this->dbTableName\" using filter \".$sql_where.\" with data \"".var_export($parameters, true)."\".");
Expand Down
6 changes: 4 additions & 2 deletions src/QueryFactory/FindObjectsFromRawSqlQueryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ private function formatSelect(array $baseSelect): array
}

$table = $this->schema->getTable($tableName);
$pkColumns = $table->getPrimaryKeyColumns();
$primaryKey = $table->getPrimaryKey();
assert($primaryKey !== null, 'TDBM Only works on tables with primary keys');
$pkColumns = $primaryKey->getUnquotedColumns();
foreach ($table->getColumns() as $column) {
$columnName = $column->getName();
$alias = AbstractQueryFactory::getColumnAlias($tableName, $columnName);
Expand All @@ -252,7 +254,7 @@ private function formatSelect(array $baseSelect): array
]
];
$formattedSelect[] = $astColumn;
if (array_key_exists($columnName, $pkColumns)) {
if (in_array($columnName, $pkColumns, true)) {
$formattedCountSelect[] = $astColumn;
}
$columnDescriptors[$alias] = [
Expand Down
Loading
Loading