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
52 changes: 52 additions & 0 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Lint php-cs

on: pull_request

permissions:
contents: read

concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

name: php-cs

steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Get php version
id: versions
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1

- name: Set up php${{ steps.versions.outputs.php-min }}
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
with:
php-version: ${{ steps.versions.outputs.php-min }}
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: |
composer remove nextcloud/ocp --dev --no-scripts
composer i

- name: Lint
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
25 changes: 25 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

require_once './vendor-bin/coding-standard/vendor/autoload.php';

use Nextcloud\CodingStandard\Config;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

$config = new Config();
$config
->setParallelConfig(ParallelConfigFactory::detect())
->getFinder()
->ignoreVCSIgnored(true)
->notPath('js')
->notPath('l10n')
->notPath('src')
->notPath('vendor')
->notPath('vendor-bin')
->in(__DIR__);
return $config;
15 changes: 8 additions & 7 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Create your routes in here. The name is the lowercase name of the controller
* without the controller part, the stuff after the hash is the method.
Expand All @@ -8,11 +9,11 @@
* it's instantiated in there
*/
return [
'routes' => [
[
'name' => 'extraction#extract',
'url' => 'ajax/extract.php',
'verb' => 'POST'
],
]
'routes' => [
[
'name' => 'extraction#extract',
'url' => 'ajax/extract.php',
'verb' => 'POST'
],
]
];
62 changes: 43 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
{
"name": "extract/extract",
"description": "Allows to extract archive from the web interface",
"type": "project",
"license": "AGPL",
"authors": [
{
"name": "Paul Lereverend"
}
],
"config": {
"optimize-autoloader": true,
"sort-packages": true,
"platform": {
"php": "8.1"
}
"name": "extract/extract",
"description": "Allows to extract archive from the web interface",
"type": "project",
"license": "AGPL",
"authors": [
{
"name": "Paul Lereverend"
}
],
"config": {
"optimize-autoloader": true,
"sort-packages": true,
"platform": {
"php": "8.1"
},
"require": {},
"require-dev": {
"nextcloud/ocp": "dev-stable29"
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"require": {
"bamarni/composer-bin-plugin": "^1.8"
},
"require-dev": {
"nextcloud/ocp": "dev-stable29"
},
"scripts": {
"bin": "echo 'bin not installed'",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"post-install-cmd": [
"@composer bin all install --ansi",
"composer dump-autoload"
],
"post-update-cmd": [
"composer dump-autoload"
]
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": true
}
}
}
}
74 changes: 66 additions & 8 deletions composer.lock

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

11 changes: 6 additions & 5 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Claus-Justus Heine
* @copyright 2022 Claus-Justus Heine <himself@claus-justus-heine.de>
Expand All @@ -22,15 +23,15 @@

use OCA\Extract\Listener\LoadExtractActions;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;

use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IRegistrationContext;

class Application extends App implements IBootstrap {
class Application extends App implements IBootstrap {

public const APP_ID = "extract";
public const APP_ID = 'extract';

public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
Expand Down
Loading