Skip to content

Commit

Permalink
DevKit updates for 2.x branch (#552)
Browse files Browse the repository at this point in the history
* DevKit updates

* Fix cs

Co-authored-by: Vincent Langlet <vincentlanglet@hotmail.fr>
  • Loading branch information
SonataCI and VincentLanglet committed Sep 3, 2022
1 parent 93ab09c commit 4da42da
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .php-cs-fixer.dist.php
Expand Up @@ -45,6 +45,11 @@
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
'ordered_class_elements' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const']],
'phpdoc_order' => ['order' => ['var', 'param', 'throws', 'return', 'phpstan-var', 'psalm-var', 'phpstan-param', 'psalm-param', 'phpstan-return', 'psalm-return']],
'phpdoc_separation' => ['groups' => [
['phpstan-template', 'phpstan-extends', 'phpstan-implements', 'phpstan-var', 'psalm-var', 'phpstan-param', 'psalm-param', 'phpstan-return', 'psalm-return'],
['psalm-suppress', 'phpstan-ignore-next-line'],
]],
'php_unit_strict' => true,
'php_unit_test_case_static_method_calls' => true,
'phpdoc_to_comment' => ['ignored_tags' => ['psalm-suppress', 'phpstan-var']],
Expand Down
12 changes: 6 additions & 6 deletions src/Helper/NumberFormatter.php
Expand Up @@ -118,10 +118,10 @@ public function format($number, int $style, array $attributes = [], array $textA
* @param mixed $symbols The symbols used by the formatter
* @param mixed $locale The locale
*
* @return array{string|null, array<string, string>} Arguments list normalized to the new method signature
*
* @throws \BadMethodCallException If the arguments does not match any signature
*
* @return array{string|null, array<string, string>} Arguments list normalized to the new method signature
*
* @internal
*/
public function normalizeMethodSignature($symbols, $locale)
Expand Down Expand Up @@ -185,10 +185,10 @@ protected function getFormatter(string $culture, int $style, array $attributes =
*
* @param array<string, mixed> $attributes The list of attributes
*
* @return array<int, mixed> List of \NumberFormatter constants
*
* @throws \InvalidArgumentException If any attribute does not match any constant
*
* @return array<int, mixed> List of \NumberFormatter constants
*
* @phpstan-template T of mixed
* @phpstan-param array<string, T> $attributes
* @phpstan-return array<int, T>
Expand All @@ -209,9 +209,9 @@ protected function parseAttributes(array $attributes)
*
* @param string $attribute The constant's name
*
* @return mixed The \NumberFormatter constant
*
* @throws \InvalidArgumentException If the value does not match any constant
*
* @return mixed The \NumberFormatter constant
*/
protected function parseConstantValue(string $attribute)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Templating/Helper/NumberHelper.php
Expand Up @@ -238,10 +238,10 @@ public function format($number, $style, array $attributes = [], array $textAttri
* @param mixed $symbols The symbols used by the formatter
* @param mixed $locale The locale
*
* @return array{string|null, array<string, string>} Arguments list normalized to the new method signature
*
* @throws \BadMethodCallException If the arguments does not match any signature
*
* @return array{string|null, array<string, string>} Arguments list normalized to the new method signature
*
* @internal
*/
public function normalizeMethodSignature($symbols, $locale)
Expand Down Expand Up @@ -315,10 +315,10 @@ protected function getFormatter($culture, $style, $attributes = [], $textAttribu
*
* @param array<string, mixed> $attributes The list of attributes
*
* @return array<int, mixed> List of \NumberFormatter constants
*
* @throws \InvalidArgumentException If any attribute does not match any constant
*
* @return array<int, mixed> List of \NumberFormatter constants
*
* @phpstan-template T of mixed
* @phpstan-param array<string, T> $attributes
* @phpstan-return array<int, T>
Expand All @@ -339,9 +339,9 @@ protected function parseAttributes(array $attributes)
*
* @param string $attribute The constant's name
*
* @return int The \NumberFormatter constant
*
* @throws \InvalidArgumentException If the value does not match any constant
*
* @return int The \NumberFormatter constant
*/
protected function parseConstantValue($attribute)
{
Expand Down

0 comments on commit 4da42da

Please sign in to comment.