From 075b1812f68cf54ee2d7f57a4d086282b4b13446 Mon Sep 17 00:00:00 2001 From: Sonata CI Date: Tue, 12 Jul 2022 20:14:20 +0100 Subject: [PATCH] DevKit updates for 4.x branch (#760) * DevKit updates * Fix cs Co-authored-by: Vincent Langlet --- .php-cs-fixer.dist.php | 2 +- src/FieldDescription/FilterTypeGuesser.php | 4 ++-- src/FieldDescription/TypeGuesser.php | 4 ++-- tests/Filter/ModelFilterTest.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 66c3c009..82830dad 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -52,7 +52,7 @@ 'no_useless_return' => true, 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true], 'ordered_class_elements' => true, - 'ordered_imports' => true, + 'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const']], 'php_unit_method_casing' => false, 'php_unit_set_up_tear_down_visibility' => true, 'php_unit_strict' => true, diff --git a/src/FieldDescription/FilterTypeGuesser.php b/src/FieldDescription/FilterTypeGuesser.php index cc6ee8d9..13fb90d8 100644 --- a/src/FieldDescription/FilterTypeGuesser.php +++ b/src/FieldDescription/FilterTypeGuesser.php @@ -63,7 +63,7 @@ public function guess(FieldDescriptionInterface $fieldDescription): TypeGuess switch ($fieldDescription->getMappingType()) { case Type::BOOL: - // TODO: Remove it when dropping support of doctrine/mongodb-odm < 3.0 + // TODO: Remove it when dropping support of doctrine/mongodb-odm < 3.0 case Type::BOOLEAN: return new TypeGuess(BooleanFilter::class, $options, Guess::HIGH_CONFIDENCE); case Type::TIMESTAMP: @@ -73,7 +73,7 @@ public function guess(FieldDescriptionInterface $fieldDescription): TypeGuess return new TypeGuess(DateFilter::class, $options, Guess::HIGH_CONFIDENCE); case Type::FLOAT: case Type::INT: - // TODO: Remove it when dropping support of doctrine/mongodb-odm < 3.0 + // TODO: Remove it when dropping support of doctrine/mongodb-odm < 3.0 case Type::INTEGER: return new TypeGuess(NumberFilter::class, $options, Guess::MEDIUM_CONFIDENCE); case Type::ID: diff --git a/src/FieldDescription/TypeGuesser.php b/src/FieldDescription/TypeGuesser.php index d5ef3213..b339c84c 100755 --- a/src/FieldDescription/TypeGuesser.php +++ b/src/FieldDescription/TypeGuesser.php @@ -48,7 +48,7 @@ public function guess(FieldDescriptionInterface $fieldDescription): TypeGuess case Type::HASH: return new TypeGuess(FieldDescriptionInterface::TYPE_ARRAY, [], Guess::HIGH_CONFIDENCE); case Type::BOOL: - // TODO: Remove it when dropping support of doctrine/mongodb-odm < 3.0 + // TODO: Remove it when dropping support of doctrine/mongodb-odm < 3.0 case Type::BOOLEAN: return new TypeGuess(FieldDescriptionInterface::TYPE_BOOLEAN, [], Guess::HIGH_CONFIDENCE); case Type::TIMESTAMP: @@ -58,7 +58,7 @@ public function guess(FieldDescriptionInterface $fieldDescription): TypeGuess return new TypeGuess(FieldDescriptionInterface::TYPE_DATE, [], Guess::HIGH_CONFIDENCE); case Type::FLOAT: return new TypeGuess(FieldDescriptionInterface::TYPE_FLOAT, [], Guess::MEDIUM_CONFIDENCE); - // TODO: Remove it when dropping support of doctrine/mongodb-odm < 3.0 + // TODO: Remove it when dropping support of doctrine/mongodb-odm < 3.0 case Type::INTEGER: case Type::INT: return new TypeGuess(FieldDescriptionInterface::TYPE_INTEGER, [], Guess::MEDIUM_CONFIDENCE); diff --git a/tests/Filter/ModelFilterTest.php b/tests/Filter/ModelFilterTest.php index 1f7650cc..f829beb0 100644 --- a/tests/Filter/ModelFilterTest.php +++ b/tests/Filter/ModelFilterTest.php @@ -35,7 +35,7 @@ public function __construct() public function getId(): string { - return (string) ($this->id); + return (string) $this->id; } }