diff options
author | Dan Ungureanu <udan1107@gmail.com> | 2015-08-20 22:27:52 +0300 |
---|---|---|
committer | Dan Ungureanu <udan1107@gmail.com> | 2015-08-20 22:33:08 +0300 |
commit | 1b2988f296611f7294593fd1fff07c70ac514e2a (patch) | |
tree | ed618f577fe3acd835a3c801f1f8ec30d2956f8f /src/Components/Key.php | |
parent | 14c54da98c3b4f18c78ff44c22fbdd20e8ef6e18 (diff) | |
download | sql-parser-1b2988f296611f7294593fd1fff07c70ac514e2a.zip sql-parser-1b2988f296611f7294593fd1fff07c70ac514e2a.tar.gz sql-parser-1b2988f296611f7294593fd1fff07c70ac514e2a.tar.bz2 |
Fixed minor style issues in generated queries.v1.0.0
Introduced options for builders.
Data types are lower case in CREATE TABLE statements, but in any other case
they continue to be upper case.
Formatter uses 2 spaces instead of 4 for indentation as specified in the MySQL
Coding Guidelines.
https://dev.mysql.com/doc/internals/en/indentation-spacing.html.
Diffstat (limited to 'src/Components/Key.php')
-rw-r--r-- | src/Components/Key.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Components/Key.php b/src/Components/Key.php index ef5d3a8..89371fa 100644 --- a/src/Components/Key.php +++ b/src/Components/Key.php @@ -152,17 +152,18 @@ class Key extends Component } /** - * @param Key $component The component to be built. + * @param Key $component The component to be built. + * @param array $options Parameters for building. * * @return string */ - public static function build($component) + public static function build($component, array $options = array()) { $ret = $component->type . ' '; if (!empty($component->name)) { $ret .= Context::escape($component->name) . ' '; } - $ret .= '(' . implode(', ', Context::escape($component->columns)) . ') ' + $ret .= '(' . implode(',', Context::escape($component->columns)) . ') ' . $component->options; return trim($ret); } |