fix: database as optional parameter for set_credentials (#25)

This is another follow-up PR for #22 which fixes a deprecation issue about defining optional parameters that are then called as named.

```php
Database::set_credentials("db");
```
```
vlw\Scaffold\Database::set_credentials(): Optional parameter $host declared before required parameter $database is implicitly treated as a required parameter
```

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/25
This commit is contained in:
Victor Westerlund 2026-02-12 08:48:37 +01:00
parent f4b8f8673e
commit 8a04cab4b5

View file

@ -32,7 +32,7 @@
?string $host = self::DEFAULT_HOSTNAME,
?string $username = self::DEFAULT_USERNAME,
?string $password = self::DEFAULT_PASSWORD,
string $database
?string $database = ""
) {
// Create key if it does not exist
if (!$_ENV["mariadb"]) {