Skip to content

Commit 93030bc

Browse files
committed
Add ArrayShape attribute on Database::getConfig method
1 parent 8144dcb commit 93030bc

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/Database.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Framework\Log\Logger;
2929
use Framework\Log\LogLevel;
3030
use InvalidArgumentException;
31+
use JetBrains\PhpStorm\ArrayShape;
3132
use JetBrains\PhpStorm\Language;
3233
use LogicException;
3334
use mysqli;
@@ -289,6 +290,22 @@ public function reconnect() : static
289290
/**
290291
* @return array<string,mixed>
291292
*/
293+
#[ArrayShape([
294+
'host' => 'string',
295+
'port' => 'int',
296+
'username' => 'string|null',
297+
'password' => 'string|null',
298+
'schema' => 'string|null',
299+
'socket' => 'string|null',
300+
'engine' => 'string',
301+
'charset' => 'string',
302+
'collation' => 'string',
303+
'timezone' => 'string',
304+
'ssl' => 'array',
305+
'failover' => 'array',
306+
'options' => 'array',
307+
'report' => 'int',
308+
])]
292309
public function getConfig() : array
293310
{
294311
return $this->config;

0 commit comments

Comments
 (0)