Skip to content

Commit 0d4acb3

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! Don't require parentheses for short-ternaries (#7604)
1 parent 3687721 commit 0d4acb3

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

rules/TypeDeclarationDocblocks/Rector/Class_/AddReturnArrayDocblockFromDataProviderParamRector.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,23 @@ public function refactor(Node $node): ?Node
116116
continue;
117117
}
118118

119+
// no params - no data provider
120+
if ($classMethod->getParams() === []) {
121+
continue;
122+
}
123+
119124
$dataProviderNodes = $this->dataProviderMethodsFinder->findDataProviderNodes($node, $classMethod);
120-
dump($dataProviderNodes);
125+
126+
$paramTypesByPosition = [];
127+
foreach ($classMethod->getParams() as $position => $param) {
128+
if (! $param->type instanceof \PhpParser\Node) {
129+
continue;
130+
}
131+
132+
$paramTypesByPosition[$position] = $param->type;
133+
}
134+
135+
dump($paramTypesByPosition);
121136
die;
122137
}
123138

@@ -127,13 +142,4 @@ public function refactor(Node $node): ?Node
127142

128143
return $node;
129144
}
130-
131-
private function isArrayParam(Param $param): bool
132-
{
133-
if (! $param->type instanceof Identifier) {
134-
return false;
135-
}
136-
137-
return $this->isName($param->type, 'array');
138-
}
139145
}

0 commit comments

Comments
 (0)