Skip to content

Commit

Permalink
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_…
Browse files Browse the repository at this point in the history
…null_value
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
1 parent 5015895 commit d59441c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ExpressionFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getEvaluator()
* @throws \InvalidArgumentException if given PHP function name is in namespace
* and expression function name is not defined
*/
public static function fromPhp(string $phpFunctionName, string $expressionFunctionName = null)
public static function fromPhp(string $phpFunctionName, ?string $expressionFunctionName = null)
{
$phpFunctionName = ltrim($phpFunctionName, '\\');
if (!\function_exists($phpFunctionName)) {
Expand Down
2 changes: 1 addition & 1 deletion ExpressionLanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ExpressionLanguage
/**
* @param ExpressionFunctionProviderInterface[] $providers
*/
public function __construct(CacheItemPoolInterface $cache = null, array $providers = [])
public function __construct(?CacheItemPoolInterface $cache = null, array $providers = [])
{
$this->cache = $cache ?? new ArrayAdapter();
$this->registerFunctions();
Expand Down
2 changes: 1 addition & 1 deletion Node/ArrayNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct()
$this->index = -1;
}

public function addElement(Node $value, Node $key = null)
public function addElement(Node $value, ?Node $key = null)
{
if (null === $key) {
$key = new ConstantNode(++$this->index);
Expand Down
2 changes: 1 addition & 1 deletion SyntaxError.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class SyntaxError extends \LogicException
{
public function __construct(string $message, int $cursor = 0, string $expression = '', string $subject = null, array $proposals = null)
public function __construct(string $message, int $cursor = 0, string $expression = '', ?string $subject = null, ?array $proposals = null)
{
$message = sprintf('%s around position %d', rtrim($message, '.'), $cursor);
if ($expression) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function testNameProposal()
/**
* @dataProvider getLintData
*/
public function testLint($expression, $names, string $exception = null)
public function testLint($expression, $names, ?string $exception = null)
{
if ($exception) {
$this->expectException(SyntaxError::class);
Expand Down
2 changes: 1 addition & 1 deletion Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __toString()
*
* @return bool
*/
public function test(string $type, string $value = null)
public function test(string $type, ?string $value = null)
{
return $this->type === $type && (null === $value || $this->value == $value);
}
Expand Down
2 changes: 1 addition & 1 deletion TokenStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function next()
/**
* @param string|null $message The syntax error message
*/
public function expect(string $type, string $value = null, string $message = null)
public function expect(string $type, ?string $value = null, ?string $message = null)
{
$token = $this->current;
if (!$token->test($type, $value)) {
Expand Down

0 comments on commit d59441c

Please sign in to comment.