Compare commits

...

2 commits

Author SHA1 Message Date
c858cd111a fix: use array_key_exists() on $_ENV to determine if MariaDB key is set (#26)
Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/26
2026-02-12 08:56:31 +01:00
8a04cab4b5 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
2026-02-12 08:48:37 +01:00

View file

@ -32,10 +32,10 @@
?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"]) {
if (!array_key_exists("mariadb", $_ENV)) {
$_ENV["mariadb"] = [];
}