Skip to content

Commit

Permalink
fix: Fix psalm errors
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Jan 24, 2025
1 parent 36e793d commit ea27e18
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/BackgroundJobs/ClusterFacesJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public function __construct(ITimeFactory $time, Logger $logger, IJobList $jobLis
* @return void
*/
protected function run($argument) {
/** @var string $userId */
$userId = (string) $argument['userId'];
try {
$this->clusterAnalyzer->calculateClusters($userId, self::BATCH_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/FaceDetection.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct() {
$this->addType('height', 'float');
$this->addType('width', 'float');
$this->addType('vector', 'json');
$this->addType('clusterId', 'int');
$this->addType('clusterId', 'integer');
$this->addType('threshold', 'float');
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Service/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public function debug($message, array $context = array()): void {
*/
public function log($level, $message, array $context = array()): void {
if (isset($this->cliOutput)) {
$this->cliOutput->writeln($message);
$this->cliOutput->writeln((string)$message);
}
$this->logger->log($level, $message, $context);
$this->logger->log($level, (string)$message, $context);
}
}
24 changes: 23 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.25.0@01a8eb06b9e9cc6cfb6a320bf9fb14331919d505">
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<file src="lib/AppInfo/Application.php">
<DeprecatedInterface>
<code><![CDATA[$this->getContainer()]]></code>
Expand Down Expand Up @@ -84,6 +84,9 @@
<MixedArrayAccess>
<code><![CDATA[$argument['userId']]]></code>
</MixedArrayAccess>
<UnnecessaryVarAnnotation>
<code><![CDATA[string]]></code>
</UnnecessaryVarAnnotation>
</file>
<file src="lib/BackgroundJobs/SchedulerJob.php">
<MissingParamType>
Expand Down Expand Up @@ -767,6 +770,9 @@
</MoreSpecificReturnType>
</file>
<file src="lib/Db/FaceDetection.php">
<InvalidArgument>
<code><![CDATA['int']]></code>
</InvalidArgument>
<MissingPropertyType>
<code><![CDATA[$clusterId]]></code>
<code><![CDATA[$fileId]]></code>
Expand Down Expand Up @@ -1050,6 +1056,22 @@
<code><![CDATA[$directories !== null]]></code>
</RedundantConditionGivenDocblockType>
</file>
<file src="lib/Service/Logger.php">
<MissingParamType>
<code><![CDATA[$message]]></code>
<code><![CDATA[$message]]></code>
<code><![CDATA[$message]]></code>
<code><![CDATA[$message]]></code>
<code><![CDATA[$message]]></code>
<code><![CDATA[$message]]></code>
<code><![CDATA[$message]]></code>
<code><![CDATA[$message]]></code>
<code><![CDATA[$message]]></code>
</MissingParamType>
<MixedArgument>
<code><![CDATA[$message]]></code>
</MixedArgument>
</file>
<file src="lib/Service/StorageService.php">
<MixedAssignment>
<code><![CDATA[$files]]></code>
Expand Down

0 comments on commit ea27e18

Please sign in to comment.