Skip to content

Commit

Permalink
Merge pull request #223 from andrew-demb/styleci-fix
Browse files Browse the repository at this point in the history
Fix StyleCI checks
  • Loading branch information
BackEndTea committed Dec 2, 2020
2 parents bafc69c + ac13163 commit 088006b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 74 deletions.
2 changes: 2 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ enabled:

disabled:
- phpdoc_annotation_without_dot # This is still buggy: https://github.com/symfony/symfony/pull/19198
- short_array_syntax # Support PHP 5
- no_superfluous_phpdoc_tags_symfony # All params/return tags should be preserved
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 088006b

Please sign in to comment.