1 | <?php |
||
8 | class FlashesTokenParserSpec extends ObjectBehavior |
||
9 | { |
||
10 | /** |
||
11 | * @param Twig_Parser $parser |
||
12 | * @param Twig_ExpressionParser $exprParser |
||
13 | * @param Twig_TokenStream $stream |
||
14 | * @param Twig_Token $token |
||
15 | * @param Twig_NodeInterface $body |
||
|
|||
16 | * @param Knp\RadBundle\Twig\FlashesNodeFactory $nodeFactory |
||
17 | * @param Knp\RadBundle\Twig\FlashesNode $node |
||
18 | */ |
||
19 | function let($parser, $exprParser, $stream, $nodeFactory, $token) |
||
30 | |||
31 | function it_should_be_a_twig_token_parser() |
||
35 | |||
36 | function it_should_handle_flashes_tags() |
||
40 | |||
41 | /** |
||
42 | * {% flashes {expr:types} using catalog {expr:catalog} %} |
||
43 | * <div class="flash {{ type }}">{{ message }}</div> |
||
44 | * {% endflashes %} |
||
45 | * |
||
46 | * @param Twig_Node_Expression $types |
||
47 | * @param Twig_Node_Expression $catalog |
||
48 | */ |
||
49 | function it_should_parse_complete_flashes_tag( |
||
67 | |||
68 | /** |
||
69 | * {% flashes {expr:types} %} |
||
70 | * <div class="flash {{ type }}">{{ message }}</div> |
||
71 | * {% endflashes %} |
||
72 | * |
||
73 | * @param Twig_Node_Expression $types |
||
74 | */ |
||
75 | function it_should_parse_flashes_tag_with_no_specified_catalog( |
||
92 | |||
93 | /** |
||
94 | * {% flashes using catalog {expr:catalog} %} |
||
95 | * <div class="flash {{ type }}">{{ message }}</div> |
||
96 | * {% endflashes %} |
||
97 | * |
||
98 | * @param Twig_Node_Expression $catalog |
||
99 | */ |
||
100 | function it_should_parse_flashes_tag_with_no_specified_types( |
||
117 | |||
118 | /** |
||
119 | * {% flashes using catalog {expr:catalog} %} |
||
120 | * <div class="flash {{ type }}">{{ message }}</div> |
||
121 | * {% endflashes %} |
||
122 | */ |
||
123 | function it_should_parse_flashes_tag_with_no_specified_types_nor_catalog( |
||
138 | |||
139 | function its_isEndTag_should_return_true_recognize_end_tag_token($token) |
||
145 | |||
146 | function its_isEndTag_should_return_false_otherwise($token) |
||
152 | } |
||
153 |
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.