Code Duplication    Length = 19-20 lines in 2 locations

sources/lib/Inspector/LegacyInspector.php 2 locations

@@ 97-116 (lines=20) @@
94
     * @return int|null
95
     * @deprecated
96
     */
97
    public function getTableOid($schema, $table)
98
    {
99
        $sql = <<<SQL
100
select
101
  c.oid as oid
102
from
103
    pg_catalog.pg_class c
104
        left join pg_catalog.pg_namespace n on n.oid = c.relnamespace
105
where
106
{condition}
107
SQL;
108
109
        $where = Where::create('n.nspname =  $*', [$schema])
110
            ->andWhere('c.relname = $*', [$table])
111
            ;
112
113
        $iterator = $this->executeSql($sql, $where);
114
115
        return $iterator->isEmpty() ? null : $iterator->current()['oid'];
116
    }
117
118
    /**
119
     * getTableFieldInformation
@@ 173-191 (lines=19) @@
170
     * @return int|null
171
     * @deprecated
172
     */
173
    public function getSchemaOid($schema, Where $where = null)
174
    {
175
        $condition =
176
            Where::create("s.nspname = $*", [$schema])
177
            ->andWhere($where)
178
            ;
179
        $sql = <<<SQL
180
select
181
    s.oid as oid
182
from
183
    pg_catalog.pg_namespace s
184
where
185
    {condition}
186
SQL;
187
188
        $iterator = $this->executeSql($sql, $condition);
189
190
        return $iterator->isEmpty() ? null : $iterator->current()['oid'];
191
    }
192
193
    /**
194
     * getPrimaryKey