Code Duplication    Length = 11-19 lines in 2 locations

sources/lib/Inspector/Inspector.php 2 locations

@@ 271-281 (lines=11) @@
268
     * @param  int         $table_oid
269
     * @return string|null
270
     */
271
    public function getTableComment($table_oid)
272
    {
273
        $sql      = <<<SQL
274
select description from pg_catalog.pg_description where :condition
275
SQL;
276
277
        $where    = Where::create('objoid = $*', [$table_oid]);
278
        $iterator = $this->executeSql($sql, $where);
279
280
        return $iterator->isEmpty() ? null : $iterator->current()['description'];
281
    }
282
283
    /**
284
     * getTypeInformation
@@ 328-346 (lines=19) @@
325
     * @param  int        $oid
326
     * @return array|null
327
     */
328
    public function getTypeCategory($oid)
329
    {
330
        $sql = <<<SQL
331
select
332
    case
333
        when n is null then t.type_name
334
        else n.nspname||'.'||t.type_name
335
    end as "name",
336
    t.typcategory as "category"
337
from
338
    pg_catalog.pg_type t
339
        left join pg_namespace n on n.oid = t.typnamespace
340
where
341
    :condition
342
SQL;
343
        $iterator = $this->executeSql($sql, Where::create('t.oid = $*', [$oid]));
344
345
        return $iterator->isEmpty() ? null : $iterator->current();
346
    }
347
348
    /**
349
     * getTypeEnumValues