1 | <?php |
||
26 | class QueryBuilder |
||
27 | { |
||
28 | /** |
||
29 | * @var Container $container |
||
30 | */ |
||
31 | private $container; |
||
32 | |||
33 | /** |
||
34 | * @param Container|null $container |
||
35 | */ |
||
36 | 6 | public function __construct(Container $container = null) |
|
40 | |||
41 | /** |
||
42 | * @return Container |
||
43 | */ |
||
44 | 6 | public function getContainer() |
|
45 | { |
||
46 | 6 | return $this->container; |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param string $class |
||
51 | * |
||
52 | * @return QueryCompilerInterface |
||
53 | */ |
||
54 | 35 | private function createQueryBuilder($class) |
|
55 | { |
||
56 | 35 | $parameterClass = $this->container['phuria.sql_builder.parameter_manager.class']; |
|
57 | |||
58 | 35 | return new $class( |
|
59 | 35 | $this->container['phuria.sql_builder.table_factory'], |
|
60 | 35 | $this->container['phuria.sql_builder.query_compiler'], |
|
61 | new $parameterClass |
||
62 | 35 | ); |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return SelectBuilder |
||
|
|||
67 | */ |
||
68 | 26 | public function select() |
|
72 | |||
73 | /** |
||
74 | * @return UpdateBuilder |
||
75 | */ |
||
76 | 4 | public function update() |
|
80 | |||
81 | /** |
||
82 | * @return DeleteBuilder |
||
83 | */ |
||
84 | 3 | public function delete() |
|
88 | |||
89 | /** |
||
90 | * @return InsertBuilder |
||
91 | */ |
||
92 | 2 | public function insert() |
|
96 | |||
97 | /** |
||
98 | * @return InsertSelectBuilder |
||
99 | */ |
||
100 | 6 | public function insertSelect() |
|
104 | } |
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.