Skip to content

Commit ef1d816

Browse files
committed
Reduce coalescing operator call
1 parent 9791fc4 commit ef1d816

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Metadata/Resource/ResourceMetadataCollection.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ public function __construct(string $resourceClass, array $input = [])
3636

3737
public function getOperation(?string $operationName = null, bool $forceCollection = false, bool $httpOperation = false): Operation
3838
{
39-
if (isset($this->operationCache[$operationName ?? ''])) {
40-
return $this->operationCache[$operationName ?? ''];
39+
$operationName = $operationName ?? '';
40+
if (isset($this->operationCache[$operationName])) {
41+
return $this->operationCache[$operationName];
4142
}
4243

43-
if (isset($this->operationCache['graphql_'.($operationName ?? '')])) {
44-
return $this->operationCache['graphql_'.($operationName ?? '')];
44+
if (isset($this->operationCache['graphql_'.$operationName])) {
45+
return $this->operationCache['graphql_'.$operationName];
4546
}
4647

4748
$it = $this->getIterator();
4849
$metadata = null;
49-
$operationName = $operationName ?? '';
5050

5151
while ($it->valid()) {
5252
/** @var ApiResource */

0 commit comments

Comments
 (0)