Skip to content

Commit

Permalink
fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 9, 2024
1 parent 94ace2d commit 1286f54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 0 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
</PossiblyNullArgument>
</file>
<file src="src/Provider/Generator/Insomnia.php">
<ArgumentTypeCoercion>
<code><![CDATA[$setup]]></code>
</ArgumentTypeCoercion>
<PossiblyInvalidArgument>
<code><![CDATA[$url]]></code>
</PossiblyInvalidArgument>
Expand Down
8 changes: 3 additions & 5 deletions src/Provider/Generator/Insomnia.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private function parse(string $import): \stdClass
return $data;
}

private function buildOperation(\stdClass $resource, array $env, Setup $setup, string $index): void
private function buildOperation(\stdClass $resource, array $env, SetupInterface $setup, string $index): void
{
$name = $resource->name ?? null;
if (empty($name)) {
Expand Down Expand Up @@ -158,11 +158,9 @@ private function normalizePath(\stdClass $resource): string
return Inflection::convertPlaceholderToColon($path);
}

private function convertPlaceholderToColon(string $path)
private function convertPlaceholderToColon(string $path): string
{
$path = preg_replace('/(\{\{ (\w+) \}\})/i', ':$2', $path);

return $path;
return (string) preg_replace('/(\{\{ (\w+) \}\})/i', ':$2', $path);
}

private function getOperationMethodName(string $method): string
Expand Down

0 comments on commit 1286f54

Please sign in to comment.