Skip to content

Commit

Permalink
Fix CS for phpdoc_types_null_last rule
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-demb committed Nov 1, 2020
1 parent bafc69c commit 9be9b71
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 74 deletions.
6 changes: 3 additions & 3 deletions bin/src/MixinGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private function interface(ReflectionClass $assert): string
*/
private function nullOr(ReflectionMethod $method, int $indent): ?string
{
return $this->assertion($method, 'nullOr%s', 'null|%s', $indent);
return $this->assertion($method, 'nullOr%s', '%s|null', $indent);
}

/**
Expand Down Expand Up @@ -157,7 +157,7 @@ private function assertion(ReflectionMethod $method, string $methodNameTemplate,
$parsedComment = $this->parseDocComment($comment);

$parameters = [];
/** @psalm-var array<string, null|scalar> $parametersDefaults */
/** @psalm-var array<string, scalar|null> $parametersDefaults */
$parametersDefaults = [];
$parametersReflection = $method->getParameters();

Expand Down Expand Up @@ -262,7 +262,7 @@ private function applyTypeTemplate(string $type, string $typeTemplate): string
{
$combinedType = sprintf($typeTemplate, $type);

if ('null|empty' === $combinedType) {
if ('empty|null' === $combinedType) {
$combinedType = 'empty'; // @see https://github.com/vimeo/psalm/issues/3492
}

Expand Down
Loading

0 comments on commit 9be9b71

Please sign in to comment.