Skip to content

Commit

Permalink
Add support for scalar type
Browse files Browse the repository at this point in the history
  • Loading branch information
othercorey committed Oct 22, 2021
1 parent e098e1f commit 34e8e42
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CakePHP/Sniffs/Commenting/TypeHintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ protected function getSortedTypeHint(array $types): string
'callable-string',
'class-string',
'interface-string',
'scalar',
'string',
'float',
'int',
Expand Down
2 changes: 1 addition & 1 deletion CakePHP/Tests/Commenting/TypeHintUnitTest.1.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ function test()
/** @var class-string<\Cake\I18n\Number>|null */
$testVar;

/** @psalm-var null|string|class-string<\Cake\I18n\Number>|array $testVar2 */
/** @psalm-var null|scalar|class-string<\Cake\I18n\Number>|array $testVar2 */
$testVar2;
}
2 changes: 1 addition & 1 deletion CakePHP/Tests/Commenting/TypeHintUnitTest.1.inc.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ function test()
/** @var class-string<\Cake\I18n\Number>|null */
$testVar;

/** @psalm-var array|class-string<\Cake\I18n\Number>|string|null $testVar2 */
/** @psalm-var array|class-string<\Cake\I18n\Number>|scalar|null $testVar2 */
$testVar2;
}

0 comments on commit 34e8e42

Please sign in to comment.