Skip to content

Commit

Permalink
feat: apply rule ReturnTypeFromReturnDirectArrayRector from rector (#…
Browse files Browse the repository at this point in the history
…2292)

| Q | A |

|---------------|---------------------------------------------------------------------------------------------------------------------------|
| Bug fix? | no |
| New feature?  | no                                             |
| Deprecations? | no                                             |

This apply the rule
[ReturnTypeFromReturnDirectArrayRector](https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#returntypefromreturndirectarrayrector)
over src and tests.
  • Loading branch information
shakaran committed Jun 5, 2024
1 parent 9379c44 commit c20a32e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->ifTrue(function ($v) {
return 0 === count($v) || isset($v['path_patterns']) || isset($v['host_patterns']) || isset($v['documentation']);
})
->then(function ($v) {
->then(function ($v): array {
return ['default' => $v];
})
->end()
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ModelRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private function generateModelName(Model $model): string
*/
private function modelToArray(Model $model): array
{
$getType = function (Type $type) use (&$getType) {
$getType = function (Type $type) use (&$getType): array {
return [
'class' => $type->getClassName(),
'built_in_type' => $type->getBuiltinType(),
Expand Down
5 changes: 1 addition & 4 deletions tests/Functional/Entity/SymfonyConstraints80.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,7 @@ public function setPropertyLessThanOrEqual(int $propertyLessThanOrEqual): void
$this->propertyLessThanOrEqual = $propertyLessThanOrEqual;
}

/**
* @return array
*/
public static function fetchAllowedChoices()
public static function fetchAllowedChoices(): array
{
return ['choice1', 'choice2'];
}
Expand Down
5 changes: 1 addition & 4 deletions tests/Functional/Entity/SymfonyConstraints81.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,7 @@ public function setPropertyLessThanOrEqual(int $propertyLessThanOrEqual): void
$this->propertyLessThanOrEqual = $propertyLessThanOrEqual;
}

/**
* @return array
*/
public static function fetchAllowedChoices()
public static function fetchAllowedChoices(): array
{
return ['choice1', 'choice2'];
}
Expand Down

0 comments on commit c20a32e

Please sign in to comment.