Skip to content

Commit

Permalink
fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Feb 21, 2025
1 parent 4facbec commit 8991d95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/Generator/Client/LanguageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private function getOperations(array $operations, DefinitionsInterface $definiti
$bodyContentShape = null;
}

$arguments = array_merge($path, $body !== null ? [$bodyName => $body] : [], $query);
$arguments = array_merge($path, $bodyName !== null && $body !== null ? [$bodyName => $body] : [], $query);

$return = null;
if (in_array($operation->getReturn()->getCode(), [200, 201, 202])) {
Expand All @@ -202,7 +202,7 @@ private function getOperations(array $operations, DefinitionsInterface $definiti
$returnSchema instanceof ContentType ? $returnSchema->getShape() : null,
);

if ($returnSchema instanceof TypeInterface) {
if ($returnSchema instanceof PropertyTypeAbstract) {
$this->resolveImport($returnSchema, $imports);
}
}
Expand Down Expand Up @@ -310,6 +310,10 @@ private function buildImport(string $ref, array &$imports): void
}
}

/**
* @psalm-suppress InvalidReturnStatement
* @psalm-suppress InvalidReturnType
*/
private function groupOperations(OperationsInterface $operations): array
{
$result = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/Markup/RFC.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ class RFC implements GeneratorInterface
{
public function generate(SpecificationInterface $specification): Chunks|string
{
// TODO: Implement generate() method.
return '';
}
}
2 changes: 1 addition & 1 deletion src/Inspector/DevLifter.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ private function getPercentageChange(SpecificationInterface $left, ?Specificatio
$changes = abs($rightCount - $leftCount);
$percentage = ($changes * 100) / $rightCount;

return $percentage;
return (int) $percentage;
}
}

0 comments on commit 8991d95

Please sign in to comment.