It'd be great if we could use db or database (or any other name) as argument names if there is only one database declared.
Currently you have to use default database name as an injection argument:
// database config
return [
'default' => 'default',
'databases' => [
'default' => [
'driver' => 'postgres',
],
],
...
]
// some service
public function __construct(private DatabaseInterface $default) {}
private DatabaseInterface $db would throw an exception: db preset was not found.
It'd be great if we could use
db
ordatabase
(or any other name) as argument names if there is only one database declared. Currently you have to use default database name as an injection argument:private DatabaseInterface $db
would throw an exception:db preset was not found
.