Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 621
Zeile 2... Zeile 2...
2
 
2
 
Zeile 3... Zeile 3...
3
declare(strict_types=1);
3
declare(strict_types=1);
Zeile -... Zeile 4...
-
 
4
 
-
 
5
namespace Doctrine\DBAL\Driver\IBMDB2;
4
 
6
 
5
namespace Doctrine\DBAL\Driver\IBMDB2;
7
use SensitiveParameter;
6
 
8
 
Zeile 7... Zeile 9...
7
use function implode;
9
use function implode;
Zeile 13... Zeile 15...
13
 */
15
 */
14
final class DataSourceName
16
final class DataSourceName
15
{
17
{
16
    private string $string;
18
    private string $string;
Zeile 17... Zeile 19...
17
 
19
 
-
 
20
    private function __construct(
-
 
21
        #[SensitiveParameter]
18
    private function __construct(string $string)
22
        string $string
19
    {
23
    ) {
20
        $this->string = $string;
24
        $this->string = $string;
Zeile 21... Zeile 25...
21
    }
25
    }
22
 
26
 
Zeile 28... Zeile 32...
28
    /**
32
    /**
29
     * Creates the object from an array representation
33
     * Creates the object from an array representation
30
     *
34
     *
31
     * @param array<string,mixed> $params
35
     * @param array<string,mixed> $params
32
     */
36
     */
33
    public static function fromArray(array $params): self
37
    public static function fromArray(
-
 
38
        #[SensitiveParameter]
-
 
39
        array $params
34
    {
40
    ): self {
35
        $chunks = [];
41
        $chunks = [];
Zeile 36... Zeile 42...
36
 
42
 
37
        foreach ($params as $key => $value) {
43
        foreach ($params as $key => $value) {
38
            $chunks[] = sprintf('%s=%s', $key, $value);
44
            $chunks[] = sprintf('%s=%s', $key, $value);
Zeile 44... Zeile 50...
44
    /**
50
    /**
45
     * Creates the object from the given DBAL connection parameters.
51
     * Creates the object from the given DBAL connection parameters.
46
     *
52
     *
47
     * @param array<string,mixed> $params
53
     * @param array<string,mixed> $params
48
     */
54
     */
49
    public static function fromConnectionParameters(array $params): self
55
    public static function fromConnectionParameters(
-
 
56
        #[SensitiveParameter]
-
 
57
        array $params
50
    {
58
    ): self {
51
        if (isset($params['dbname']) && strpos($params['dbname'], '=') !== false) {
59
        if (isset($params['dbname']) && strpos($params['dbname'], '=') !== false) {
52
            return new self($params['dbname']);
60
            return new self($params['dbname']);
53
        }
61
        }
Zeile 54... Zeile 62...
54
 
62