Code Duplication    Length = 3-4 lines in 2 locations

vendor/cakephp/cakephp/src/Database/SqlDialectTrait.php 2 locations

@@ 60-63 (lines=4) @@
57
            return $this->_startQuote . str_replace('.*', $this->_endQuote . '.*', $identifier);
58
        }
59
60
        if (preg_match('/^([\w-]+)\((.*)\)$/', $identifier, $matches)) {
61
// Functions
62
            return $matches[1] . '(' . $this->quoteIdentifier($matches[2]) . ')';
63
        }
64
65
        // Alias.field AS thing
66
        if (preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+AS\s*([\w-]+)$/i', $identifier, $matches)) {
@@ 66-68 (lines=3) @@
63
        }
64
65
        // Alias.field AS thing
66
        if (preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+AS\s*([\w-]+)$/i', $identifier, $matches)) {
67
            return $this->quoteIdentifier($matches[1]) . ' AS ' . $this->quoteIdentifier($matches[3]);
68
        }
69
70
        if (preg_match('/^[\w-_\s]*[\w-_]+/', $identifier)) {
71
            return $this->_startQuote . $identifier . $this->_endQuote;