Skip to content

Commit

Permalink
Merge pull request #3431 from nextcloud/stable-6-for-26
Browse files Browse the repository at this point in the history
[stable6] Backport of stable 6 for Nextcloud 26
  • Loading branch information
come-nc authored Apr 30, 2024
2 parents dca7583 + c68cfd8 commit bce814e
Show file tree
Hide file tree
Showing 52 changed files with 528 additions and 569 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
php-versions: ['8.0']
server-versions: ['master']
server-versions: ['stable26']

name: SQLite

Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
fail-fast: false
matrix:
php-versions: ['8.1']
server-versions: ['master']
server-versions: ['stable26']

name: MySQL

Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
fail-fast: false
matrix:
php-versions: ['8.2']
server-versions: ['master']
server-versions: ['stable26']

name: PostgreSQL

Expand Down
74 changes: 37 additions & 37 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Static analysis

on:
pull_request:
push:
branches:
- master
- next
- stable*

jobs:
psalm-master:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: ['master']
php-versions: ['8.0', '8.1', '8.2']

name: Psalm

steps:
- uses: actions/checkout@v3

- 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 nextcloud/ocp:dev-${{ matrix.ocp-version }}

- name: Install symfony/console
run: composer require symfony/console

- name: Run coding standards check
run: composer run psalm
name: Static analysis

on:
pull_request:
push:
branches:
- master
- next
- stable*

jobs:
psalm-master:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: ['stable26']
php-versions: ['8.0', '8.1', '8.2']

name: Psalm

steps:
- uses: actions/checkout@v3

- 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 nextcloud/ocp:dev-${{ matrix.ocp-version }}

- name: Install symfony/console
run: composer require symfony/console

- name: Run coding standards check
run: composer run psalm
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/polls/master/screenshots/edit-poll.png</screenshot>
<dependencies>
<php min-version="8.0"/>
<nextcloud min-version="28" max-version="28"/>
<nextcloud min-version="26" max-version="28"/>
</dependencies>
<activity>
<providers>
Expand Down Expand Up @@ -79,4 +79,4 @@
<order>77</order>
</navigation>
</navigations>
</info>
</info>
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"autoloader-suffix": "Polls",
"platform": {
"php": "8.0"
}
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"autoload": {
"psr-4": {
Expand All @@ -32,11 +35,11 @@
}
},
"require-dev": {
"doctrine/dbal": "^3.6",
"league/factory-muffin": "^3.0",
"league/factory-muffin-faker": "^2.0",
"nextcloud/coding-standard": "^1.0",
"nextcloud/ocp": "dev-stable27",
"doctrine/dbal": "^3.6"
"nextcloud/ocp": "dev-stable26"
},
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --diff",
Expand Down
88 changes: 17 additions & 71 deletions composer.lock

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

5 changes: 3 additions & 2 deletions lib/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use OCA\Polls\AppConstants;
use OCA\Polls\Db\UserMapper;
use OCA\Polls\Service\PollService;
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent;
Expand All @@ -52,7 +51,9 @@ public function __construct(
parent::__construct($appName, $request);
}

#[NoCSRFRequired]
/**
* @NoCSRFRequired
*/
public function index(): TemplateResponse {
Util::addScript(AppConstants::APP_ID, 'polls-main');
$this->eventDispatcher->dispatchTyped(new LoadAdditionalScriptsEvent());
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/BaseApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function __construct(

/**
* response
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function response(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand All @@ -62,8 +62,8 @@ protected function response(Closure $callback): JSONResponse {

/**
* response
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseLong(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand All @@ -74,8 +74,8 @@ protected function responseLong(Closure $callback): JSONResponse {

/**
* responseCreate
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseCreate(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_CREATED);
Expand Down
8 changes: 4 additions & 4 deletions lib/Controller/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public function __construct(

/**
* response
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function response(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand All @@ -60,8 +60,8 @@ protected function response(Closure $callback): JSONResponse {

/**
* response
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseLong(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand All @@ -72,8 +72,8 @@ protected function responseLong(Closure $callback): JSONResponse {

/**
* responseCreate
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseCreate(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_CREATED);
Expand All @@ -84,8 +84,8 @@ protected function responseCreate(Closure $callback): JSONResponse {

/**
* responseDeleteTolerant
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseDeleteTolerant(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand Down
Loading

0 comments on commit bce814e

Please sign in to comment.