@@ -12,8 +12,8 @@ |
||
12 | 12 | namespace Phuria\SQLBuilder\QueryBuilder\Component; |
13 | 13 | |
14 | 14 | use Phuria\SQLBuilder\QueryBuilder\AbstractBuilder; |
15 | -use Phuria\SQLBuilder\Table\AbstractTable; |
|
16 | 15 | use Phuria\SQLBuilder\TableFactory\TableFactoryInterface; |
16 | +use Phuria\SQLBuilder\Table\AbstractTable; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @author Beniamin Jonatan Šimko <[email protected]> |
@@ -12,8 +12,8 @@ |
||
12 | 12 | namespace Phuria\SQLBuilder\QueryBuilder\Component; |
13 | 13 | |
14 | 14 | use Phuria\SQLBuilder\QueryBuilder\AbstractBuilder; |
15 | -use Phuria\SQLBuilder\Table\AbstractTable; |
|
16 | 15 | use Phuria\SQLBuilder\TableFactory\TableFactoryInterface; |
16 | +use Phuria\SQLBuilder\Table\AbstractTable; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @author Beniamin Jonatan Šimko <[email protected]> |
@@ -62,7 +62,7 @@ |
||
62 | 62 | private function convertReferenceToValue($reference) |
63 | 63 | { |
64 | 64 | if (is_string($reference)) { |
65 | - return "\"" . $reference ."\""; |
|
65 | + return "\"" . $reference . "\""; |
|
66 | 66 | } elseif ($reference instanceof AbstractTable) { |
67 | 67 | return $reference->getAliasOrName(); |
68 | 68 | } elseif ($reference instanceof QueryComponentInterface) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
66 | - * @return SelectBuilder |
|
66 | + * @return QueryCompilerInterface |
|
67 | 67 | */ |
68 | 68 | public function select() |
69 | 69 | { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
74 | - * @return UpdateBuilder |
|
74 | + * @return QueryCompilerInterface |
|
75 | 75 | */ |
76 | 76 | public function update() |
77 | 77 | { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | - * @return DeleteBuilder |
|
82 | + * @return QueryCompilerInterface |
|
83 | 83 | */ |
84 | 84 | public function delete() |
85 | 85 | { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * @return InsertBuilder |
|
90 | + * @return QueryCompilerInterface |
|
91 | 91 | */ |
92 | 92 | public function insert() |
93 | 93 | { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | - * @return InsertSelectBuilder |
|
98 | + * @return QueryCompilerInterface |
|
99 | 99 | */ |
100 | 100 | public function insertSelect() |
101 | 101 | { |
@@ -98,8 +98,8 @@ |
||
98 | 98 | $builder = $payload->getBuilder(); |
99 | 99 | |
100 | 100 | if ($builder instanceof Component\InsertValuesComponentInterface) { |
101 | - $newSQL = 'VALUES ' . implode(', ', array_map(function (array $values) { |
|
102 | - return '('. implode(', ', $values) . ')'; |
|
101 | + $newSQL = 'VALUES ' . implode(', ', array_map(function(array $values) { |
|
102 | + return '(' . implode(', ', $values) . ')'; |
|
103 | 103 | }, $builder->getValues())); |
104 | 104 | $payload = $payload->appendSQL($newSQL); |
105 | 105 | } |
@@ -35,15 +35,15 @@ |
||
35 | 35 | |
36 | 36 | $container['phuria.sql_builder.parameter_manager.class'] = ParameterManager::class; |
37 | 37 | |
38 | - $container['phuria.sql_builder.table_registry'] = function () { |
|
38 | + $container['phuria.sql_builder.table_registry'] = function() { |
|
39 | 39 | return new TableRegistry(); |
40 | 40 | }; |
41 | 41 | |
42 | - $container['phuria.sql_builder.table_factory'] = function (Container $c) { |
|
42 | + $container['phuria.sql_builder.table_factory'] = function(Container $c) { |
|
43 | 43 | return new TableFactory($c['phuria.sql_builder.table_registry']); |
44 | 44 | }; |
45 | 45 | |
46 | - $container['phuria.sql_builder.query_compiler'] = function () { |
|
46 | + $container['phuria.sql_builder.query_compiler'] = function() { |
|
47 | 47 | $queryCompiler = new QueryCompiler(); |
48 | 48 | $queryCompiler->addConcreteCompiler(new SelectCompiler()); |
49 | 49 | $queryCompiler->addConcreteCompiler(new InsertCompiler()); |