Code Duplication    Length = 12-12 lines in 2 locations

src/Registry/DoctrineDbalConnectionRegistry.php 1 location

@@ 47-58 (lines=12) @@
44
     *
45
     * @return Connection
46
     */
47
    public function getConnection($name = null): Connection
48
    {
49
        $this->loadConnections();
50
51
        $name = $name ?? $this->getDefaultConnectionName();
52
53
        if (!isset($this->connections[$name])) {
54
            throw new \InvalidArgumentException(sprintf('Missing connection with name "%s".', $name));
55
        }
56
57
        return $this->connections[$name];
58
    }
59
60
    /**
61
     * @return array<string, Connection>

src/Registry/DoctrineOrmManagerRegistry.php 1 location

@@ 68-79 (lines=12) @@
65
     *
66
     * @return Connection
67
     */
68
    public function getConnection($name = null): Connection
69
    {
70
        $this->loadConnections();
71
72
        $name = $name ?? $this->getDefaultConnectionName();
73
74
        if (!isset($this->connections[$name])) {
75
            throw new \InvalidArgumentException(sprintf('Missing connection with name "%s".', $name));
76
        }
77
78
        return $this->connections[$name];
79
    }
80
81
    /**
82
     * @return array<string, Connection>