@@ -90,6 +90,7 @@ |
||
| 90 | 90 | * If that is also not the case, we assume the class is in the global |
| 91 | 91 | * namespace. |
| 92 | 92 | * |
| 93 | + * @param string $name |
|
| 93 | 94 | * @return string |
| 94 | 95 | */ |
| 95 | 96 | protected function fully_qualified_class_name($name) { |
@@ -68,6 +68,9 @@ discard block |
||
| 68 | 68 | return $tree_builder; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | + /** |
|
| 72 | + * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $c |
|
| 73 | + */ |
|
| 71 | 74 | protected function add_project_node($c) { |
| 72 | 75 | $c->arrayNode("project") |
| 73 | 76 | ->children() |
@@ -84,6 +87,9 @@ discard block |
||
| 84 | 87 | ->end(); |
| 85 | 88 | } |
| 86 | 89 | |
| 90 | + /** |
|
| 91 | + * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $c |
|
| 92 | + */ |
|
| 87 | 93 | protected function add_analysis_node($c) { |
| 88 | 94 | $c->arrayNode("analysis") |
| 89 | 95 | ->children() |
@@ -103,6 +109,9 @@ discard block |
||
| 103 | 109 | ->end(); |
| 104 | 110 | } |
| 105 | 111 | |
| 112 | + /** |
|
| 113 | + * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $c |
|
| 114 | + */ |
|
| 106 | 115 | protected function add_rules_node($c) { |
| 107 | 116 | $c->arrayNode("rules") |
| 108 | 117 | ->children() |
@@ -146,6 +155,9 @@ discard block |
||
| 146 | 155 | ->end(); |
| 147 | 156 | } |
| 148 | 157 | |
| 158 | + /** |
|
| 159 | + * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $c |
|
| 160 | + */ |
|
| 149 | 161 | protected function add_runtime_node($c) { |
| 150 | 162 | $c->arrayNode("runtime") |
| 151 | 163 | ->children() |
@@ -157,6 +169,9 @@ discard block |
||
| 157 | 169 | ->end(); |
| 158 | 170 | } |
| 159 | 171 | |
| 172 | + /** |
|
| 173 | + * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $c |
|
| 174 | + */ |
|
| 160 | 175 | protected function add_reports_node($c) { |
| 161 | 176 | $c->arrayNode("reports") |
| 162 | 177 | ->prototype("array") |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | namespace Lechimp\Dicto\App; |
| 12 | 12 | |
| 13 | 13 | use Lechimp\Dicto\Report; |
| 14 | - |
|
| 15 | 14 | use Symfony\Component\Config\Definition\Processor; |
| 16 | 15 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
| 17 | 16 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | - * @return Iterator <[Node,mixed]> |
|
| 109 | + * @return \Generator <[Node,mixed]> |
|
| 110 | 110 | */ |
| 111 | 111 | protected function switch_run_command(\Iterator $nodes, $step) { |
| 112 | 112 | list($cmd,$par) = $step; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | - * @return Iterator <[Node,mixed]> |
|
| 128 | + * @return \Generator <[Node,mixed]> |
|
| 129 | 129 | */ |
| 130 | 130 | protected function run_expand(\Iterator $nodes, \Closure $clsr) { |
| 131 | 131 | while ($nodes->valid()) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | - * @return Iterator <[Node,mixed]> |
|
| 142 | + * @return \Generator <[Node,mixed]> |
|
| 143 | 143 | */ |
| 144 | 144 | protected function run_extract(\Iterator $nodes, \Closure $clsr) { |
| 145 | 145 | while ($nodes->valid()) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | - * @return Iterator <[Node,mixed]> |
|
| 157 | + * @return \Generator <[Node,mixed]> |
|
| 158 | 158 | */ |
| 159 | 159 | protected function run_filter(\Iterator $nodes, \Closure $predicate) { |
| 160 | 160 | while ($nodes->valid()) { |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | - * @return Iterator <[Node,mixed]> |
|
| 171 | + * @return \Generator <[Node,mixed]> |
|
| 172 | 172 | */ |
| 173 | 173 | protected function add_result(\Iterator $nodes, &$result) { |
| 174 | 174 | while ($nodes->valid()) { |
@@ -153,6 +153,9 @@ |
||
| 153 | 153 | ); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | + /** |
|
| 157 | + * @param boolean $negate |
|
| 158 | + */ |
|
| 156 | 159 | protected function regexp_source_filter(PredicateFactory $f, Regexp $regexp, $negate) { |
| 157 | 160 | assert('is_bool($negate)'); |
| 158 | 161 | return $f->_custom(function(Graph\Entity $e) use ($regexp, $negate) { |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | |
| 13 | 13 | use Lechimp\Dicto\Regexp; |
| 14 | 14 | use Lechimp\Dicto\Analysis\Index; |
| 15 | -use Lechimp\Dicto\Analysis\Violation; |
|
| 16 | 15 | use Lechimp\Dicto\Definition\ArgumentParser; |
| 17 | 16 | use Lechimp\Dicto\Graph\Node; |
| 18 | 17 | use Lechimp\Dicto\Graph\PredicateFactory; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * @param string $atom |
| 43 | - * @return Name |
|
| 43 | + * @return Atom |
|
| 44 | 44 | */ |
| 45 | 45 | public function atom($atom) { |
| 46 | 46 | return new Atom($atom); |
@@ -113,11 +113,8 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * @param Definition $left |
|
| 117 | 116 | * @param Qualifier $qualifier |
| 118 | - * @param Atom $id |
|
| 119 | - * @param Parameter[] $parameters |
|
| 120 | - * @return Property |
|
| 117 | + * @return Rule |
|
| 121 | 118 | */ |
| 122 | 119 | public function rule(Qualifier $qualifier, Definition $definition) { |
| 123 | 120 | return new Rule($qualifier, $definition); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | // IMPLEMENTATION OF Parser |
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | - * @return Ruleset |
|
| 162 | + * @return AST\Root |
|
| 163 | 163 | */ |
| 164 | 164 | public function parse($source) { |
| 165 | 165 | $this->variables = array(); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * Root expression for the parser is some whitespace or comment where a |
| 172 | 172 | * top level statement is in the middle. |
| 173 | 173 | * |
| 174 | - * @return Ruleset |
|
| 174 | + * @return AST\Root |
|
| 175 | 175 | */ |
| 176 | 176 | protected function root() { |
| 177 | 177 | $lines = []; |
@@ -232,6 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | /** |
| 234 | 234 | * @param string |
| 235 | + * @param string $content |
|
| 235 | 236 | * @return string |
| 236 | 237 | */ |
| 237 | 238 | protected function trim_explanation($content) { |
@@ -257,7 +258,7 @@ discard block |
||
| 257 | 258 | /** |
| 258 | 259 | * Fetch a string from the stream. |
| 259 | 260 | * |
| 260 | - * @return string |
|
| 261 | + * @return AST\StringValue |
|
| 261 | 262 | */ |
| 262 | 263 | protected function string() { |
| 263 | 264 | $m = $this->current_match(); |
@@ -271,7 +272,7 @@ discard block |
||
| 271 | 272 | /** |
| 272 | 273 | * Fetch a variable from the stream. |
| 273 | 274 | * |
| 274 | - * @return V\Variable |
|
| 275 | + * @return AST\Definition |
|
| 275 | 276 | */ |
| 276 | 277 | protected function variable($right_binding_power = 0) { |
| 277 | 278 | $t = $this->current_symbol(); |
@@ -326,7 +327,7 @@ discard block |
||
| 326 | 327 | /** |
| 327 | 328 | * Fetch a rule schema and its arguments from the stream. |
| 328 | 329 | * |
| 329 | - * @return array (R\Schema, array) |
|
| 330 | + * @return AST\Atom (R\Schema, array) |
|
| 330 | 331 | */ |
| 331 | 332 | protected function schema() { |
| 332 | 333 | $t = $this->current_symbol(); |
@@ -344,7 +345,7 @@ discard block |
||
| 344 | 345 | /** |
| 345 | 346 | * Process a variable assignment. |
| 346 | 347 | * |
| 347 | - * @return null |
|
| 348 | + * @return AST\Assignment |
|
| 348 | 349 | */ |
| 349 | 350 | protected function variable_assignment() { |
| 350 | 351 | $m = $this->current_match(); |
@@ -357,7 +358,7 @@ discard block |
||
| 357 | 358 | /** |
| 358 | 359 | * Process a rule declaration. |
| 359 | 360 | * |
| 360 | - * @return null |
|
| 361 | + * @return AST\Rule |
|
| 361 | 362 | */ |
| 362 | 363 | protected function rule_declaration() { |
| 363 | 364 | if ($this->is_current_token_matched_by("only")) { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * Compile an AST to an according entity. |
| 81 | 81 | * |
| 82 | 82 | * @param AST\Node $node |
| 83 | - * @return mixed |
|
| 83 | + * @return Ruleset |
|
| 84 | 84 | */ |
| 85 | 85 | public function compile(AST\Root $node) { |
| 86 | 86 | $this->variables = array(); |
@@ -203,6 +203,9 @@ discard block |
||
| 203 | 203 | return $parameters; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | + /** |
|
| 207 | + * @return string |
|
| 208 | + */ |
|
| 206 | 209 | protected function compile_qualifier(AST\Qualifier $node) { |
| 207 | 210 | $which = $node->which(); |
| 208 | 211 | if ($which === AST\Qualifier::MUST) { |
@@ -237,7 +240,7 @@ discard block |
||
| 237 | 240 | * Get a predefined variable. |
| 238 | 241 | * |
| 239 | 242 | * @param string $name |
| 240 | - * @return V\Variable |
|
| 243 | + * @return V\Variable[] |
|
| 241 | 244 | */ |
| 242 | 245 | protected function get_variable($name) { |
| 243 | 246 | if (!array_key_exists($name, $this->variables)) { |
@@ -250,7 +253,7 @@ discard block |
||
| 250 | 253 | * Get a property. Yes. Really. |
| 251 | 254 | * |
| 252 | 255 | * @param string $name |
| 253 | - * @return V\Property |
|
| 256 | + * @return R\Property[] |
|
| 254 | 257 | */ |
| 255 | 258 | protected function get_property($name) { |
| 256 | 259 | if (!array_key_exists($name, $this->properties)) { |
@@ -263,7 +266,7 @@ discard block |
||
| 263 | 266 | * Get a schema. By name. |
| 264 | 267 | * |
| 265 | 268 | * @param string $name |
| 266 | - * @return V\Schema |
|
| 269 | + * @return R\Schema |
|
| 267 | 270 | */ |
| 268 | 271 | protected function get_schema($name) { |
| 269 | 272 | if (!array_key_exists($name, $this->schemas)) { |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | * Get information about a run. |
| 112 | 112 | * |
| 113 | 113 | * @param int $run |
| 114 | - * @return array<string,string> with keys 'commit_hash' |
|
| 114 | + * @return integer with keys 'commit_hash' |
|
| 115 | 115 | */ |
| 116 | 116 | public function run_info($run) { |
| 117 | 117 | $b = $this->result_db->builder(); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | /** |
| 98 | 98 | * Get all variables referenced by the rule. |
| 99 | 99 | * |
| 100 | - * @return Vars\Variable[] |
|
| 100 | + * @return Variable[] |
|
| 101 | 101 | */ |
| 102 | 102 | public function variables() { |
| 103 | 103 | $vars = array($this->subject()); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * Compile the rule to SQL. |
| 142 | 142 | * |
| 143 | 143 | * @param Index $index |
| 144 | - * @return Query[] |
|
| 144 | + * @return \Lechimp\Dicto\Graph\Query[] |
|
| 145 | 145 | */ |
| 146 | 146 | public function compile(Index $index) { |
| 147 | 147 | return $this->schema->compile($index, $this); |