Merge pull request #2568 from nextcloud/fix/php-8.1-types

add types for internal PHP classes
This commit is contained in:
René Gieling 2022-08-31 18:44:43 +02:00 коммит произвёл GitHub
Родитель 36f1f096a5 1710992600
Коммит 277d394825
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
11 изменённых файлов: 56 добавлений и 2 удалений

28
.github/workflows/static-analysis.yml поставляемый
Просмотреть файл

@ -8,11 +8,11 @@ on:
- stable*
jobs:
psalm:
psalm-22:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: [ 'dev-master', 'dev-stable22' ]
ocp-version: [ 'dev-stable22' ]
php-versions: ['7.4', '8.0']
name: Psalm
@ -31,3 +31,27 @@ jobs:
- name: Run coding standards check
run: composer run psalm
psalm-master:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: [ 'dev-master']
php-versions: ['7.4', '8.0', '8.1']
name: Psalm
steps:
- uses: actions/checkout@master
- name: Setup composer and PHP
uses: ./.github/actions/setup-composer
with:
php-version: ${{ matrix.php-versions }}
php-tools: composer, psalm
- name: Install Nextcloud API
run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }}
- name: Run coding standards check
run: composer run psalm

Просмотреть файл

@ -76,6 +76,9 @@ class Comment extends Entity implements JsonSerializable {
$this->shareMapper = Container::queryClass(ShareMapper::class);
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -81,6 +81,9 @@ class Log extends Entity implements JsonSerializable {
$this->addType('processed', 'int');
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -124,6 +124,9 @@ class Option extends Entity implements JsonSerializable {
$this->shareMapper = Container::queryClass(ShareMapper::class);
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -190,6 +190,9 @@ class Poll extends Entity implements JsonSerializable {
$this->optionMapper = Container::queryClass(OptionMapper::class);
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -74,6 +74,9 @@ class Preferences extends Entity implements JsonSerializable {
return 0;
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -132,6 +132,9 @@ class Share extends Entity implements JsonSerializable {
$this->appSettings = new AppSettings;
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -51,6 +51,9 @@ class Subscription extends Entity implements JsonSerializable {
$this->addType('pollId', 'int');
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -76,6 +76,9 @@ class Vote extends Entity implements JsonSerializable {
$this->shareMapper = Container::queryClass(ShareMapper::class);
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -59,6 +59,9 @@ class Watch extends Entity implements JsonSerializable {
$this->addType('updated', 'int');
}
/**
* @return mixed
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),

Просмотреть файл

@ -168,6 +168,9 @@ class AppSettings implements JsonSerializable {
$this->config->setAppValue(self::APP_NAME, $key, $value);
}
/**
* @return mixed
*/
public function jsonSerialize() {
// convert group ids to group objects
$publicSharesGroups = [];