EntityManagerConfigs::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasDoctrine\Config;
6
7
class EntityManagerConfigs
8
{
9
    /**
10
     * @param array<mixed> $configs
11
     */
12
    public function __construct(private array $configs)
13
    {
14
    }
15
16
    public function hasEntityManagerConfig(string $name): bool
17
    {
18
        return isset($this->configs[$name]);
19
    }
20
21
    /**
22
     * @return array<string, mixed>
23
     */
24
    public function getEntityManagerConfig(string $name): array
25
    {
26
        return $this->configs[$name] ?? [];
27
    }
28
29
    /**
30
     * @param array<string, mixed> $config
31
     */
32
    public function setEntityManagerConfig(string $name, array $config): void
33
    {
34
        $this->configs[$name] = $config;
35
    }
36
}
37