Code Duplication    Length = 9-14 lines in 2 locations

src/Database/DatabaseQuery.php 2 locations

@@ 67-75 (lines=9) @@
64
     *
65
     * @return bool
66
     */
67
    public function checkTableExist($table, $con=NULL)
68
    {
69
        $connection = $this->checkConnection($con);
70
        $query = $connection->query("SELECT 1 FROM {$table} LIMIT 1");
71
        if( $query !== false )
72
        {
73
            return true;
74
        }
75
    }
76
77
    /**
78
     * checkTableName Return the table name
@@ 85-98 (lines=14) @@
82
     *
83
     * @return string
84
     */
85
    public static function checkTableName($tableName, $con=NULL)
86
    {
87
        $connection = self::checkConnection($con);
88
        // if( ! is_null($connection) )
89
        // {
90
            $query = $connection->query("SELECT 1 FROM {$tableName} LIMIT 1");
91
            if( $query !== false )
92
            {
93
                return $tableName;
94
            }
95
            throw new TableDoesNotExistException();
96
        // }
97
        // throw new InvalidConnectionException();
98
    }
99
100
    /**
101
     * checkColumn Check if column exist in table