Code Duplication    Length = 13-13 lines in 2 locations

code/DebugBarDatabaseNewProxy.php 1 location

@@ 121-133 (lines=13) @@
118
     * @param string $sql The query to be executed
119
     * @return boolean Flag indicating that the query was previewed
120
     */
121
    protected function previewWrite($sql)
122
    {
123
        // Only preview if previewWrite is set, we are in dev mode, and
124
        // the query is mutable
125
        if (isset($_REQUEST['previewwrite']) && Director::isDev() && $this->connector->isQueryMutable($sql)
126
        ) {
127
            // output preview message
128
            Debug::message("Will execute: $sql");
129
            return true;
130
        } else {
131
            return false;
132
        }
133
    }
134
135
    /**
136
     * Allows the display and benchmarking of queries as they are being run

code/DebugBarDatabaseProxy.php 1 location

@@ 116-128 (lines=13) @@
113
     * @param string $sql The query to be executed
114
     * @return boolean Flag indicating that the query was previewed
115
     */
116
    protected function previewWrite($sql)
117
    {
118
        // Only preview if previewWrite is set, we are in dev mode, and
119
        // the query is mutable
120
        if (isset($_REQUEST['previewwrite']) && Director::isDev() && $this->connector->isQueryMutable($sql)
121
        ) {
122
            // output preview message
123
            Debug::message("Will execute: $sql");
124
            return true;
125
        } else {
126
            return false;
127
        }
128
    }
129
130
    /**
131
     * Allows the display and benchmarking of queries as they are being run