1 | <?php |
||
27 | class QueryBuilderFactory |
||
28 | { |
||
29 | /** |
||
30 | * @var Container $container |
||
31 | */ |
||
32 | private $container; |
||
33 | |||
34 | /** |
||
35 | * @param Container|null $container |
||
36 | */ |
||
37 | 4 | public function __construct(Container $container = null) |
|
41 | |||
42 | /** |
||
43 | * @return Container |
||
44 | */ |
||
45 | 4 | public function getContainer() |
|
49 | |||
50 | /** |
||
51 | * @param ConnectionInterface $connection |
||
52 | * @param string $name |
||
53 | */ |
||
54 | 4 | public function registerConnection(ConnectionInterface $connection, $name = 'default') |
|
55 | { |
||
56 | 4 | $this->container['phuria.sql_builder.connection_manager']->registerConnection( |
|
57 | $connection, $name |
||
58 | ); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @param string $class |
||
63 | * |
||
64 | * @return QueryCompilerInterface |
||
65 | */ |
||
66 | 4 | private function createQueryBuilder($class) |
|
77 | |||
78 | /** |
||
79 | * @return SelectBuilder |
||
|
|||
80 | */ |
||
81 | public function createSelect() |
||
82 | { |
||
83 | return $this->createQueryBuilder(SelectBuilder::class); |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @return UpdateBuilder |
||
88 | */ |
||
89 | 4 | public function createUpdate() |
|
93 | |||
94 | /** |
||
95 | * @return DeleteBuilder |
||
96 | */ |
||
97 | public function createDelete() |
||
101 | |||
102 | /** |
||
103 | * @return InsertBuilder |
||
104 | */ |
||
105 | 4 | public function createInsert() |
|
109 | |||
110 | /** |
||
111 | * @return InsertSelectBuilder |
||
112 | */ |
||
113 | public function createInsertSelect() |
||
117 | } |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.