Passed
Push — 6.0 ( 7ab78c...8e0f01 )
by Olivier
01:35
created

lib/ActiveRecord/Config.php (1 issue)

1
<?php
2
3
/*
4
 * This file is part of the ICanBoogie package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ICanBoogie\ActiveRecord;
13
14
use ICanBoogie\ActiveRecord;
15
use ICanBoogie\ActiveRecord\Config\ConnectionDefinition;
16
use ICanBoogie\ActiveRecord\Config\ModelDefinition;
17
18
final class Config
19
{
20
    public const DEFAULT_CONNECTION_ID = 'primary';
21
22
    /**
23
     * @param array{
24
     *     connections: array<string, ConnectionDefinition>,
25
     *     models: array<class-string<ActiveRecord>, ModelDefinition>,
26
     * } $an_array
27
     */
28
    public static function __set_state(array $an_array): self
29
    {
30
        return new self(...$an_array);
31
    }
32
33
    /**
34
     * @param array<string, ConnectionDefinition> $connections
35
     *     Where _key_ is an identifier.
36
     * @param array<class-string<ActiveRecord>, ModelDefinition> $models
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<class-string<Activ...cord>, ModelDefinition> at position 2 could not be parsed: Unknown type name 'class-string' at position 2 in array<class-string<ActiveRecord>, ModelDefinition>.
Loading history...
37
     */
38
    public function __construct(
39
        public readonly array $connections,
40
        public readonly array $models,
41
    ) {
42
    }
43
}
44