Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"require-dev": {
"roave/security-advisories": "dev-master",
"nextcloud/coding-standard": "^1.0.0",
"psalm/phar": "^5.4",
"psalm/phar": "^6.5",
"phpunit/phpunit": "^9.5",
"ext-mbstring": "*",
"nextcloud/ocp": "dev-master"
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

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

2 changes: 1 addition & 1 deletion lib/Listeners/RegisterTemplateCreatorListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle(Event $event): void {
$markdownFile = new TemplateFileCreator(Application::APP_NAME, $this->l10n->t('New text file'), '.' . $this->configService->getDefaultFileExtension());
$markdownFile->addMimetype('text/markdown');
$markdownFile->addMimetype('text/plain');
$markdownFile->setIconSvgInline(file_get_contents($this->appManager->getAppPath('text') . '/img/article.svg'));
$markdownFile->setIconSvgInline((string)file_get_contents($this->appManager->getAppPath('text') . '/img/article.svg'));
$markdownFile->setRatio(1);
$markdownFile->setOrder(10);
$markdownFile->setActionLabel($this->l10n->t('Create new text file'));
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/AttachmentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,12 @@ public static function getUniqueFileName(Folder $dir, string $fileName): string
if ($extension !== '') {
while ($dir->nodeExists($uniqueFileName)) {
$counter++;
$uniqueFileName = preg_replace('/\.' . $extension . '$/', ' (' . $counter . ').' . $extension, $fileName);
$uniqueFileName = (string)preg_replace('/\.' . $extension . '$/', ' (' . $counter . ').' . $extension, $fileName);
}
} else {
while ($dir->nodeExists($uniqueFileName)) {
$counter++;
$uniqueFileName = preg_replace('/$/', ' (' . $counter . ')', $fileName);
$uniqueFileName = (string)preg_replace('/$/', ' (' . $counter . ')', $fileName);
}
}
return $uniqueFileName;
Expand Down
3 changes: 2 additions & 1 deletion lib/YjsMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public static function fromBase64(string $data = ''): self {
* https://github.com/dmonad/lib0/blob/bd69ab4dc701d77e808f2bab08d96d63acd297da/decoding.js#L242
*/
public function readVarUint(): int {
$bytes = array_values(unpack('C*', $this->data));
$values = unpack('C*', $this->data);
$bytes = array_values($values !== false ? $values : []);
$num = 0;
$mult = 1;
$len = count($bytes);
Expand Down
11 changes: 5 additions & 6 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0"?>
<psalm
errorBaseline="tests/psalm-baseline.xml"
errorLevel="2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
findUnusedBaselineEntry="true"
findUnusedCode="false"
phpVersion="8.1"
xmlns="https://getpsalm.org/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="tests/psalm-baseline.xml"
phpVersion="8.1"
>
<stubs>
<file name="tests/stub.php" preloadClasses="true"/>
Expand All @@ -20,9 +22,6 @@
<directory name="vendor/nextcloud/ocp" />
</extraFiles>
<issueHandlers>
<DeprecatedMethod>
<errorLevel type="error" />
</DeprecatedMethod>
<UndefinedClass>
<errorLevel type="suppress">
<referencedClass name="OC" />
Expand Down
27 changes: 1 addition & 26 deletions tests/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="6.5.1@3f17a6b24a2dbe543e21408c2b19108cf6a355ef">
<file src="lib/Controller/WorkspaceController.php">
<UndefinedInterfaceMethod>
<code><![CDATA[open]]></code>
Expand All @@ -21,29 +21,4 @@
<code><![CDATA[mb_detect_order()]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="lib/Service/InitialStateProvider.php">
<DeprecatedClass>
<code><![CDATA[$this->translationManager->getLanguages()]]></code>
</DeprecatedClass>
<DeprecatedInterface>
<code><![CDATA[private]]></code>
</DeprecatedInterface>
</file>
<file src="vendor/nextcloud/ocp/OCP/AppFramework/Controller.php">
<MissingClosureParamType>
<code><![CDATA[$data]]></code>
</MissingClosureParamType>
<MissingClosureReturnType>
<code><![CDATA[function ($data) {]]></code>
</MissingClosureReturnType>
<PossiblyInvalidArgument>
<code><![CDATA[$data->getData()]]></code>
</PossiblyInvalidArgument>
</file>
<file src="vendor/nextcloud/ocp/OCP/AppFramework/OCSController.php">
<MissingClosureParamType>
<code><![CDATA[$data]]></code>
<code><![CDATA[$data]]></code>
</MissingClosureParamType>
</file>
</files>
Loading