Skip to content

Commit

Permalink
bump psalm to v6.1.0, fix psalm issues
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
  • Loading branch information
julien-nc committed Feb 2, 2025
1 parent c09bc5e commit 862fe02
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
ocp-version: ['30', '31', 'dev-master']
ocp-version: ['30', 'dev-stable31', 'dev-master']
php-version: ['8.1', '8.2', '8.3', '8.4']


Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"require-dev": {
"nextcloud/coding-standard": "^1.1",
"psalm/phar": "^5.16",
"psalm/phar": "^6.1.0",
"nextcloud/ocp": "dev-master",
"phpunit/phpunit": "^9.5"
}
Expand Down
82 changes: 43 additions & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/Service/KmlConversionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ public function exportDirToKmz(string $userId, Directory $dir): string {
$zip->addFromString('doc.kml', $kmlDoc->saveXML());
$zip->close();
$zipContent = file_get_contents($tempFile);
if ($zipContent === false) {
throw new Exception('Impossible to read the zip file');
}

return $zipContent;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/Service/ToolsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ public function utcdate() {

public function remove_utf8_bom(string $text): string {
$bom = pack('H*', 'EFBBBF');
$text = preg_replace("/^$bom/", '', $text);
return $text;
$cleanText = preg_replace("/^$bom/", '', $text);
if ($cleanText === null) {
return $text;
}
return $cleanText;
}

public function encodeURIComponent(string $str): string {
Expand Down
4 changes: 2 additions & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
<referencedClass name="Doctrine\DBAL\Types\Type" />
</errorLevel>
</UndefinedDocblockClass>
<InvalidClass>
<!--InvalidClass>
<errorLevel type="suppress">
<referencedClass name="OCP\Db\Exception" />
<referencedClass name="OCP\AppFramework\Db\QBMapper" />
</errorLevel>
</InvalidClass>
</InvalidClass-->
</issueHandlers>
<stubs>
<file name="tests/stubs/oc_core_command_base.php" />
Expand Down

0 comments on commit 862fe02

Please # to comment.