Skip to content

Commit

Permalink
CS: enable ordered_types.null_adjustment=always_last
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored and xabbuh committed Jan 16, 2024
1 parent b004c3c commit 67a5d2d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'modernize_strpos' => true,
'get_class_to_class_keyword' => true,
'nullable_type_declaration' => true,
'ordered_types' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'match', 'parameters']],
])
->setRiskyAllowed(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
protected ?string $key = null;
protected bool $removeKeyItem = false;
protected bool $addDefaults = false;
protected int|string|array|null|false $addDefaultChildren = false;
protected int|string|array|false|null $addDefaultChildren = false;
protected NodeBuilder $nodeBuilder;
protected bool $normalizeKeys = true;

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Input/InputArgument.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class InputArgument
public const IS_ARRAY = 4;

private int $mode;
private string|int|bool|array|null|float $default;
private string|int|bool|array|float|null $default;

/**
* @param string $name The argument name
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Input/InputOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class InputOption
private string $name;
private string|array|null $shortcut;
private int $mode;
private string|int|bool|array|null|float $default;
private string|int|bool|array|float|null $default;

/**
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Question/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Question
*/
public function __construct(
private string $question,
private null|string|bool|int|float $default = null,
private string|bool|int|float|null $default = null,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(
string|array $fileLinkFormat = null,
private ?RequestStack $requestStack = null,
private ?string $baseDir = null,
private null|string|\Closure $urlFormat = null,
private string|\Closure|null $urlFormat = null,
) {
$fileLinkFormat ??= $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? '';

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FormRegistry implements FormRegistryInterface
*/
private array $types = [];

private FormTypeGuesserInterface|null|false $guesser = false;
private FormTypeGuesserInterface|false|null $guesser = false;
private ResolvedFormTypeFactoryInterface $resolvedTypeFactory;
private array $checkedTypes = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ResponseCacheStrategy implements ResponseCacheStrategyInterface
private int $embeddedResponses = 0;
private bool $isNotCacheableResponseEmbedded = false;
private int $age = 0;
private \DateTimeInterface|null|false $lastModified = null;
private \DateTimeInterface|false|null $lastModified = null;
private array $flagDirectives = [
'no-cache' => null,
'no-store' => null,
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/Tests/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public static function provideInvalidInputValues()
/**
* @dataProvider provideInputValues
*/
public function testValidInput(?string $expected, null|float|string $value)
public function testValidInput(?string $expected, float|string|null $value)
{
$process = $this->getProcess('foo');
$process->setInput($value);
Expand Down

0 comments on commit 67a5d2d

Please sign in to comment.