-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
rectorphp/rector-src
#7459Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/40e04a2c-1611-4a0b-894a-659f31cd612a
<?php
final class DemoFile
{
public function __construct(
public readonly string $collectionName,
public readonly ?string $partitionName = null,
public readonly ?int $replicaNumber = null,
public readonly ?int $timeout = null,
) {}
public function toRequestPayload(): array
{
$params = [
'partition_name' => $this->partitionName,
'replica_number' => $this->replicaNumber,
'timeout' => $this->timeout,
];
$params = array_filter($params);
return [
'collection_name' => $this->collectionName,
'params' => $params,
];
}
}Responsible rules
DocblockReturnArrayFromDirectArrayInstanceRector
Expected Behavior
This Rector adds the type array<string, string|array<string, int|int|string>> int|int|string part should be int|string Maybe it needs some normalization step.
Reactions are currently unavailable