internal: fix phpstan errors

This commit is contained in:
2023-10-05 16:10:30 +07:00
parent fd321739d8
commit 18359e6dec
7 changed files with 50 additions and 26 deletions

View File

@@ -14,6 +14,9 @@ class ClassDto
) {
}
/**
* @return array<string, string>
*/
public function getProperties(): array
{
return $this->properties;

View File

@@ -22,6 +22,9 @@ class LineDto
return $this->count;
}
/**
* @return array<string, string>
*/
public function getProperties(): array
{
return $this->properties;

View File

@@ -57,6 +57,10 @@ class Parser implements ElementsDictionary
return new LineDto($properties, (int) $count);
}
/**
* @param \SimpleXMLElement $xml
* @return array<array-key, \SimpleXMLElement>
*/
public function getAttributes(\SimpleXMLElement $xml): array
{
return ((array) $xml->attributes())['@attributes'] ?? [];

View File

@@ -14,7 +14,7 @@ class Renderer
{
/**
* @param Accumulator $accumulator
* @return array
* @return array{0: string, 1: Metrics}
* @throws \DOMException
*/
public function renderAccumulator(Accumulator $accumulator): array
@@ -71,7 +71,7 @@ class Renderer
$xmlProject->appendChild($this->renderMetricsProject($xmlDocument, $projectMetrics));
return [$xmlDocument->saveXML(), $projectMetrics];
return [(string) $xmlDocument->saveXML(), $projectMetrics];
}
/**

View File

@@ -56,6 +56,11 @@ final class CloverMergeCommand extends CliCommand
}
/**
* @param array<array-key, string> $files
* @param string $output
* @param string|null $workdir
* @param bool $stats
* @return int
* @throws ExecuteException
*/
public function execute(array $files, string $output, ?string $workdir, bool $stats): int