diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-09-09 13:37:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 13:37:54 +0300 |
commit | 06e55c5060f2a827d5878efd865081c887a1a9ae (patch) | |
tree | f25421f609f037f0dc82bc1da7bb7099ccc0095d | |
parent | e85d671575fbc1386fd7810bfccdb96565e68391 (diff) | |
parent | ce34de48a6753d19ed7ed2eb3782efa25117cc77 (diff) |
Merge pull request #591 from nextcloud/td/noid/maintenancev1.15.0
maintenance and tech debt
-rw-r--r-- | .github/workflows/appstore-build-publish.yml | 10 | ||||
-rw-r--r-- | .github/workflows/lint-eslint.yml | 3 | ||||
-rw-r--r-- | .github/workflows/lint-info-xml.yml | 3 | ||||
-rw-r--r-- | .github/workflows/lint-php-cs.yml | 6 | ||||
-rw-r--r-- | .github/workflows/lint-php.yml | 8 | ||||
-rw-r--r-- | .github/workflows/lint-stylelint.yml | 3 | ||||
-rw-r--r-- | .github/workflows/node.yml | 4 | ||||
-rw-r--r-- | .github/workflows/phpunit-mysql.yml | 14 | ||||
-rw-r--r-- | .github/workflows/phpunit-oci.yml | 13 | ||||
-rw-r--r-- | .github/workflows/phpunit-pgsql.yml | 13 | ||||
-rw-r--r-- | .github/workflows/phpunit-sqlite.yml | 13 | ||||
-rw-r--r-- | composer.lock | 291 | ||||
-rw-r--r-- | lib/AppInfo/Application.php | 4 | ||||
-rw-r--r-- | lib/Listener/CacheListener.php | 2 | ||||
-rw-r--r-- | lib/Listener/RegisterFlowOperationsListener.php | 10 | ||||
-rw-r--r-- | lib/Operation.php | 105 | ||||
-rw-r--r-- | lib/Settings/Admin.php | 43 | ||||
-rw-r--r-- | tests/OperationTest.php | 1 |
18 files changed, 230 insertions, 316 deletions
diff --git a/.github/workflows/appstore-build-publish.yml b/.github/workflows/appstore-build-publish.yml index ba84138..fc04383 100644 --- a/.github/workflows/appstore-build-publish.yml +++ b/.github/workflows/appstore-build-publish.yml @@ -27,9 +27,10 @@ jobs: - name: Set app env run: | - # Split and keep last + # Split and keep last echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Checkout uses: actions/checkout@v3 with: @@ -81,6 +82,7 @@ jobs: run: | cd ${{ env.APP_NAME }} composer install --no-dev + - name: Build ${{ env.APP_NAME }} # Skip if no package.json if: ${{ steps.versions.outputs.nodeVersion }} @@ -88,6 +90,7 @@ jobs: cd ${{ env.APP_NAME }} npm ci npm run build + - name: Check Krankerl config id: krankerl uses: andstor/file-existence-action@v1 @@ -99,16 +102,19 @@ jobs: run: | wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.0/krankerl_0.13.0_amd64.deb sudo dpkg -i krankerl_0.13.0_amd64.deb + - name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl if: steps.krankerl.outputs.files_exists == 'true' run: | cd ${{ env.APP_NAME }} krankerl package + - name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile if: steps.krankerl.outputs.files_exists != 'true' run: | cd ${{ env.APP_NAME }} make appstore + - name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }} continue-on-error: true id: server-checkout @@ -116,6 +122,7 @@ jobs: NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }} wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip unzip latest-$NCVERSION.zip + - name: Checkout server master fallback uses: actions/checkout@v3 if: ${{ steps.server-checkout.outcome != 'success' }} @@ -137,6 +144,7 @@ jobs: # Rebuilding archive cd ${{ env.APP_NAME }}/build/artifacts tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }} + - name: Attach tarball to github release uses: svenstaro/upload-release-action@v2 id: attach_to_release diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index 5f48fb5..3f783f4 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -13,6 +13,9 @@ on: - master - stable* +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest diff --git a/.github/workflows/lint-info-xml.yml b/.github/workflows/lint-info-xml.yml index d877ee5..fefdc7e 100644 --- a/.github/workflows/lint-info-xml.yml +++ b/.github/workflows/lint-info-xml.yml @@ -13,6 +13,9 @@ on: - master - stable* +permissions: + contents: read + jobs: xml-linters: runs-on: ubuntu-latest diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml index 9aad514..eb236b7 100644 --- a/.github/workflows/lint-php-cs.yml +++ b/.github/workflows/lint-php-cs.yml @@ -9,9 +9,13 @@ on: pull_request: push: branches: + - main - master - stable* +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest @@ -20,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up php ${{ matrix.php-versions }} uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml index 9cfb484..d089d1b 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -9,9 +9,13 @@ on: pull_request: push: branches: + - main - master - stable* +permissions: + contents: read + jobs: php-lint: runs-on: ubuntu-latest @@ -23,7 +27,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up php ${{ matrix.php-versions }} uses: shivammathur/setup-php@v2 @@ -35,6 +39,8 @@ jobs: run: composer run lint summary: + permissions: + contents: none runs-on: ubuntu-latest needs: php-lint diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml index 407f870..a5f9b13 100644 --- a/.github/workflows/lint-stylelint.yml +++ b/.github/workflows/lint-stylelint.yml @@ -13,6 +13,9 @@ on: - master - stable* +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 9150d1f..443ed95 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -47,10 +47,12 @@ jobs: - name: Check webpack build changes run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1" + bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)" - name: Show changes on failure if: failure() run: | git status git --no-pager diff + exit 1 # make it red to grab attention + diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml index ca74c90..db0460e 100644 --- a/.github/workflows/phpunit-mysql.yml +++ b/.github/workflows/phpunit-mysql.yml @@ -1,12 +1,21 @@ +# 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 + name: PHPUnit on: pull_request: push: branches: + - main - master - stable* +permissions: + contents: read + env: # Location of the phpunit.xml and phpunit.integration.xml files PHPUNIT_CONFIG: ./tests/phpunit.xml @@ -35,10 +44,12 @@ jobs: run: | # Split and keep last echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV + - name: Enable ONLY_FULL_GROUP_BY MySQL option run: | echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword + - name: Checkout server uses: actions/checkout@v3 with: @@ -70,6 +81,7 @@ jobs: mkdir data ./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password ./occ app:enable ${{ env.APP_NAME }} + - name: Check PHPUnit config file existence id: check_phpunit uses: andstor/file-existence-action@v1 @@ -100,6 +112,8 @@ jobs: run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }} summary: + permissions: + contents: none runs-on: ubuntu-latest needs: phpunit-mysql diff --git a/.github/workflows/phpunit-oci.yml b/.github/workflows/phpunit-oci.yml index 29b9cb2..1ff3388 100644 --- a/.github/workflows/phpunit-oci.yml +++ b/.github/workflows/phpunit-oci.yml @@ -1,12 +1,21 @@ +# 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 + name: PHPUnit on: pull_request: push: branches: + - main - master - stable* +permissions: + contents: read + env: # Location of the phpunit.xml and phpunit.integration.xml files PHPUNIT_CONFIG: ./tests/phpunit.xml @@ -32,6 +41,7 @@ jobs: run: | # Split and keep last echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV + - name: Checkout server uses: actions/checkout@v3 with: @@ -63,6 +73,7 @@ jobs: mkdir data ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin ./occ app:enable ${{ env.APP_NAME }} + - name: Check PHPUnit config file existence id: check_phpunit uses: andstor/file-existence-action@v1 @@ -93,6 +104,8 @@ jobs: run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }} summary: + permissions: + contents: none runs-on: ubuntu-latest needs: phpunit-oci diff --git a/.github/workflows/phpunit-pgsql.yml b/.github/workflows/phpunit-pgsql.yml index 6d3d539..1596c11 100644 --- a/.github/workflows/phpunit-pgsql.yml +++ b/.github/workflows/phpunit-pgsql.yml @@ -1,12 +1,21 @@ +# 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 + name: PHPUnit on: pull_request: push: branches: + - main - master - stable* +permissions: + contents: read + env: # Location of the phpunit.xml and phpunit.integration.xml files PHPUNIT_CONFIG: ./tests/phpunit.xml @@ -37,6 +46,7 @@ jobs: run: | # Split and keep last echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV + - name: Checkout server uses: actions/checkout@v3 with: @@ -68,6 +78,7 @@ jobs: mkdir data ./occ maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password ./occ app:enable ${{ env.APP_NAME }} + - name: Check PHPUnit config file existence id: check_phpunit uses: andstor/file-existence-action@v1 @@ -98,6 +109,8 @@ jobs: run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }} summary: + permissions: + contents: none runs-on: ubuntu-latest needs: phpunit-pgsql diff --git a/.github/workflows/phpunit-sqlite.yml b/.github/workflows/phpunit-sqlite.yml index 0d4897d..700b361 100644 --- a/.github/workflows/phpunit-sqlite.yml +++ b/.github/workflows/phpunit-sqlite.yml @@ -1,12 +1,21 @@ +# 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 + name: PHPUnit on: pull_request: push: branches: + - main - master - stable* +permissions: + contents: read + env: # Location of the phpunit.xml and phpunit.integration.xml files PHPUNIT_CONFIG: ./tests/phpunit.xml @@ -26,6 +35,7 @@ jobs: run: | # Split and keep last echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV + - name: Checkout server uses: actions/checkout@v3 with: @@ -57,6 +67,7 @@ jobs: mkdir data ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password ./occ app:enable ${{ env.APP_NAME }} + - name: Check PHPUnit config file existence id: check_phpunit uses: andstor/file-existence-action@v1 @@ -87,6 +98,8 @@ jobs: run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }} summary: + permissions: + contents: none runs-on: ubuntu-latest needs: phpunit-sqlite diff --git a/composer.lock b/composer.lock index c6c644d..dacd329 100644 --- a/composer.lock +++ b/composer.lock @@ -13,12 +13,12 @@ "source": { "type": "git", "url": "https://github.com/ChristophWurst/nextcloud_composer.git", - "reference": "a6ffee74b70a14bf4775e058db1b02a4e62375fa" + "reference": "4a236aa55a10f27b0b81db475ed86ea647fa51d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ChristophWurst/nextcloud_composer/zipball/a6ffee74b70a14bf4775e058db1b02a4e62375fa", - "reference": "a6ffee74b70a14bf4775e058db1b02a4e62375fa", + "url": "https://api.github.com/repos/ChristophWurst/nextcloud_composer/zipball/4a236aa55a10f27b0b81db475ed86ea647fa51d4", + "reference": "4a236aa55a10f27b0b81db475ed86ea647fa51d4", "shasum": "" }, "require": { @@ -49,7 +49,7 @@ "issues": "https://github.com/ChristophWurst/nextcloud_composer/issues", "source": "https://github.com/ChristophWurst/nextcloud_composer/tree/master" }, - "time": "2022-09-03T02:36:52+00:00" + "time": "2022-09-07T02:41:02+00:00" }, { "name": "composer/pcre", @@ -271,16 +271,16 @@ }, { "name": "doctrine/annotations", - "version": "1.13.2", + "version": "1.13.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + "reference": "648b0343343565c4a056bfc8392201385e8d89f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", + "reference": "648b0343343565c4a056bfc8392201385e8d89f0", "shasum": "" }, "require": { @@ -292,9 +292,10 @@ "require-dev": { "doctrine/cache": "^1.11 || ^2.0", "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", + "phpstan/phpstan": "^1.4.10 || ^1.8.0", "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" + "symfony/cache": "^4.4 || ^5.2", + "vimeo/psalm": "^4.10" }, "type": "library", "autoload": { @@ -337,9 +338,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" + "source": "https://github.com/doctrine/annotations/tree/1.13.3" }, - "time": "2021-08-05T19:00:23+00:00" + "time": "2022-07-02T10:48:51+00:00" }, { "name": "doctrine/instantiator", @@ -489,16 +490,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.8.0", + "version": "v3.11.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" + "reference": "7dcdea3f2f5f473464e835be9be55283ff8cfdc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", - "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/7dcdea3f2f5f473464e835be9be55283ff8cfdc3", + "reference": "7dcdea3f2f5f473464e835be9be55283ff8cfdc3", "shasum": "" }, "require": { @@ -508,7 +509,7 @@ "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", - "php-cs-fixer/diff": "^2.0", + "sebastian/diff": "^4.0", "symfony/console": "^5.4 || ^6.0", "symfony/event-dispatcher": "^5.4 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0", @@ -566,7 +567,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.11.0" }, "funding": [ { @@ -574,7 +575,7 @@ "type": "github" } ], - "time": "2022-03-18T17:20:59+00:00" + "time": "2022-09-01T18:24:51+00:00" }, { "name": "myclabs/deep-copy", @@ -678,16 +679,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", "shasum": "" }, "require": { @@ -728,9 +729,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2022-09-04T07:30:47+00:00" }, { "name": "phar-io/manifest", @@ -844,58 +845,6 @@ "time": "2022-02-21T01:04:05+00:00" }, { - "name": "php-cs-fixer/diff", - "version": "v2.0.2", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "sebastian/diff v3 backport support for PHP 5.6+", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" - }, - "time": "2020-10-14T08:32:19+00:00" - }, - { "name": "phpunit/php-code-coverage", "version": "9.2.17", "source": { @@ -2474,16 +2423,16 @@ }, { "name": "symfony/console", - "version": "v5.4.7", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6" + "reference": "c072aa8f724c3af64e2c7a96b796a4863d24dba1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/900275254f0a1a2afff1ab0e11abd5587a10e1d6", - "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6", + "url": "https://api.github.com/repos/symfony/console/zipball/c072aa8f724c3af64e2c7a96b796a4863d24dba1", + "reference": "c072aa8f724c3af64e2c7a96b796a4863d24dba1", "shasum": "" }, "require": { @@ -2553,7 +2502,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.7" + "source": "https://github.com/symfony/console/tree/v5.4.12" }, "funding": [ { @@ -2569,11 +2518,11 @@ "type": "tidelift" } ], - "time": "2022-03-31T17:09:19+00:00" + "time": "2022-08-17T13:18:05+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -2620,7 +2569,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" }, "funding": [ { @@ -2640,16 +2589,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.3", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d" + "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d", - "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", + "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", "shasum": "" }, "require": { @@ -2705,7 +2654,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9" }, "funding": [ { @@ -2721,11 +2670,11 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-05-05T16:45:39+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", @@ -2784,7 +2733,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" }, "funding": [ { @@ -2804,16 +2753,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.7", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f" + "reference": "2d67c1f9a1937406a9be3171b4b22250c0a11447" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3a4442138d80c9f7b600fb297534ac718b61d37f", - "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2d67c1f9a1937406a9be3171b4b22250c0a11447", + "reference": "2d67c1f9a1937406a9be3171b4b22250c0a11447", "shasum": "" }, "require": { @@ -2848,7 +2797,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.7" + "source": "https://github.com/symfony/filesystem/tree/v5.4.12" }, "funding": [ { @@ -2864,20 +2813,20 @@ "type": "tidelift" } ], - "time": "2022-04-01T12:33:59+00:00" + "time": "2022-08-02T13:48:16+00:00" }, { "name": "symfony/finder", - "version": "v5.4.3", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" + "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", - "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", + "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", "shasum": "" }, "require": { @@ -2911,7 +2860,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.3" + "source": "https://github.com/symfony/finder/tree/v5.4.11" }, "funding": [ { @@ -2927,20 +2876,20 @@ "type": "tidelift" } ], - "time": "2022-01-26T16:34:36+00:00" + "time": "2022-07-29T07:37:50+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.3", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8" + "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8", - "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/54f14e36aa73cb8f7261d7686691fd4d75ea2690", + "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690", "shasum": "" }, "require": { @@ -2980,7 +2929,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.3" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.11" }, "funding": [ { @@ -2996,7 +2945,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-07-20T13:00:38+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3082,16 +3031,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + "reference": "433d05519ce6990bf3530fba6957499d327395c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", + "reference": "433d05519ce6990bf3530fba6957499d327395c2", "shasum": "" }, "require": { @@ -3103,7 +3052,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3143,7 +3092,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" }, "funding": [ { @@ -3159,20 +3108,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T21:10:46+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", "shasum": "" }, "require": { @@ -3184,7 +3133,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3227,7 +3176,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" }, "funding": [ { @@ -3243,20 +3192,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { @@ -3271,7 +3220,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3310,7 +3259,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -3326,20 +3275,20 @@ "type": "tidelift" } ], - "time": "2021-11-30T18:21:41+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", "shasum": "" }, "require": { @@ -3348,7 +3297,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3389,7 +3338,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" }, "funding": [ { @@ -3405,20 +3354,20 @@ "type": "tidelift" } ], - "time": "2021-06-05T21:20:04+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { @@ -3427,7 +3376,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3472,7 +3421,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" }, "funding": [ { @@ -3488,20 +3437,20 @@ "type": "tidelift" } ], - "time": "2022-03-04T08:16:47+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", "shasum": "" }, "require": { @@ -3510,7 +3459,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3551,7 +3500,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" }, "funding": [ { @@ -3567,20 +3516,20 @@ "type": "tidelift" } ], - "time": "2021-09-13T13:58:11+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/process", - "version": "v5.4.7", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb" + "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/38a44b2517b470a436e1c944bf9b9ba3961137fb", - "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb", + "url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1", + "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1", "shasum": "" }, "require": { @@ -3613,7 +3562,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.7" + "source": "https://github.com/symfony/process/tree/v5.4.11" }, "funding": [ { @@ -3629,20 +3578,20 @@ "type": "tidelift" } ], - "time": "2022-03-18T16:18:52+00:00" + "time": "2022-06-27T16:58:25+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", "shasum": "" }, "require": { @@ -3696,7 +3645,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" }, "funding": [ { @@ -3712,7 +3661,7 @@ "type": "tidelift" } ], - "time": "2022-03-13T20:07:29+00:00" + "time": "2022-05-30T19:17:29+00:00" }, { "name": "symfony/stopwatch", @@ -3778,16 +3727,16 @@ }, { "name": "symfony/string", - "version": "v5.4.3", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" + "reference": "2fc515e512d721bf31ea76bd02fe23ada4640058" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", + "url": "https://api.github.com/repos/symfony/string/zipball/2fc515e512d721bf31ea76bd02fe23ada4640058", + "reference": "2fc515e512d721bf31ea76bd02fe23ada4640058", "shasum": "" }, "require": { @@ -3844,7 +3793,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.3" + "source": "https://github.com/symfony/string/tree/v5.4.12" }, "funding": [ { @@ -3860,7 +3809,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-08-12T17:03:11+00:00" }, { "name": "theseer/tokenizer", diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index fa91421..80385c8 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -32,8 +32,10 @@ use OCP\Files\Cache\CacheEntryUpdatedEvent; use OCP\WorkflowEngine\Events\RegisterOperationsEvent; class Application extends App implements IBootstrap { + public const APPID = 'files_automatedtagging'; + public function __construct() { - parent::__construct('files_automatedtagging'); + parent::__construct(self::APPID); } public function register(IRegistrationContext $context): void { diff --git a/lib/Listener/CacheListener.php b/lib/Listener/CacheListener.php index ec888c5..57f9706 100644 --- a/lib/Listener/CacheListener.php +++ b/lib/Listener/CacheListener.php @@ -29,7 +29,7 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; class CacheListener implements IEventListener { - private $operation; + private Operation $operation; public function __construct(Operation $operation) { $this->operation = $operation; diff --git a/lib/Listener/RegisterFlowOperationsListener.php b/lib/Listener/RegisterFlowOperationsListener.php index 164f73d..089b9b9 100644 --- a/lib/Listener/RegisterFlowOperationsListener.php +++ b/lib/Listener/RegisterFlowOperationsListener.php @@ -25,18 +25,18 @@ declare(strict_types=1); namespace OCA\FilesAutomatedTagging\Listener; +use OCA\FilesAutomatedTagging\AppInfo\Application; use OCA\FilesAutomatedTagging\Operation; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use OCP\IServerContainer; use OCP\Util; use OCP\WorkflowEngine\Events\RegisterOperationsEvent; +use Psr\Container\ContainerInterface; class RegisterFlowOperationsListener implements IEventListener { - /** @var IServerContainer */ - private $container; + private ContainerInterface $container; - public function __construct(IServerContainer $container) { + public function __construct(ContainerInterface $container) { $this->container = $container; } @@ -46,6 +46,6 @@ class RegisterFlowOperationsListener implements IEventListener { } $operation = $this->container->get(Operation::class); $event->registerOperation($operation); - Util::addScript('files_automatedtagging', 'files_automatedtagging-main'); + Util::addScript(Application::APPID, 'files_automatedtagging-main'); } } diff --git a/lib/Operation.php b/lib/Operation.php index e400968..3a35969 100644 --- a/lib/Operation.php +++ b/lib/Operation.php @@ -22,6 +22,7 @@ namespace OCA\FilesAutomatedTagging; use InvalidArgumentException; +use OCA\FilesAutomatedTagging\AppInfo\Application; use OCA\GroupFolders\Mount\GroupFolderStorage; use OCA\WorkflowEngine\Entity\File; use OCP\EventDispatcher\Event; @@ -42,34 +43,14 @@ use RuntimeException; use UnexpectedValueException; class Operation implements ISpecificOperation, IComplexOperation { + protected ISystemTagObjectMapper $objectMapper; + protected ISystemTagManager $tagManager; + protected IManager $checkManager; + protected IL10N $l; + private IConfig $config; + private IURLGenerator $urlGenerator; + private IMountManager $mountManager; - /** @var ISystemTagObjectMapper */ - protected $objectMapper; - - /** @var ISystemTagManager */ - protected $tagManager; - - /** @var IManager */ - protected $checkManager; - - /** @var IL10N */ - protected $l; - - /** @var IConfig */ - private $config; - - /** @var IURLGenerator */ - private $urlGenerator; - /** @var IMountManager */ - private $mountManager; - - /** - * @param ISystemTagObjectMapper $objectMapper - * @param ISystemTagManager $tagManager - * @param IManager $checkManager - * @param IL10N $l - * @param IConfig $config - */ public function __construct( ISystemTagObjectMapper $objectMapper, ISystemTagManager $tagManager, @@ -100,9 +81,6 @@ class Operation implements ISpecificOperation, IComplexOperation { } /** - * @param string $name - * @param array[] $checks - * @param string $operation * @throws UnexpectedValueException */ public function validateOperation(string $name, array $checks, string $operation): void { @@ -169,95 +147,30 @@ class Operation implements ISpecificOperation, IComplexOperation { return 'appdata_' . $instanceId; } - /** - * returns a translated name to be presented in the web interface - * - * Example: "Automated tagging" (en), "AĆtomata etikedado" (eo) - * - * @since 18.0.0 - */ public function getDisplayName(): string { return $this->l->t('Automated tagging'); } - /** - * returns a translated, descriptive text to be presented in the web interface. - * - * It should be short and precise. - * - * Example: "Tag based automatic deletion of files after a given time." (en) - * - * @since 18.0.0 - */ public function getDescription(): string { return $this->l->t('Automated tagging of files'); } - /** - * returns the URL to the icon of the operator for display in the web interface. - * - * Usually, the implementation would utilize the `imagePath()` method of the - * `\OCP\IURLGenerator` instance and simply return its result. - * - * Example implementation: return $this->urlGenerator->imagePath('myApp', 'cat.svg'); - * - * @since 18.0.0 - */ public function getIcon(): string { - return $this->urlGenerator->imagePath('files_automatedtagging', 'app.svg'); + return $this->urlGenerator->imagePath(Application::APPID, 'app.svg'); } - /** - * returns whether the operation can be used in the requested scope. - * - * Scope IDs are defined as constants in OCP\WorkflowEngine\IManager. At - * time of writing these are SCOPE_ADMIN and SCOPE_USER. - * - * For possibly unknown future scopes the recommended behaviour is: if - * user scope is permitted, the default behaviour should return `true`, - * otherwise `false`. - * - * @since 18.0.0 - */ public function isAvailableForScope(int $scope): bool { return true; } - /** - * Is being called by the workflow engine when an event was triggered that - * is configured for this operation. An evaluation whether the event - * qualifies for this operation to run has still to be done by the - * implementor. - * - * If the implementor is an IComplexOperation, this method will not be - * called automatically. It can be used or left as no-op by the implementor. - * - * @since 18.0.0 - */ public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatcher): void { // Assigning tags is handled though the cache listener } - /** - * returns the id of the entity the operator is designed for - * - * Example: 'WorkflowEngine_Entity_File' - * - * @since 18.0.0 - */ public function getEntityId(): string { return File::class; } - /** - * As IComplexOperation chooses the triggering events itself, a hint has - * to be shown to the user so make clear when this operation is becoming - * active. This method returns such a translated string. - * - * Example: "When a file is accessed" (en) - * - * @since 18.0.0 - */ public function getTriggerHint(): string { return $this->l->t('File is changed'); } diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index c8a2994..a3634c0 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -24,41 +24,20 @@ namespace OCA\FilesAutomatedTagging\Settings; use OCP\AppFramework\Http\TemplateResponse; -use OCP\EventDispatcher\IEventDispatcher; use OCP\IL10N; use OCP\Settings\ISettings; use OCP\Util; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Admin implements ISettings { + private IL10N $l10n; + private string $appName; - /** @var IL10N */ - private $l10n; - - /** @var string */ - private $appName; - - /** @var EventDispatcherInterface */ - private $legacyEventDispatcher; - /** @var IEventDispatcher */ - private $eventDispatcher; - - /** - * @param string $appName - * @param IL10N $l - * @param EventDispatcherInterface $legacyEventDispatcher - */ - public function __construct(string $appName, IL10N $l, EventDispatcherInterface $legacyEventDispatcher, IEventDispatcher $eventDispatcher) { + public function __construct(string $appName, IL10N $l) { $this->appName = $appName; $this->l10n = $l; - $this->legacyEventDispatcher = $legacyEventDispatcher; - $this->eventDispatcher = $eventDispatcher; } - /** - * @return TemplateResponse - */ - public function getForm() { + public function getForm(): TemplateResponse { Util::addScript($this->appName, 'admin'); $parameters = [ 'appid' => $this->appName, @@ -71,21 +50,11 @@ class Admin implements ISettings { return new TemplateResponse('workflowengine', 'admin', $parameters, 'blank'); } - /** - * @return string the section ID, e.g. 'sharing' - */ - public function getSection() { + public function getSection(): string { return 'workflow'; } - /** - * @return int whether the form should be rather on the top or bottom of - * the admin section. The forms are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. - * - * E.g.: 70 - */ - public function getPriority() { + public function getPriority(): int { return 75; } } diff --git a/tests/OperationTest.php b/tests/OperationTest.php index 657c6da..6b2c223 100644 --- a/tests/OperationTest.php +++ b/tests/OperationTest.php @@ -39,7 +39,6 @@ use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class OperationTest extends TestCase { - /** @var ISystemTagObjectMapper|MockObject */ protected $objectMapper; /** @var ISystemTagManager|MockObject */ |