1 | <?php |
||
32 | class QueryExpressionVisitor extends ExpressionVisitor |
||
33 | { |
||
34 | /** |
||
35 | * Map Criteria API comparison operators to query builder methods |
||
36 | * |
||
37 | * @todo Implement support for Comparison::CONTAINS |
||
38 | * @var array |
||
39 | */ |
||
40 | private static $operatorMethods = array( |
||
41 | Comparison::EQ => 'equals', |
||
42 | Comparison::GT => 'gt', |
||
43 | Comparison::GTE => 'gte', |
||
44 | Comparison::IN => 'in', |
||
45 | Comparison::IS => 'equals', |
||
46 | Comparison::LT => 'lt', |
||
47 | Comparison::LTE => 'lte', |
||
48 | Comparison::NEQ => 'notEqual', |
||
49 | Comparison::NIN => 'notIn', |
||
50 | ); |
||
51 | |||
52 | /** |
||
53 | * Map Criteria API composite types to query builder methods |
||
54 | * |
||
55 | * @var array |
||
56 | */ |
||
57 | private static $compositeMethods = array( |
||
58 | CompositeExpression::TYPE_AND => 'addAnd', |
||
59 | CompositeExpression::TYPE_OR => 'addOr', |
||
60 | ); |
||
61 | |||
62 | /** |
||
63 | * @var Builder |
||
64 | */ |
||
65 | protected $builder; |
||
66 | |||
67 | /** |
||
68 | * Constructor. |
||
69 | * |
||
70 | * @param Builder $builder |
||
71 | */ |
||
72 | public function __construct(Builder $builder) |
||
76 | |||
77 | /** |
||
78 | * Converts a comparison expression into the target query language output. |
||
79 | * |
||
80 | * @see ExpressionVisitor::walkComparison() |
||
81 | * @param Comparison $comparison |
||
82 | * @return \Doctrine\ODM\MongoDB\Query\Expr |
||
83 | */ |
||
84 | public function walkComparison(Comparison $comparison) |
||
113 | |||
114 | /** |
||
115 | * Converts a composite expression into the target query language output. |
||
116 | * |
||
117 | * @see ExpressionVisitor::walkCompositeExpression() |
||
118 | * @param CompositeExpression $expr |
||
|
|||
119 | * @return \Doctrine\ODM\MongoDB\Query\Expr |
||
120 | */ |
||
121 | public function walkCompositeExpression(CompositeExpression $compositeExpr) |
||
136 | |||
137 | /** |
||
138 | * Converts a value expression into the target query language part. |
||
139 | * |
||
140 | * @see ExpressionVisitor::walkValue() |
||
141 | * @param Value $value |
||
142 | * @return mixed |
||
143 | */ |
||
144 | public function walkValue(Value $value) |
||
148 | } |
||
149 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.