Skip to content
Closed
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: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
ensureOverrideAttribute="false"
phpVersion="8.1">
<stubs>
<file name="tests/stubs/doctrine_dbal_schema_abstractasset.php" />
Expand Down Expand Up @@ -111,6 +112,7 @@
<file name="tests/stubs/symfony_component_console_question_question.php" />
<file name="tests/stubs/test_testcase.php" />
<file name="tests/stubs/test_traits_usertrait.php" />
<file name="tests/stubs/ocp_config_lexicon_ilexicon.php" />
<file name="tests/stubs/ocp_files_storage_iconstructablestorage.php" />
</stubs>
<projectFiles>
Expand Down
45 changes: 45 additions & 0 deletions tests/stubs/ocp_config_lexicon_ilexicon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCP\Config\Lexicon;

use OCP\AppFramework\Attribute\Implementable;

/**
* This interface needs to be implemented if you want to define a config lexicon for your application
* The config lexicon is used to avoid conflicts and problems when storing/retrieving config values
*/
#[Implementable(since: '32.0.0')]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be exposed in nextcloud/ocp already, why do we need to declare as stubs?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe nextcloud/ocp is not the latest version

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching this! To be able to update nextcloud/ocp with composer update, php version in composer.json needs to be bumped from 8.2 to 8.3:

// composer.json at root of app
"platform": {
    "php": "8.3"
},

I understand this is needed since php 8.2 support was dropped on master. Looking at psalm.xml there is phpVersion="8.1". I wonder if we should update the version there as well or keep it as 8.1?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @come-nc or @CarlSchwan can enlighten us on that topic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This application supports 32 according to https://github.com/nextcloud/globalsiteselector/blob/master/appinfo/info.xml#L24 so it needs to support PHP 8.1. (or to drop support for 32 on master branch)
You should require nextcloud/ocp:dev-stable32 instead of nextcloud/ocp:dev-master.

interface ILexicon {

/**
* Define the expected behavior when using config
* keys not set within your application config lexicon.
*
* @return Strictness
* @since 32.0.0
*@see Strictness
*/
public function getStrictness(): Strictness;

/**
* define the list of entries of your application config lexicon, related to AppConfig.
*
* @return Entry[]
* @since 32.0.0
*/
public function getAppConfigs(): array;

/**
* define the list of entries of your application config lexicon, related to UserPreferences.
*
* @return Entry[]
* @since 32.0.0
*/
public function getUserConfigs(): array;
}
4 changes: 2 additions & 2 deletions vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"config": {
"platform": {
"php": "8.0"
"php": "8.2.27"
},
"sort-packages": true
},
"require-dev": {
"vimeo/psalm": "^5.13"
"vimeo/psalm": "^6.16"
}
}
Loading
Loading