Skip to content

Commit 66cf2ca

Browse files
wouterjnicolas-grekas
authored andcommitted
Add void return types
1 parent 83372f8 commit 66cf2ca

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

ExpressionLanguage.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public function lint(Expression|string $expression, ?array $names): void
113113
* @throws \LogicException when registering a function after calling evaluate(), compile() or parse()
114114
*
115115
* @see ExpressionFunction
116+
*
117+
* @return void
116118
*/
117119
public function register(string $name, callable $compiler, callable $evaluator)
118120
{
@@ -123,18 +125,27 @@ public function register(string $name, callable $compiler, callable $evaluator)
123125
$this->functions[$name] = ['compiler' => $compiler, 'evaluator' => $evaluator];
124126
}
125127

128+
/**
129+
* @return void
130+
*/
126131
public function addFunction(ExpressionFunction $function)
127132
{
128133
$this->register($function->getName(), $function->getCompiler(), $function->getEvaluator());
129134
}
130135

136+
/**
137+
* @return void
138+
*/
131139
public function registerProvider(ExpressionFunctionProviderInterface $provider)
132140
{
133141
foreach ($provider->getFunctions() as $function) {
134142
$this->addFunction($function);
135143
}
136144
}
137145

146+
/**
147+
* @return void
148+
*/
138149
protected function registerFunctions()
139150
{
140151
$this->addFunction(ExpressionFunction::fromPhp('constant'));

Node/FunctionNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(string $name, Node $arguments)
2828
);
2929
}
3030

31-
public function compile(Compiler $compiler)
31+
public function compile(Compiler $compiler): void
3232
{
3333
$arguments = [];
3434
foreach ($this->nodes['arguments']->nodes as $node) {

Node/Node.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public function __toString(): string
5757
return implode("\n", $repr);
5858
}
5959

60+
/**
61+
* @return void
62+
*/
6063
public function compile(Compiler $compiler)
6164
{
6265
foreach ($this->nodes as $node) {

Node/UnaryNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(string $operator, Node $node)
3535
);
3636
}
3737

38-
public function compile(Compiler $compiler)
38+
public function compile(Compiler $compiler): void
3939
{
4040
$compiler
4141
->raw('(')

Parser.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ protected function parseConditionalExpression(Node\Node $expr)
208208
return $expr;
209209
}
210210

211+
/**
212+
* @return Node\Node
213+
*/
211214
public function parsePrimaryExpression()
212215
{
213216
$token = $this->stream->current;

TokenStream.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public function __toString(): string
4141

4242
/**
4343
* Sets the pointer to the next token and returns the old one.
44+
*
45+
* @return void
4446
*/
4547
public function next()
4648
{
@@ -55,6 +57,8 @@ public function next()
5557

5658
/**
5759
* @param string|null $message The syntax error message
60+
*
61+
* @return void
5862
*/
5963
public function expect(string $type, string $value = null, string $message = null)
6064
{

0 commit comments

Comments
 (0)