From facb7affe1b79b8e48fe1b19da398b250b79e24b Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 12 Jul 2021 11:17:20 -0100 Subject: [PATCH 1/2] Add php linting tests Signed-off-by: Maxence Lange --- .drone.yml | 131 - .github/workflows/lint-php-cs.yml | 35 + .github/workflows/lint-php.yml | 35 + .github/workflows/phpunit.yml | 202 ++ .gitignore | 1 + .php_cs.dist | 18 + composer.json | 16 +- composer.lock | 4158 ++++++++++++++++++++++++++++- tests/bootstrap.php | 19 +- 9 files changed, 4463 insertions(+), 152 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/lint-php-cs.yml create mode 100644 .github/workflows/lint-php.yml create mode 100644 .github/workflows/phpunit.yml create mode 100644 .php_cs.dist diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 76f2cb1b5..000000000 --- a/.drone.yml +++ /dev/null @@ -1,131 +0,0 @@ -pipeline: - signed-off-check: - image: nextcloudci/php7.0:php7.0-2 - environment: - - APP_NAME=circles - - CORE_BRANCH=stable22 - - DB=sqlite - commands: - - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - cd ../server - - php ./build/signed-off-checker.php - secrets: [ github_token ] - when: - matrix: - TESTS: signed-off-check - - phpunit-sqlite-php7.0: - image: nextcloudci/php7.0:php7.0-2 - environment: - - APP_NAME=circles - - CORE_BRANCH=stable22 - - DB=sqlite - commands: - - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - cd ../server/ - - ./occ app:enable $APP_NAME - - cd apps/$APP_NAME/tests/ - - # phpunit - - phpunit --configuration phpunit.xml - - # codecov - - wget https://codecov.io/bash -O codecov.sh - - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t ff710fa8-260c-4a61-bdd3-0771d6aea5b5; fi" - - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t ff710fa8-260c-4a61-bdd3-0771d6aea5b5; fi" - when: - matrix: - TESTS: phpunit-sqlite-php7.0 - - phpunit-sqlite-php5.6: - image: nextcloudci/php5.6:php5.6-3 - environment: - - APP_NAME=circles - - CORE_BRANCH=stable22 - - DB=sqlite - commands: - # Pre-setup steps - - apt update && apt-get -y install php5-xdebug - - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - cd ../server - - ./occ app:enable $APP_NAME - - cd apps/$APP_NAME/tests/ - - # phpunit - - phpunit --configuration phpunit.xml - when: - matrix: - TESTS: phpunit-sqlite-php5.6 - - sqlite-php7.1: - image: nextcloudci/php7.1:php7.1-11 - environment: - - APP_NAME=circles - - CORE_BRANCH=stable22 - - DB=sqlite - commands: - # Pre-setup steps - - yum -y install wget - - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - cd ../server - - ./occ app:enable $APP_NAME - - cd apps/$APP_NAME/tests/ - - # phpunit - - phpunit --configuration phpunit.xml - when: - matrix: - DB: sqlite - PHP: 7.1 - -services: - cache: - image: redis - postgres: - image: postgres - environment: - - POSTGRES_USER=oc_autotest - - POSTGRES_PASSWORD=oc_autotest - when: - matrix: - DB: pgsql - mysql: - image: mysql - environment: - - MYSQL_ROOT_PASSWORD=owncloud - - MYSQL_USER=oc_autotest - - MYSQL_PASSWORD=owncloud - - MYSQL_DATABASE=oc_autotest - when: - matrix: - DB: mysql - mysqlmb4: - image: mysql - environment: - - MYSQL_ROOT_PASSWORD=owncloud - - MYSQL_USER=oc_autotest - - MYSQL_PASSWORD=owncloud - - MYSQL_DATABASE=oc_autotest - command: [ "--innodb_large_prefix=true", "--innodb_file_format=barracuda", "--innodb_file_per_table=true" ] - when: - matrix: - DB: mysqlmb4 - -matrix: - include: - - TESTS: signed-off-check - - TESTS: phpunit-sqlite-php7.0 - - TESTS: phpunit-sqlite-php5.6 - -# - TESTS: mysql-php7.0 -# - TESTS: sqlite-php7.1 -# - TESTS: mysql-php7.1 -# - TESTS: sqlite-php5.6 - - DB: sqlite - PHP: 7.1 -# - TESTS: mysql-php5.6 - diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml new file mode 100644 index 000000000..9aad51409 --- /dev/null +++ b/.github/workflows/lint-php-cs.yml @@ -0,0 +1,35 @@ +# 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: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: php-cs + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: "7.4" + coverage: none + + - name: Install dependencies + run: composer i + + - name: Lint + run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 000000000..3e8bac9b9 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,35 @@ +# 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: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ["7.3", "7.4", "8.0"] + + name: php + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: none + + - name: Lint + run: composer run lint diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 000000000..fcfc65a9a --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,202 @@ +name: PHPUnit + +on: + pull_request: + push: + branches: + - master + - stable* + +env: + APP_NAME: circles + +jobs: + php: + runs-on: ubuntu-latest + + strategy: + # do not stop on another job's failure + fail-fast: false + matrix: + php-versions: ["8.0"] + databases: ["sqlite"] + server-versions: ["master"] + + name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} + + steps: + - name: Checkout server + uses: actions/checkout@v2 + with: + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + submodules: true + + - name: Checkout app + uses: actions/checkout@v2 + with: + path: apps/${{ env.APP_NAME }} + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php-versions }} + tools: phpunit + extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, gd, zip + + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer i + + - name: Set up Nextcloud + env: + DB_PORT: 4444 + run: | + mkdir data + ./occ maintenance:install --verbose --database=${{ matrix.databases }} --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 --force ${{ env.APP_NAME }} + php -S localhost:8080 & + + - name: PHPUnit & coverage + working-directory: apps/${{ env.APP_NAME }}/tests + run: ../vendor/phpunit/phpunit/phpunit --coverage-clover coverage.xml -c phpunit.xml + + # - name: PHPUnit integration + # working-directory: apps/${{ env.APP_NAME }} + # run: ./vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml + + - name: Upload coverage + working-directory: apps/${{ env.APP_NAME }}/tests + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: bash <(curl -s https://codecov.io/bash) + + mysql: + runs-on: ubuntu-latest + + strategy: + # do not stop on another job's failure + fail-fast: false + matrix: + php-versions: ["7.3", "7.4", "8.0"] + databases: ["mysql"] + server-versions: ["master"] + + name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} + + services: + mysql: + image: mariadb + ports: + - 4444:3306/tcp + env: + MYSQL_ROOT_PASSWORD: rootpassword + options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5 + + steps: + - name: Checkout server + uses: actions/checkout@v2 + with: + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + submodules: true + + - name: Checkout app + uses: actions/checkout@v2 + with: + path: apps/${{ env.APP_NAME }} + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php-versions }} + tools: phpunit + extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql, gd, zip + coverage: none + + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer i + + - name: Set up Nextcloud + env: + DB_PORT: 4444 + run: | + mkdir data + ./occ maintenance:install --verbose --database=${{ matrix.databases }} --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 --force ${{ env.APP_NAME }} + php -S localhost:8080 & + + - name: PHPUnit + working-directory: apps/${{ env.APP_NAME }}/tests + run: ../vendor/phpunit/phpunit/phpunit -c phpunit.xml + + # - name: PHPUnit integration + # working-directory: apps/${{ env.APP_NAME }} + # run: ./vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml + + pgsql: + runs-on: ubuntu-latest + + strategy: + # do not stop on another job's failure + fail-fast: false + matrix: + php-versions: ["8.0"] + databases: ["pgsql"] + server-versions: ["master"] + + name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} + + services: + postgres: + image: postgres + ports: + - 4444:5432/tcp + env: + POSTGRES_USER: root + POSTGRES_PASSWORD: rootpassword + POSTGRES_DB: nextcloud + options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5 + + steps: + - name: Checkout server + uses: actions/checkout@v2 + with: + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + submodules: true + + - name: Checkout app + uses: actions/checkout@v2 + with: + path: apps/${{ env.APP_NAME }} + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php-versions }} + tools: phpunit + extensions: mbstring, iconv, fileinfo, intl, pgsql, pdo_pgsql, gd, zip + coverage: none + + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer i + + - name: Set up Nextcloud + env: + DB_PORT: 4444 + run: | + mkdir data + ./occ maintenance:install --verbose --database=${{ matrix.databases }} --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 --force ${{ env.APP_NAME }} + php -S localhost:8080 & + + - name: PHPUnit + working-directory: apps/${{ env.APP_NAME }}/tests + run: ../vendor/phpunit/phpunit/phpunit -c phpunit.xml + + # - name: PHPUnit integration + # working-directory: apps/${{ env.APP_NAME }} + # run: ./vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml diff --git a/.gitignore b/.gitignore index 38ee4f52e..fe87a0e44 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ build/ .settings/ vendor/ +.php_cs.cache diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 000000000..f7bbdd812 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,18 @@ +getFinder() + ->ignoreVCSIgnored(true) + ->notPath('build') + ->notPath('l10n') + ->notPath('src') + ->notPath('vendor') + ->in(__DIR__); +return $config; diff --git a/composer.json b/composer.json index 890291fea..bdd4cae06 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,10 @@ "config": { "optimize-autoloader": true, "classmap-authoritative": true, - "autoloader-suffix": "Circles" + "autoloader-suffix": "Circles", + "platform": { + "php": "7.3" + } }, "authors": [ { @@ -21,5 +24,14 @@ }, "require": { "artificial-owl/my-small-php-tools": "~22" + }, + "scripts": { + "cs:check": "php-cs-fixer fix --dry-run --diff", + "cs:fix": "php-cs-fixer fix", + "lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l" + }, + "require-dev": { + "nextcloud/coding-standard": "^0.5.0", + "phpunit/phpunit": "^9.5" } -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index fa7cffdc2..23848e0eb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "520f4691b553c011a8f8c9d54a34bb0c", + "content-hash": "66a5f1b7417abb934f926dee132f4cca", "packages": [ { "name": "artificial-owl/my-small-php-tools", @@ -47,7 +47,4156 @@ "time": "2021-07-05T18:30:34+00:00" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "composer/semver", + "version": "3.2.5", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", + "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-05-24T12:41:47+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", + "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-05-05T19:37:51+00:00" + }, + { + "name": "doctrine/annotations", + "version": "1.13.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f", + "reference": "e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.13.1" + }, + "time": "2021-05-16T18:07:53+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2020-05-25T17:44:05+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v2.19.0", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "d5b8a9d852b292c2f8a035200fa6844b1f82300b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d5b8a9d852b292c2f8a035200fa6844b1f82300b", + "reference": "d5b8a9d852b292c2f8a035200fa6844b1f82300b", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^1.2 || ^2.0", + "doctrine/annotations": "^1.2", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^5.6 || ^7.0 || ^8.0", + "php-cs-fixer/diff": "^1.3", + "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", + "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^3.0 || ^4.0 || ^5.0", + "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", + "symfony/polyfill-php70": "^1.0", + "symfony/polyfill-php72": "^1.4", + "symfony/process": "^3.0 || ^4.0 || ^5.0", + "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.0", + "keradus/cli-executor": "^1.4", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.4.2", + "php-cs-fixer/accessible-object": "^1.0", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy-phpunit": "^1.1 || ^2.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", + "phpunitgoodpractices/polyfill": "^1.5", + "phpunitgoodpractices/traits": "^1.9.1", + "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", + "symfony/phpunit-bridge": "^5.2.1", + "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "2.19-dev" + } + }, + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "classmap": [ + "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", + "tests/Test/AbstractIntegrationTestCase.php", + "tests/Test/Assert/AssertTokensTrait.php", + "tests/Test/IntegrationCase.php", + "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", + "tests/Test/IsIdenticalConstraint.php", + "tests/Test/TokensWithObservedTransformers.php", + "tests/TestCase.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "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/v2.19.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2021-05-03T21:43:24+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "nextcloud/coding-standard", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/nextcloud/coding-standard.git", + "reference": "742ed895ae76c10daf95e08488cfb3f554199f40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/742ed895ae76c10daf95e08488cfb3f554199f40", + "reference": "742ed895ae76c10daf95e08488cfb3f554199f40", + "shasum": "" + }, + "require": { + "friendsofphp/php-cs-fixer": "^2.17", + "php": "^7.2|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nextcloud\\CodingStandard\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at" + } + ], + "description": "Nextcloud coding standards for the php cs fixer", + "support": { + "issues": "https://github.com/nextcloud/coding-standard/issues", + "source": "https://github.com/nextcloud/coding-standard/tree/v0.5.0" + }, + "time": "2021-01-11T14:15:58+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.11.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "fe14cf3672a149364fb66dfe11bf6549af899f94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/fe14cf3672a149364fb66dfe11bf6549af899f94", + "reference": "fe14cf3672a149364fb66dfe11bf6549af899f94", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.11.0" + }, + "time": "2021-07-03T13:36:55+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/master" + }, + "time": "2020-06-27T14:33:11+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "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" + }, + { + "name": "SpacePossum" + } + ], + "description": "sebastian/diff v2 backport support for PHP5.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/v1.3.1" + }, + "time": "2020-10-14T08:39:05+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, + "time": "2020-09-03T19:13:55+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + }, + "time": "2020-09-17T18:55:26+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + }, + "time": "2021-03-17T13:42:18+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f6293e1b30a2354e8428e004689671b83871edde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", + "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.10.2", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-03-28T07:26:59+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb", + "reference": "fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.1", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.6" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-23T05:14:38+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "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": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:24:23+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/console", + "version": "v5.3.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1", + "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.3.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-12T09:42:48+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-23T23:28:01+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "67a5f354afa8e2f231081b3fa11a5912f933c3ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/67a5f354afa8e2f231081b3fa11a5912f933c3ce", + "reference": "67a5f354afa8e2f231081b3fa11a5912f933c3ce", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/event-dispatcher-contracts": "^2", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^4.4|^5.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "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.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-26T17:43:10+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "69fee1ad2332a7cbab3aca13591953da9cdb7a11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/69fee1ad2332a7cbab3aca13591953da9cdb7a11", + "reference": "69fee1ad2332a7cbab3aca13591953da9cdb7a11", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-23T23:28:01+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.3.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/19b71c8f313b411172dd5f470fd61f24466d79a9", + "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.3.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-30T07:27:52+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6", + "reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-26T12:52:38+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v5.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "162e886ca035869866d233a2bfef70cc28f9bbe5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/162e886ca035869866d233a2bfef70cc28f9bbe5", + "reference": "162e886ca035869866d233a2bfef70cc28f9bbe5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.15" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-26T17:43:10+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/24b72c6baa32c746a4d0840147c9715e42bb68ab", + "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:27:20+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", + "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "metapackage", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/process", + "version": "v5.3.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "714b47f9196de61a196d86c4bad5f09201b307df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/714b47f9196de61a196d86c4bad5f09201b307df", + "reference": "714b47f9196de61a196d86c4bad5f09201b307df", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.3.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-12T10:15:01+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-04-01T10:43:52+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v5.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "313d02f59d6543311865007e5ff4ace05b35ee65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/313d02f59d6543311865007e5ff4ace05b35ee65", + "reference": "313d02f59d6543311865007e5ff4ace05b35ee65", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1.0|^2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v5.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-26T17:43:10+00:00" + }, + { + "name": "symfony/string", + "version": "v5.3.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.3.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-27T11:44:38+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "75a63c33a8577608444246075ea0af0d052e452a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", + "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2020-07-12T23:59:07+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], @@ -55,5 +4204,8 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.0.0" + "platform-overrides": { + "php": "7.3" + }, + "plugin-api-version": "2.1.0" } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3fdf128f9..c6a208fe7 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,22 +1,9 @@ addValidRoot(OC::$SERVERROOT . '/tests'); - -\OC_App::loadApp(Application::APP_ID); - -if (!class_exists('PHPUnit_Framework_TestCase')) { - require_once('PHPUnit/Autoload.php'); -} - -OC_Hook::clear(); - +\OC_App::loadApp('circles'); From 61b5a0e60882f08f84e6f7ab286d520a18f2f90b Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 12 Jul 2021 11:19:18 -0100 Subject: [PATCH 2/2] cs fix Signed-off-by: Maxence Lange --- appinfo/routes.php | 3 +- composer.lock | 2 +- lib/Activity/Filter.php | 1 - lib/Activity/Provider.php | 6 - lib/Activity/ProviderParser.php | 42 +- lib/Activity/ProviderSubjectCircle.php | 5 - lib/Activity/ProviderSubjectGroup.php | 4 - lib/Activity/ProviderSubjectLink.php | 3 - lib/Activity/ProviderSubjectMember.php | 3 - lib/Activity/SettingAsMember.php | 2 - lib/Activity/SettingAsModerator.php | 2 - lib/Activity/SettingAsNonMember.php | 3 - lib/Api/v1/Circles.php | 36 +- lib/AppInfo/Application.php | 35 +- lib/AppInfo/Capabilities.php | 74 ++- lib/Circles/FileSharingBroadcaster.php | 45 +- lib/CirclesManager.php | 5 - lib/CirclesQueryHelper.php | 8 +- .../v2/CollaboratorSearchPlugin.php | 12 +- lib/Command/CirclesCheck.php | 15 +- lib/Command/CirclesConfig.php | 10 +- lib/Command/CirclesCreate.php | 8 +- lib/Command/CirclesDestroy.php | 3 - lib/Command/CirclesDetails.php | 6 +- lib/Command/CirclesEdit.php | 4 - lib/Command/CirclesJoin.php | 3 - lib/Command/CirclesLeave.php | 3 - lib/Command/CirclesList.php | 5 - lib/Command/CirclesMaintenance.php | 6 - lib/Command/CirclesMemberships.php | 11 +- lib/Command/CirclesRemote.php | 11 +- lib/Command/CirclesReport.php | 6 - lib/Command/CirclesSync.php | 4 - lib/Command/CirclesTest.php | 25 +- lib/Command/FixUniqueId.php | 9 - lib/Command/Groups.php | 8 +- lib/Command/MembersAdd.php | 5 +- lib/Command/MembersDetails.php | 3 - lib/Command/MembersLevel.php | 7 - lib/Command/MembersList.php | 19 +- lib/Command/MembersRemove.php | 5 - lib/Command/MembersSearch.php | 4 - lib/Command/SharesFiles.php | 16 +- lib/Command/SyncContact.php | 3 - lib/Controller/AdminController.php | 28 +- lib/Controller/EventWrapperController.php | 10 +- lib/Controller/LocalController.php | 7 - lib/Controller/RemoteController.php | 11 +- lib/Cron/ContactsExistingShares.php | 10 +- lib/Cron/GlobalSync.php | 8 +- lib/Cron/Maintenance.php | 10 +- lib/Db/AccountsRequest.php | 4 - lib/Db/AccountsRequestBuilder.php | 8 +- lib/Db/CircleProviderRequest.php | 3 - lib/Db/CircleProviderRequestBuilder.php | 10 +- lib/Db/CircleRequest.php | 12 +- lib/Db/CircleRequestBuilder.php | 3 - lib/Db/CoreQueryBuilder.php | 123 ++--- lib/Db/CoreRequestBuilder.php | 68 ++- lib/Db/DeprecatedCirclesRequest.php | 8 +- lib/Db/DeprecatedCirclesRequestBuilder.php | 5 - lib/Db/DeprecatedMembersRequest.php | 13 +- lib/Db/DeprecatedMembersRequestBuilder.php | 2 - lib/Db/DeprecatedRequestBuilder.php | 38 +- lib/Db/EventWrapperRequest.php | 4 - lib/Db/EventWrapperRequestBuilder.php | 4 - lib/Db/FederatedLinksRequest.php | 5 - lib/Db/FederatedLinksRequestBuilder.php | 3 - lib/Db/FileSharesRequest.php | 4 - lib/Db/FileSharesRequestBuilder.php | 4 - lib/Db/GSSharesRequest.php | 8 - lib/Db/GSSharesRequestBuilder.php | 5 +- lib/Db/MemberRequest.php | 6 +- lib/Db/MemberRequestBuilder.php | 3 - lib/Db/MembershipRequest.php | 4 - lib/Db/MembershipRequestBuilder.php | 3 - lib/Db/MountRequest.php | 7 - lib/Db/MountRequestBuilder.php | 4 - lib/Db/RemoteRequest.php | 5 - lib/Db/RemoteRequestBuilder.php | 4 - lib/Db/ShareLockRequest.php | 4 - lib/Db/ShareLockRequestBuilder.php | 3 - lib/Db/ShareTokenRequest.php | 4 - lib/Db/ShareTokenRequestBuilder.php | 4 - lib/Db/ShareWrapperRequest.php | 4 - lib/Db/ShareWrapperRequestBuilder.php | 4 - lib/Db/TokensRequest.php | 4 - lib/Db/TokensRequestBuilder.php | 5 - lib/Events/AddingCircleMemberEvent.php | 4 - lib/Events/CircleCreatedEvent.php | 4 - lib/Events/CircleDestroyedEvent.php | 4 - lib/Events/CircleEditedEvent.php | 4 - lib/Events/CircleGenericEvent.php | 22 +- lib/Events/CircleMemberAddedEvent.php | 4 - lib/Events/CircleMemberEditedEvent.php | 4 - lib/Events/CircleMemberGenericEvent.php | 4 - lib/Events/CircleMemberRemovedEvent.php | 4 - lib/Events/CircleMemberRequestedEvent.php | 4 - lib/Events/CircleResultGenericEvent.php | 4 - lib/Events/CreatingCircleEvent.php | 4 - lib/Events/DestroyingCircleEvent.php | 4 - lib/Events/EditingCircleEvent.php | 4 - lib/Events/EditingCircleMemberEvent.php | 5 - lib/Events/MembershipsCreatedEvent.php | 4 - lib/Events/MembershipsEditedEvent.php | 4 - lib/Events/MembershipsRemovedEvent.php | 4 - lib/Events/RemovingCircleMemberEvent.php | 4 - lib/Events/RequestingCircleMemberEvent.php | 4 - lib/Events/SharedItemsSyncRequestedEvent.php | 4 - .../ApiVersionIncompatibleException.php | 2 - .../BroadcasterIsNotCompatibleException.php | 2 - .../CircleAlreadyExistsException.php | 3 - .../CircleDoesNotExistException.php | 3 - .../CircleNameFirstCharException.php | 4 - .../CircleNameTooShortException.php | 4 - lib/Exceptions/CircleNotFoundException.php | 4 - .../CircleTypeDisabledException.php | 4 - lib/Exceptions/CircleTypeIsEmptyException.php | 4 - .../CircleTypeNotValidException.php | 2 - .../CommandMissingArgumentException.php | 4 - .../ConfigNoCircleAvailableException.php | 2 - .../ContactAddressBookNotFoundException.php | 4 - lib/Exceptions/ContactFormatException.php | 4 - lib/Exceptions/ContactNotFoundException.php | 4 - .../EmailAccountInvalidFormatException.php | 2 - .../EventWrapperNotFoundException.php | 2 - lib/Exceptions/FakeException.php | 2 - .../FederatedCircleLinkFormatException.php | 2 - .../FederatedCircleNotAllowedException.php | 2 - .../FederatedCircleStatusUpdateException.php | 2 - .../FederatedEventDSyncException.php | 5 - lib/Exceptions/FederatedEventException.php | 2 - .../FederatedItemBadRequestException.php | 8 +- .../FederatedItemConflictException.php | 8 +- lib/Exceptions/FederatedItemException.php | 14 +- .../FederatedItemForbiddenException.php | 8 +- .../FederatedItemNotFoundException.php | 8 +- .../FederatedItemRemoteException.php | 8 +- .../FederatedItemServerException.php | 8 +- .../FederatedItemUnauthorizedException.php | 8 +- .../FederatedLinkCircleNotFoundException.php | 2 - .../FederatedLinkCreationException.php | 2 - .../FederatedLinkDoesNotExistException.php | 2 - .../FederatedLinkUpdateException.php | 2 - ...ratedRemoteCircleDoesNotExistException.php | 2 - .../FederatedRemoteDoesNotAllowException.php | 2 - .../FederatedRemoteIsDownException.php | 2 - .../FederatedShareAlreadyLockedException.php | 4 - .../FederatedShareBelongingException.php | 4 - .../FederatedShareNotFoundException.php | 4 - lib/Exceptions/FederatedUserException.php | 4 - .../FederatedUserNotFoundException.php | 3 - lib/Exceptions/FileCacheNotFoundException.php | 3 - lib/Exceptions/FrontendException.php | 4 - lib/Exceptions/GSKeyException.php | 4 - lib/Exceptions/GSStatusException.php | 4 - lib/Exceptions/GlobalScaleDSyncException.php | 2 - lib/Exceptions/GlobalScaleEventException.php | 2 - .../GroupCannotBeOwnerException.php | 2 - lib/Exceptions/GroupDoesNotExistException.php | 2 - lib/Exceptions/GroupNotFoundException.php | 3 - .../InitiatorNotConfirmedException.php | 3 - lib/Exceptions/InitiatorNotFoundException.php | 4 - lib/Exceptions/InvalidIdException.php | 5 - lib/Exceptions/InvalidModelException.php | 3 - lib/Exceptions/JsonException.php | 4 - .../LinkedGroupNotAllowedException.php | 2 - lib/Exceptions/MaintenanceException.php | 5 - .../MemberAlreadyExistsException.php | 3 - .../MemberCantJoinCircleException.php | 2 - .../MemberDoesNotExistException.php | 3 - lib/Exceptions/MemberHelperException.php | 3 - lib/Exceptions/MemberIsBlockedException.php | 2 - lib/Exceptions/MemberIsNotAdminException.php | 2 - .../MemberIsNotModeratorException.php | 2 - lib/Exceptions/MemberIsNotOwnerException.php | 2 - lib/Exceptions/MemberIsOwnerException.php | 2 - lib/Exceptions/MemberLevelException.php | 3 - lib/Exceptions/MemberNotFoundException.php | 4 - .../MemberTypeCantEditLevelException.php | 2 - lib/Exceptions/MembersLimitException.php | 4 - .../MembershipNotFoundException.php | 4 - lib/Exceptions/MigrationException.php | 4 - lib/Exceptions/MissingKeyInArrayException.php | 2 - lib/Exceptions/ModelException.php | 4 - .../ModeratorIsNotHighEnoughException.php | 2 - lib/Exceptions/MountNotFoundException.php | 4 - .../MountPointConstructionException.php | 4 - lib/Exceptions/NotContactAddressException.php | 2 - lib/Exceptions/NotLocalMemberException.php | 2 - lib/Exceptions/OwnerNotFoundException.php | 3 - lib/Exceptions/ParseMemberLevelException.php | 3 - lib/Exceptions/PayloadDeliveryException.php | 2 - .../RemoteAlreadyExistsException.php | 4 - lib/Exceptions/RemoteInstanceException.php | 3 - lib/Exceptions/RemoteNotFoundException.php | 4 - .../RemoteResourceNotFoundException.php | 3 - lib/Exceptions/RemoteUidException.php | 3 - lib/Exceptions/RequestBuilderException.php | 4 - .../ShareTokenAlreadyExistException.php | 4 - .../ShareTokenNotFoundException.php | 4 - .../ShareWrapperNotFoundException.php | 4 - .../SharingFrameAlreadyDeliveredException.php | 2 - .../SharingFrameAlreadyExistException.php | 2 - .../SharingFrameDoesNotExistException.php | 2 - ...FrameSourceCannotBeAppCirclesException.php | 2 - .../SingleCircleNotFoundException.php | 3 - lib/Exceptions/TokenDoesNotExistException.php | 2 - .../UnknownFederatedItemException.php | 6 - lib/Exceptions/UnknownInterfaceException.php | 4 - lib/Exceptions/UnknownRemoteException.php | 4 - lib/Exceptions/UserTypeNotFoundException.php | 4 - lib/FederatedItems/CircleConfig.php | 6 - lib/FederatedItems/CircleCreate.php | 6 - lib/FederatedItems/CircleDestroy.php | 6 - lib/FederatedItems/CircleEdit.php | 6 - lib/FederatedItems/CircleJoin.php | 6 - lib/FederatedItems/CircleLeave.php | 10 +- lib/FederatedItems/CircleSettings.php | 6 - lib/FederatedItems/Files/FileShare.php | 6 - lib/FederatedItems/Files/FileUnshare.php | 6 - lib/FederatedItems/ItemLock.php | 13 +- lib/FederatedItems/LoopbackTest.php | 10 +- lib/FederatedItems/MassiveMemberAdd.php | 6 - lib/FederatedItems/MemberDisplayName.php | 6 - lib/FederatedItems/MemberLevel.php | 6 - lib/FederatedItems/MemberRemove.php | 4 - lib/FederatedItems/SharedItemsSync.php | 6 +- lib/FederatedItems/SingleMemberAdd.php | 21 +- lib/GlobalScale/AGlobalScaleEvent.php | 8 +- lib/GlobalScale/CircleCreate.php | 7 +- lib/GlobalScale/CircleDestroy.php | 8 +- lib/GlobalScale/CircleStatus.php | 17 +- lib/GlobalScale/CircleUpdate.php | 7 +- lib/GlobalScale/FileShare.php | 34 +- lib/GlobalScale/FileUnshare.php | 7 +- lib/GlobalScale/GSMount/Mount.php | 9 +- lib/GlobalScale/GSMount/MountManager.php | 8 +- lib/GlobalScale/GSMount/MountProvider.php | 12 +- lib/GlobalScale/GlobalSync.php | 10 +- lib/GlobalScale/MemberAdd.php | 23 +- lib/GlobalScale/MemberJoin.php | 8 +- lib/GlobalScale/MemberLeave.php | 8 +- lib/GlobalScale/MemberRemove.php | 8 +- lib/GlobalScale/MemberUpdate.php | 8 +- lib/GlobalScale/Test.php | 8 +- lib/GlobalScale/UserDeleted.php | 8 +- lib/Handlers/WebfingerHandler.php | 15 +- lib/IBroadcaster.php | 2 - lib/IFederatedItem.php | 4 - lib/IFederatedItemAsyncProcess.php | 3 - lib/IFederatedItemCircleCheckNotRequired.php | 3 - lib/IFederatedItemDataRequestOnly.php | 3 - lib/IFederatedItemHighSeverity.php | 3 - ...FederatedItemInitiatorCheckNotRequired.php | 3 - ...atedItemInitiatorMembershipNotRequired.php | 3 - ...tedItemLimitedToInstanceWithMembership.php | 3 - lib/IFederatedItemLoopbackTest.php | 3 - lib/IFederatedItemMemberCheckNotRequired.php | 3 - lib/IFederatedItemMemberEmpty.php | 3 - lib/IFederatedItemMemberOptional.php | 3 - lib/IFederatedItemMemberRequired.php | 3 - ...IFederatedItemMustBeInitializedLocally.php | 3 - lib/IFederatedItemShareManagement.php | 4 - lib/IFederatedItemSharedItem.php | 3 - lib/IFederatedModel.php | 3 - lib/IFederatedSync.php | 4 - lib/IFederatedUser.php | 5 - lib/IMemberships.php | 3 - lib/ISearch.php | 4 - lib/Listeners/DeprecatedListener.php | 5 - .../Examples/ExampleAddingCircleMember.php | 10 +- .../Examples/ExampleMembershipsCreated.php | 8 +- .../Examples/ExampleMembershipsRemoved.php | 8 +- .../ExampleRequestingCircleMember.php | 6 - lib/Listeners/Files/AddingMember.php | 8 +- lib/Listeners/Files/MemberAdded.php | 8 +- lib/Listeners/Files/MembershipsRemoved.php | 6 - lib/Listeners/Files/RemovingMember.php | 8 +- lib/Listeners/GroupCreated.php | 3 - lib/Listeners/GroupDeleted.php | 3 - lib/Listeners/GroupMemberAdded.php | 4 - lib/Listeners/GroupMemberRemoved.php | 3 - .../Notifications/RequestingMember.php | 7 - lib/Listeners/UserCreated.php | 3 - lib/Listeners/UserDeleted.php | 3 - lib/Migration/ImportOwncloudCustomGroups.php | 1 - lib/Migration/Migration.php | 7 - .../Version0022Date20220526111723.php | 3 - .../Version0022Date20220526113601.php | 501 +++++++++--------- .../Version0022Date20220703115023.php | 147 +++-- lib/Model/BaseCircle.php | 27 +- lib/Model/BaseMember.php | 57 +- lib/Model/Circle.php | 108 ++-- lib/Model/DavCard.php | 40 +- lib/Model/DeprecatedCircle.php | 41 +- lib/Model/DeprecatedMember.php | 13 - lib/Model/Federated/EventWrapper.php | 30 +- lib/Model/Federated/FederatedEvent.php | 42 +- lib/Model/Federated/FederatedShare.php | 12 +- lib/Model/Federated/RemoteInstance.php | 48 +- lib/Model/FederatedLink.php | 38 +- lib/Model/FederatedUser.php | 13 +- lib/Model/FileCacheWrapper.php | 67 ++- lib/Model/GlobalScale/GSEvent.php | 63 +-- lib/Model/GlobalScale/GSShare.php | 36 +- lib/Model/GlobalScale/GSShareMountpoint.php | 16 +- lib/Model/GlobalScale/GSWrapper.php | 28 +- lib/Model/Helpers/MemberHelper.php | 6 - lib/Model/ManagedModel.php | 7 +- lib/Model/Member.php | 81 ++- lib/Model/Membership.php | 17 +- lib/Model/ModelManager.php | 35 +- lib/Model/Mount.php | 38 +- lib/Model/Mountpoint.php | 16 +- lib/Model/Report.php | 12 +- lib/Model/SearchResult.php | 13 +- lib/Model/ShareToken.php | 16 +- lib/Model/ShareWrapper.php | 41 +- lib/Model/SharesToken.php | 18 +- lib/Model/SharingFrame.php | 23 +- lib/MountManager/CircleMount.php | 8 +- lib/MountManager/CircleMountManager.php | 8 +- lib/MountManager/CircleMountProvider.php | 9 +- lib/Notification/Notifier.php | 8 - lib/Search/Contacts.php | 6 +- lib/Search/FederatedUsers.php | 4 - lib/Search/GlobalScaleUsers.php | 7 +- lib/Search/LocalGroups.php | 1 - lib/Search/LocalUsers.php | 7 +- lib/Service/CircleService.php | 19 +- lib/Service/CirclesService.php | 17 +- lib/Service/ConfigService.php | 206 ++++--- lib/Service/ContactService.php | 8 +- lib/Service/DavService.php | 19 +- lib/Service/EventService.php | 6 - lib/Service/EventWrapperService.php | 22 +- lib/Service/EventsService.php | 7 +- lib/Service/FederatedEventService.php | 12 +- lib/Service/FederatedShareService.php | 4 - lib/Service/FederatedUserService.php | 28 +- lib/Service/GSDownstreamService.php | 8 +- lib/Service/GSUpstreamService.php | 14 +- lib/Service/GlobalScaleService.php | 10 +- lib/Service/GroupsService.php | 8 - lib/Service/InterfaceService.php | 57 +- lib/Service/MaintenanceService.php | 9 +- lib/Service/MemberService.php | 8 +- lib/Service/MembersService.php | 13 - lib/Service/MembershipService.php | 12 +- lib/Service/MigrationService.php | 8 +- lib/Service/MiscService.php | 25 +- lib/Service/NotificationService.php | 7 - lib/Service/OutputService.php | 6 - lib/Service/RemoteDownstreamService.php | 6 - lib/Service/RemoteService.php | 6 - lib/Service/RemoteStreamService.php | 18 +- lib/Service/RemoteUpstreamService.php | 6 - lib/Service/SearchService.php | 8 +- lib/Service/ShareService.php | 2 - lib/Service/ShareTokenService.php | 6 - lib/Service/ShareWrapperService.php | 6 - lib/Service/SyncService.php | 20 +- lib/Service/TimezoneService.php | 3 - lib/ShareByCircleProvider.php | 14 +- lib/ShareByCircleProviderDeprecated.php | 34 +- lib/StatusCode.php | 20 +- templates/files/list.php | 4 +- tests/TestSuiteListener.php | 40 +- tests/bootstrap.php | 1 - tests/unit/lib/Api/CirclesTest.php | 56 +- 371 files changed, 1447 insertions(+), 2999 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index 1a2170599..f2a09e0ab 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -72,7 +72,7 @@ ], [ 'name' => 'Admin#memberLevel', - 'url' => '/admin/{emulated}/circles/{circleId}/members/{memberId}/level', + 'url' => '/admin/{emulated}/circles/{circleId}/members/{memberId}/level', 'verb' => 'PUT' ], @@ -113,4 +113,3 @@ ['name' => 'Remote#member', 'url' => '/member/{type}/{userId}/', 'verb' => 'GET'] ] ]; - diff --git a/composer.lock b/composer.lock index 23848e0eb..979c7861a 100644 --- a/composer.lock +++ b/composer.lock @@ -4207,5 +4207,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.0.0" } diff --git a/lib/Activity/Filter.php b/lib/Activity/Filter.php index 0535515d1..33c3df287 100644 --- a/lib/Activity/Filter.php +++ b/lib/Activity/Filter.php @@ -73,4 +73,3 @@ public function allowedApps() { return [Application::APP_ID]; } } - diff --git a/lib/Activity/Provider.php b/lib/Activity/Provider.php index b2ea4627e..215a03a98 100644 --- a/lib/Activity/Provider.php +++ b/lib/Activity/Provider.php @@ -41,7 +41,6 @@ use OCP\Activity\IManager; use OCP\Activity\IProvider; - /** * Class Provider * @@ -88,7 +87,6 @@ public function __construct( * {@inheritdoc} */ public function parse($lang, IEvent $event, IEvent $previousEvent = null) { - try { $params = $event->getSubjectParameters(); $this->initActivityParser($event, $params); @@ -99,7 +97,6 @@ public function parse($lang, IEvent $event, IEvent $previousEvent = null) { $this->parseAsNonMember($event, $circle, $params); $this->parseAsMember($event, $circle, $params); $this->parseAsModerator($event, $circle, $params); - } catch (FakeException $e) { /** clean exit */ } @@ -259,7 +256,6 @@ private function parseMemberAsModerator(IEvent $event, DeprecatedCircle $circle, * @throws FakeException */ private function parseLinkAsModerator(IEvent $event, DeprecatedCircle $circle, $params) { - if (!key_exists('link', $params)) { return; } @@ -278,6 +274,4 @@ private function parseLinkAsModerator(IEvent $event, DeprecatedCircle $circle, $ $this->parserLink->parseLinkDown($event, $circle, $remote); $this->parserLink->parseLinkRemove($event, $circle, $remote); } - - } diff --git a/lib/Activity/ProviderParser.php b/lib/Activity/ProviderParser.php index df75b1007..a00290823 100644 --- a/lib/Activity/ProviderParser.php +++ b/lib/Activity/ProviderParser.php @@ -206,11 +206,11 @@ protected function parseCircleMemberEvent( IEvent $event, DeprecatedCircle $circle, DeprecatedMember $member, $ownEvent, $othersEvent ) { $data = [ - 'author' => $this->generateViewerParameter($circle), - 'circle' => $this->generateCircleParameter($circle), - 'member' => $this->generateUserParameter($member), + 'author' => $this->generateViewerParameter($circle), + 'circle' => $this->generateCircleParameter($circle), + 'member' => $this->generateUserParameter($member), 'external' => $this->generateExternalMemberParameter($member), - 'group' => $this->generateGroupParameter($member), + 'group' => $this->generateGroupParameter($member), ]; if ($this->isViewerTheAuthor($circle, $this->activityManager->getCurrentUserId())) { @@ -299,9 +299,9 @@ protected function generateViewerParameter(DeprecatedCircle $circle) { */ protected function generateExternalMemberParameter(DeprecatedMember $member) { return [ - 'type' => $member->getTypeName(), - 'id' => $member->getUserId(), - 'name' => $member->getCachedName() . ' (' . $member->getTypeString() . ')', + 'type' => $member->getTypeName(), + 'id' => $member->getUserId(), + 'name' => $member->getCachedName() . ' (' . $member->getTypeString() . ')', '_parsed' => $member->getCachedName() ]; } @@ -314,11 +314,11 @@ protected function generateExternalMemberParameter(DeprecatedMember $member) { */ protected function generateCircleParameter(DeprecatedCircle $circle) { return [ - 'type' => 'circle', - 'id' => $circle->getId(), - 'name' => $circle->getName(), + 'type' => 'circle', + 'id' => $circle->getId(), + 'name' => $circle->getName(), '_parsed' => $circle->getName(), - 'link' => Circles::generateAbsoluteLink($circle->getUniqueId()) + 'link' => Circles::generateAbsoluteLink($circle->getUniqueId()) ]; } @@ -329,15 +329,14 @@ protected function generateCircleParameter(DeprecatedCircle $circle) { * @return array */ protected function generateRemoteCircleParameter($link) { - if ($link === null) { return null; } return [ - 'type' => 'circle', - 'id' => $link->getUniqueId(), - 'name' => $link->getToken() . '@' . $link->getAddress(), + 'type' => 'circle', + 'id' => $link->getUniqueId(), + 'name' => $link->getToken() . '@' . $link->getAddress(), '_parsed' => $link->getToken() . '@' . $link->getAddress() ]; } @@ -355,9 +354,9 @@ protected function generateUserParameter(DeprecatedMember $member) { } return [ - 'type' => 'user', - 'id' => $member->getUserId(), - 'name' => $display, + 'type' => 'user', + 'id' => $member->getUserId(), + 'name' => $display, '_parsed' => $display ]; } @@ -370,11 +369,10 @@ protected function generateUserParameter(DeprecatedMember $member) { */ protected function generateGroupParameter($group) { return [ - 'type' => 'user-group', - 'id' => $group->getUserId(), - 'name' => $group->getUserId(), + 'type' => 'user-group', + 'id' => $group->getUserId(), + 'name' => $group->getUserId(), '_parsed' => $group->getUserId() ]; } - } diff --git a/lib/Activity/ProviderSubjectCircle.php b/lib/Activity/ProviderSubjectCircle.php index 0e2dc652f..5bad392d9 100644 --- a/lib/Activity/ProviderSubjectCircle.php +++ b/lib/Activity/ProviderSubjectCircle.php @@ -27,11 +27,8 @@ namespace OCA\Circles\Activity; - use OCA\Circles\Exceptions\FakeException; use OCA\Circles\Model\DeprecatedCircle; -use OCA\Circles\Model\FederatedLink; -use OCA\Circles\Model\DeprecatedMember; use OCP\Activity\IEvent; class ProviderSubjectCircle extends ProviderParser { @@ -77,6 +74,4 @@ public function parseSubjectCircleDelete(IEvent $event, DeprecatedCircle $circle throw new FakeException(); } - - } diff --git a/lib/Activity/ProviderSubjectGroup.php b/lib/Activity/ProviderSubjectGroup.php index 45b8a54c6..8d43c12a4 100644 --- a/lib/Activity/ProviderSubjectGroup.php +++ b/lib/Activity/ProviderSubjectGroup.php @@ -27,10 +27,8 @@ namespace OCA\Circles\Activity; - use OCA\Circles\Exceptions\FakeException; use OCA\Circles\Model\DeprecatedCircle; -use OCA\Circles\Model\FederatedLink; use OCA\Circles\Model\DeprecatedMember; use OCP\Activity\IEvent; @@ -102,6 +100,4 @@ public function parseGroupLevel(IEvent $event, DeprecatedCircle $circle, Depreca throw new FakeException(); } - - } diff --git a/lib/Activity/ProviderSubjectLink.php b/lib/Activity/ProviderSubjectLink.php index 9c47de8ec..381d249ae 100644 --- a/lib/Activity/ProviderSubjectLink.php +++ b/lib/Activity/ProviderSubjectLink.php @@ -27,11 +27,9 @@ namespace OCA\Circles\Activity; - use OCA\Circles\Exceptions\FakeException; use OCA\Circles\Model\DeprecatedCircle; use OCA\Circles\Model\FederatedLink; -use OCA\Circles\Model\DeprecatedMember; use OCP\Activity\IEvent; class ProviderSubjectLink extends ProviderParser { @@ -274,5 +272,4 @@ public function parseLinkRemove(IEvent $event, DeprecatedCircle $circle, Federat throw new FakeException(); } - } diff --git a/lib/Activity/ProviderSubjectMember.php b/lib/Activity/ProviderSubjectMember.php index cb3238401..58f6ba316 100644 --- a/lib/Activity/ProviderSubjectMember.php +++ b/lib/Activity/ProviderSubjectMember.php @@ -27,7 +27,6 @@ namespace OCA\Circles\Activity; - use OCA\Circles\Exceptions\FakeException; use OCA\Circles\Model\DeprecatedCircle; use OCA\Circles\Model\DeprecatedMember; @@ -168,7 +167,6 @@ private function parseSubjectMemberAddClosedCircle(IEvent $event, DeprecatedCirc * @throws FakeException */ public function parseSubjectMemberLeft(IEvent $event, DeprecatedCircle $circle, DeprecatedMember $member) { - if ($event->getSubject() !== 'member_left') { return; } @@ -232,7 +230,6 @@ private function parseSubjectNonMemberLeftClosedCircle(IEvent $event, Deprecated * @throws FakeException */ public function parseSubjectMemberRemove(IEvent $event, DeprecatedCircle $circle, DeprecatedMember $member) { - if ($event->getSubject() !== 'member_remove') { return; } diff --git a/lib/Activity/SettingAsMember.php b/lib/Activity/SettingAsMember.php index cd900b4de..a3103ed4f 100644 --- a/lib/Activity/SettingAsMember.php +++ b/lib/Activity/SettingAsMember.php @@ -2,7 +2,6 @@ namespace OCA\Circles\Activity; - use OCP\Activity\ISetting; use OCP\IL10N; @@ -84,4 +83,3 @@ public function isDefaultEnabledMail() { return false; } } - diff --git a/lib/Activity/SettingAsModerator.php b/lib/Activity/SettingAsModerator.php index 5a554fcf8..d9f55e108 100644 --- a/lib/Activity/SettingAsModerator.php +++ b/lib/Activity/SettingAsModerator.php @@ -2,7 +2,6 @@ namespace OCA\Circles\Activity; - use OCP\Activity\ISetting; use OCP\IL10N; @@ -76,4 +75,3 @@ public function isDefaultEnabledMail() { return true; } } - diff --git a/lib/Activity/SettingAsNonMember.php b/lib/Activity/SettingAsNonMember.php index a5920a79d..d0bf0834e 100644 --- a/lib/Activity/SettingAsNonMember.php +++ b/lib/Activity/SettingAsNonMember.php @@ -2,11 +2,9 @@ namespace OCA\Circles\Activity; - use OCP\Activity\ISetting; use OCP\IL10N; - /** * Class SettingAsNonMember * @@ -91,4 +89,3 @@ public function isDefaultEnabledMail() { return false; } } - diff --git a/lib/Api/v1/Circles.php b/lib/Api/v1/Circles.php index 650471a26..d29f23cfb 100644 --- a/lib/Api/v1/Circles.php +++ b/lib/Api/v1/Circles.php @@ -29,7 +29,6 @@ namespace OCA\Circles\Api\v1; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Exceptions\FederatedUserException; @@ -44,26 +43,25 @@ use OCA\Circles\Service\FederatedUserService; class Circles { - - const API_VERSION = [0, 10, 0]; + public const API_VERSION = [0, 10, 0]; // Expose circle and member constants via API - const CIRCLES_PERSONAL = 1; - const CIRCLES_SECRET = 2; - const CIRCLES_CLOSED = 4; - const CIRCLES_PUBLIC = 8; - const CIRCLES_ALL = 15; + public const CIRCLES_PERSONAL = 1; + public const CIRCLES_SECRET = 2; + public const CIRCLES_CLOSED = 4; + public const CIRCLES_PUBLIC = 8; + public const CIRCLES_ALL = 15; - const TYPE_USER = Member::TYPE_USER; - const TYPE_GROUP = Member::TYPE_GROUP; - const TYPE_MAIL = Member::TYPE_MAIL; - const TYPE_CONTACT = Member::TYPE_CONTACT; + public const TYPE_USER = Member::TYPE_USER; + public const TYPE_GROUP = Member::TYPE_GROUP; + public const TYPE_MAIL = Member::TYPE_MAIL; + public const TYPE_CONTACT = Member::TYPE_CONTACT; - const LEVEL_NONE = Member::LEVEL_NONE; - const LEVEL_MEMBER = Member::LEVEL_MEMBER; - const LEVEL_MODERATOR = Member::LEVEL_MODERATOR; - const LEVEL_ADMIN = Member::LEVEL_ADMIN; - const LEVEL_OWNER = Member::LEVEL_OWNER; + public const LEVEL_NONE = Member::LEVEL_NONE; + public const LEVEL_MEMBER = Member::LEVEL_MEMBER; + public const LEVEL_MODERATOR = Member::LEVEL_MODERATOR; + public const LEVEL_ADMIN = Member::LEVEL_ADMIN; + public const LEVEL_OWNER = Member::LEVEL_OWNER; /** @@ -152,7 +150,7 @@ public static function joinedCircles($userId = '', $forceAll = false) { null, new SimpleDataStore( [ - 'mustBeMember' => true, + 'mustBeMember' => true, 'includePersonalCircles' => $personalCircle ] ) @@ -244,6 +242,4 @@ public static function getFilesForCircles($circleUniqueIds) { // return $c->query(CirclesService::class) // ->getFilesForCircles($circleUniqueIds); } - } - diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 58aac0e8a..a3545e99f 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -34,7 +34,6 @@ namespace OCA\Circles\AppInfo; - use Closure; use OC; use OCA\Circles\Events\AddingCircleMemberEvent; @@ -92,17 +91,15 @@ * @package OCA\Circles\AppInfo */ class Application extends App implements IBootstrap { + public const APP_ID = 'circles'; + public const APP_NAME = 'Circles'; + public const APP_TOKEN = 'dvG7laa0_UU'; + public const APP_SUBJECT = 'http://nextcloud.com/'; + public const APP_REL = 'https://apps.nextcloud.com/apps/circles'; + public const APP_API = 1; - const APP_ID = 'circles'; - const APP_NAME = 'Circles'; - const APP_TOKEN = 'dvG7laa0_UU'; - - const APP_SUBJECT = 'http://nextcloud.com/'; - const APP_REL = 'https://apps.nextcloud.com/apps/circles'; - const APP_API = 1; - - const CLIENT_TIMEOUT = 3; + public const CLIENT_TIMEOUT = 3; /** @var ConfigService */ @@ -114,7 +111,7 @@ class Application extends App implements IBootstrap { * * @param array $params */ - public function __construct(array $params = array()) { + public function __construct(array $params = []) { parent::__construct(self::APP_ID, $params); } @@ -149,13 +146,13 @@ public function register(IRegistrationContext $context): void { // It seems that AccountManager use deprecated dispatcher, let's use a deprecated listener $dispatcher = OC::$server->getEventDispatcher(); $dispatcher->addListener( - 'OC\AccountManager::userUpdated', function(GenericEvent $event) { - /** @var IUser $user */ - $user = $event->getSubject(); - /** @var DeprecatedListener $deprecatedListener */ - $deprecatedListener = OC::$server->get(DeprecatedListener::class); - $deprecatedListener->userAccountUpdated($user); - } + 'OC\AccountManager::userUpdated', function (GenericEvent $event) { + /** @var IUser $user */ + $user = $event->getSubject(); + /** @var DeprecatedListener $deprecatedListener */ + $deprecatedListener = OC::$server->get(DeprecatedListener::class); + $deprecatedListener->userAccountUpdated($user); + } ); $context->registerWellKnownHandler(WebfingerHandler::class); @@ -270,6 +267,4 @@ public function registerFilesNavigation() { // } // ); } - } - diff --git a/lib/AppInfo/Capabilities.php b/lib/AppInfo/Capabilities.php index 511a27f4b..e90b661f3 100644 --- a/lib/AppInfo/Capabilities.php +++ b/lib/AppInfo/Capabilities.php @@ -32,7 +32,6 @@ namespace OCA\Circles\AppInfo; - use OCA\Circles\Model\Circle; use OCA\Circles\Model\Member; use OCA\Circles\Service\ConfigService; @@ -41,7 +40,6 @@ use OCP\Capabilities\ICapability; use OCP\IL10N; - /** * Class Capabilities * @@ -92,11 +90,11 @@ public function __construct( public function getCapabilities(bool $complete = false): array { return [ Application::APP_ID => [ - 'version' => $this->appManager->getAppVersion(Application::APP_ID), - 'status' => $this->getCapabilitiesStatus($complete), + 'version' => $this->appManager->getAppVersion(Application::APP_ID), + 'status' => $this->getCapabilitiesStatus($complete), 'settings' => $this->configService->getSettings(), - 'circle' => $this->getCapabilitiesCircle(), - 'member' => $this->getCapabilitiesMember() + 'circle' => $this->getCapabilitiesCircle(), + 'member' => $this->getCapabilitiesMember() ], ]; } @@ -114,7 +112,7 @@ private function getCapabilitiesStatus(bool $complete = false): array { if ($complete) { $status['interfaces'] = [ - 'all' => $this->interfaceService->getInterfaces(true), + 'all' => $this->interfaceService->getInterfaces(true), 'internal' => $this->interfaceService->getInternalInterfaces(true) ]; } @@ -129,7 +127,7 @@ private function getCapabilitiesStatus(bool $complete = false): array { private function getCapabilitiesCircle(): array { return [ 'constants' => $this->getCapabilitiesCircleConstants(), - 'config' => $this->getCapabilitiesCircleConfig() + 'config' => $this->getCapabilitiesCircleConfig() ]; } @@ -140,7 +138,7 @@ private function getCapabilitiesCircle(): array { private function getCapabilitiesMember(): array { return [ 'constants' => $this->getCapabilitiesMemberConstants(), - 'type' => Member::$TYPE + 'type' => Member::$TYPE ]; } @@ -150,38 +148,38 @@ private function getCapabilitiesMember(): array { */ private function getCapabilitiesCircleConstants(): array { return [ - 'flags' => [ - Circle::CFG_SINGLE => $this->l10n->t('Single'), - Circle::CFG_PERSONAL => $this->l10n->t('Personal'), - Circle::CFG_SYSTEM => $this->l10n->t('System'), - Circle::CFG_VISIBLE => $this->l10n->t('Visible'), - Circle::CFG_OPEN => $this->l10n->t('Open'), - Circle::CFG_INVITE => $this->l10n->t('Invite'), - Circle::CFG_REQUEST => $this->l10n->t('Join Request'), - Circle::CFG_FRIEND => $this->l10n->t('Friends'), - Circle::CFG_PROTECTED => $this->l10n->t('Password Protected'), - Circle::CFG_NO_OWNER => $this->l10n->t('No Owner'), - Circle::CFG_HIDDEN => $this->l10n->t('Hidden'), - Circle::CFG_BACKEND => $this->l10n->t('Backend'), - Circle::CFG_LOCAL => $this->l10n->t('Local'), - Circle::CFG_ROOT => $this->l10n->t('Root'), + 'flags' => [ + Circle::CFG_SINGLE => $this->l10n->t('Single'), + Circle::CFG_PERSONAL => $this->l10n->t('Personal'), + Circle::CFG_SYSTEM => $this->l10n->t('System'), + Circle::CFG_VISIBLE => $this->l10n->t('Visible'), + Circle::CFG_OPEN => $this->l10n->t('Open'), + Circle::CFG_INVITE => $this->l10n->t('Invite'), + Circle::CFG_REQUEST => $this->l10n->t('Join Request'), + Circle::CFG_FRIEND => $this->l10n->t('Friends'), + Circle::CFG_PROTECTED => $this->l10n->t('Password Protected'), + Circle::CFG_NO_OWNER => $this->l10n->t('No Owner'), + Circle::CFG_HIDDEN => $this->l10n->t('Hidden'), + Circle::CFG_BACKEND => $this->l10n->t('Backend'), + Circle::CFG_LOCAL => $this->l10n->t('Local'), + Circle::CFG_ROOT => $this->l10n->t('Root'), Circle::CFG_CIRCLE_INVITE => $this->l10n->t('Circle Invite'), - Circle::CFG_FEDERATED => $this->l10n->t('Federated'), - Circle::CFG_MOUNTPOINT => $this->l10n->t('Mount point') + Circle::CFG_FEDERATED => $this->l10n->t('Federated'), + Circle::CFG_MOUNTPOINT => $this->l10n->t('Mount point') ], 'source' => [ - 'core' => [ - Member::TYPE_USER => $this->l10n->t('Nextcloud User'), - Member::TYPE_GROUP => $this->l10n->t('Nextcloud Group'), - Member::TYPE_MAIL => $this->l10n->t('Email Address'), + 'core' => [ + Member::TYPE_USER => $this->l10n->t('Nextcloud User'), + Member::TYPE_GROUP => $this->l10n->t('Nextcloud Group'), + Member::TYPE_MAIL => $this->l10n->t('Email Address'), Member::TYPE_CONTACT => $this->l10n->t('Contact'), - Member::TYPE_CIRCLE => $this->l10n->t('Circle'), - Member::TYPE_APP => $this->l10n->t('Nextcloud App') + Member::TYPE_CIRCLE => $this->l10n->t('Circle'), + Member::TYPE_APP => $this->l10n->t('Nextcloud App') ], 'extra' => [ Member::APP_CIRCLES => 'Circles App', - Member::APP_OCC => 'Admin Command Line' + Member::APP_OCC => 'Admin Command Line' ] ] ]; @@ -193,7 +191,7 @@ private function getCapabilitiesCircleConstants(): array { */ private function getCapabilitiesCircleConfig(): array { return [ - 'coreFlags' => Circle::$DEF_CFG_CORE_FILTER, + 'coreFlags' => Circle::$DEF_CFG_CORE_FILTER, 'systemFlags' => Circle::$DEF_CFG_SYSTEM_FILTER ]; } @@ -205,13 +203,11 @@ private function getCapabilitiesCircleConfig(): array { private function getCapabilitiesMemberConstants(): array { return [ 'level' => [ - Member::LEVEL_MEMBER => $this->l10n->t('Member'), + Member::LEVEL_MEMBER => $this->l10n->t('Member'), Member::LEVEL_MODERATOR => $this->l10n->t('Moderator'), - Member::LEVEL_ADMIN => $this->l10n->t('Admin'), - Member::LEVEL_OWNER => $this->l10n->t('Owner') + Member::LEVEL_ADMIN => $this->l10n->t('Admin'), + Member::LEVEL_OWNER => $this->l10n->t('Owner') ] ]; } - } - diff --git a/lib/Circles/FileSharingBroadcaster.php b/lib/Circles/FileSharingBroadcaster.php index 350480625..89cc376a4 100644 --- a/lib/Circles/FileSharingBroadcaster.php +++ b/lib/Circles/FileSharingBroadcaster.php @@ -58,7 +58,6 @@ use OCP\Share\IShare; use OCP\Util; - /** * Class FileSharingBroadcaster * @deprecated @@ -146,7 +145,6 @@ public function init() { $this->federatedEnabled = true; } catch (QueryException $e) { } - } @@ -283,7 +281,7 @@ public function sendMailAboutExistingShares(DeprecatedCircle $circle, Deprecated $allShares = $this->fileSharesRequest->getSharesForCircle($member->getCircleId()); $knownShares = array_map( - function(SharesToken $shareToken) { + function (SharesToken $shareToken) { return $shareToken->getShareId(); }, $this->tokensRequest->getTokensFromMember($member) @@ -382,10 +380,10 @@ public function sharedByFederated(DeprecatedCircle $circle, IShare $share, strin } catch (\Exception $e) { $this->logger->logException( $e, [ - 'message' => 'Failed to notify remote server of circles-federated share', - 'level' => ILogger::ERROR, - 'app' => 'circles', - ] + 'message' => 'Failed to notify remote server of circles-federated share', + 'level' => ILogger::ERROR, + 'app' => 'circles', + ] ); } @@ -505,12 +503,12 @@ protected function sendPasswordByMail(IShare $share, $circleName, $email, $passw $emailTemplate = $this->mailer->createEMailTemplate( 'sharebymail.RecipientPasswordNotification', [ - 'filename' => $filename, - 'password' => $password, - 'initiator' => $initiatorDisplayName, - 'initiatorEmail' => $initiatorEmailAddress, - 'shareWith' => $shareWith, - ] + 'filename' => $filename, + 'password' => $password, + 'initiator' => $initiatorDisplayName, + 'initiatorEmail' => $initiatorEmailAddress, + 'shareWith' => $shareWith, + ] ); $emailTemplate->setSubject( @@ -561,11 +559,11 @@ private function generateEmailTemplate($subject, $text, $fileName, $link, $autho ) { $emailTemplate = $this->mailer->createEMailTemplate( 'circles.ShareNotification', [ - 'fileName' => $fileName, - 'fileLink' => $link, - 'author' => $author, - 'circleName' => $circleName, - ] + 'fileName' => $fileName, + 'fileLink' => $link, + 'author' => $author, + 'circleName' => $circleName, + ] ); $emailTemplate->addHeader(); @@ -653,9 +651,9 @@ protected function sendPasswordExistingShares(DeprecatedMember $author, string $ $emailTemplate = $this->mailer->createEMailTemplate( 'sharebymail.RecipientPasswordNotification', [ - 'password' => $password, - 'author' => $author - ] + 'password' => $password, + 'author' => $author + ] ); $emailTemplate->setSubject( @@ -711,8 +709,8 @@ private function getMailLinkFromShare(array $share, DeprecatedMember $member, st $filename = basename($share['file_target']); return [ - 'author' => $author, - 'link' => $link, + 'author' => $author, + 'link' => $link, 'filename' => $filename ]; } @@ -813,5 +811,4 @@ private function getMailsFromContact(string $contactId): array { return $contact['EMAIL']; } - } diff --git a/lib/CirclesManager.php b/lib/CirclesManager.php index e69ccd83b..130defaaa 100644 --- a/lib/CirclesManager.php +++ b/lib/CirclesManager.php @@ -31,7 +31,6 @@ namespace OCA\Circles; - use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Exceptions\FederatedEventException; @@ -58,7 +57,6 @@ use OCA\Circles\Service\MemberService; use OCP\IUserSession; - /** * Class CirclesManager * @@ -326,7 +324,4 @@ public function getCircle(string $singleId): Circle { * @return Member */ // public function getMemberById(string $memberId): Member { - - } - diff --git a/lib/CirclesQueryHelper.php b/lib/CirclesQueryHelper.php index cc329d10b..97b5e5906 100644 --- a/lib/CirclesQueryHelper.php +++ b/lib/CirclesQueryHelper.php @@ -31,7 +31,6 @@ namespace OCA\Circles; - use OCA\Circles\Db\CoreQueryBuilder; use OCA\Circles\Db\CoreRequestBuilder; use OCA\Circles\Exceptions\CircleNotFoundException; @@ -42,7 +41,6 @@ use OCP\DB\QueryBuilder\ICompositeExpression; use OCP\DB\QueryBuilder\IQueryBuilder; - /** * Class CirclesQueryHelper * @@ -109,7 +107,7 @@ public function limitToSession( $this->queryBuilder->setOptions( [CoreQueryBuilder::HELPER], [ - 'getData' => $fullDetails, + 'getData' => $fullDetails, 'mustBeMember' => true ] ); @@ -142,7 +140,7 @@ public function limitToInheritedMembers( $this->queryBuilder->setOptions( [CoreQueryBuilder::HELPER], [ - 'getData' => $fullDetails, + 'getData' => $fullDetails, 'mustBeMember' => true ] ); @@ -193,6 +191,4 @@ public function extractCircle(array $data): Circle { return $circle; } - } - diff --git a/lib/Collaboration/v2/CollaboratorSearchPlugin.php b/lib/Collaboration/v2/CollaboratorSearchPlugin.php index f2d14564e..e38d25298 100644 --- a/lib/Collaboration/v2/CollaboratorSearchPlugin.php +++ b/lib/Collaboration/v2/CollaboratorSearchPlugin.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Collaboration\v2; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use Exception; use OC\Share20\Share; @@ -42,7 +41,6 @@ use OCP\Collaboration\Collaborators\ISearchResult; use OCP\Collaboration\Collaborators\SearchResultType; - /** * Class CollaboratorSearchPlugin * @@ -91,7 +89,7 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b $filterCircle, null, new SimpleDataStore( [ - 'limit' => $limit, + 'limit' => $limit, 'offset' => $offset ] ) @@ -123,15 +121,13 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b */ private function addResultEntry(Circle $circle): array { return [ - 'label' => $circle->getDisplayName(), + 'label' => $circle->getDisplayName(), 'shareWithDescription' => $circle->getOwner()->getDisplayName(), - 'value' => [ + 'value' => [ 'shareType' => Share::TYPE_CIRCLE, 'shareWith' => $circle->getSingleId(), - 'circle' => $circle + 'circle' => $circle ], ]; } - } - diff --git a/lib/Command/CirclesCheck.php b/lib/Command/CirclesCheck.php index db007916a..8a04dd4af 100644 --- a/lib/Command/CirclesCheck.php +++ b/lib/Command/CirclesCheck.php @@ -1,4 +1,6 @@ -writeln( '- Address ' . $loopback . ' is now used as loopback' ); - } /** @@ -464,8 +462,6 @@ private function checkInternal(InputInterface $input, OutputInterface $output, s $output->writeln( '. The address you need to define here is the local address of your Nextcloud, reachable by all other instances of our GlobalScale.' ); - - } @@ -499,7 +495,6 @@ private function checkFrontal(InputInterface $input, OutputInterface $output, st while (true) { - $question = new Question( 'Please write down a new frontal address to test: ', '' ); @@ -740,6 +735,4 @@ private function parseAddress(string $test): array { return [$scheme, $cloudId]; } - } - diff --git a/lib/Command/CirclesConfig.php b/lib/Command/CirclesConfig.php index f32a7cfb7..053b54fac 100644 --- a/lib/Command/CirclesConfig.php +++ b/lib/Command/CirclesConfig.php @@ -31,9 +31,6 @@ namespace OCA\Circles\Command; -use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; -use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; -use ArtificialOwl\MySmallPhpTools\Exceptions\SignatoryException; use OC\Core\Command\Base; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Exceptions\FederatedEventException; @@ -62,7 +59,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesConfig * @@ -223,14 +219,12 @@ private function filterValidConfig(Circle $circle): array { array_walk( $listing, - function(string &$v): void { - list(, $long) = explode('|', $v); + function (string &$v): void { + [, $long] = explode('|', $v); $v = strtoupper(str_replace(' ', '', $long)); } ); return $listing; } - } - diff --git a/lib/Command/CirclesCreate.php b/lib/Command/CirclesCreate.php index 9f1e617ef..bcba99c94 100644 --- a/lib/Command/CirclesCreate.php +++ b/lib/Command/CirclesCreate.php @@ -1,4 +1,6 @@ -federatedUserService = $federatedUserService; $this->circleService = $circleService; - } @@ -133,6 +133,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/CirclesDestroy.php b/lib/Command/CirclesDestroy.php index d5e3de258..2e65ccd92 100644 --- a/lib/Command/CirclesDestroy.php +++ b/lib/Command/CirclesDestroy.php @@ -54,7 +54,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesDestroy * @@ -144,6 +143,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/CirclesDetails.php b/lib/Command/CirclesDetails.php index 65fc89a5a..a1fe097ee 100644 --- a/lib/Command/CirclesDetails.php +++ b/lib/Command/CirclesDetails.php @@ -59,7 +59,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesDetails * @@ -118,7 +117,6 @@ protected function configure() { ->addOption('initiator', '', InputOption::VALUE_REQUIRED, 'set an initiator to the request', '') ->addOption('initiator-type', '', InputOption::VALUE_REQUIRED, 'set initiator type', '0') ->addOption('status-code', '', InputOption::VALUE_NONE, 'display status code on exception'); - } @@ -154,7 +152,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $circleId, $instance, [ - 'initiator' => $input->getOption('initiator'), + 'initiator' => $input->getOption('initiator'), 'initiatorType' => Member::parseTypeString($input->getOption('initiator-type')) ] ); @@ -188,6 +186,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/CirclesEdit.php b/lib/Command/CirclesEdit.php index eead3de6c..8bcfa38e3 100644 --- a/lib/Command/CirclesEdit.php +++ b/lib/Command/CirclesEdit.php @@ -57,7 +57,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesEdit * @@ -105,7 +104,6 @@ protected function configure() { ->addOption('initiator', '', InputOption::VALUE_REQUIRED, 'set an initiator to the request', '') ->addOption('initiator-type', '', InputOption::VALUE_REQUIRED, 'set initiator type', '0') ->addOption('status-code', '', InputOption::VALUE_NONE, 'display status code on exception'); - } @@ -170,6 +168,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/CirclesJoin.php b/lib/Command/CirclesJoin.php index 76b1c9368..5e2d2a4e1 100644 --- a/lib/Command/CirclesJoin.php +++ b/lib/Command/CirclesJoin.php @@ -57,7 +57,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesJoin * @@ -155,6 +154,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/CirclesLeave.php b/lib/Command/CirclesLeave.php index 23ab5d18c..8853f727e 100644 --- a/lib/Command/CirclesLeave.php +++ b/lib/Command/CirclesLeave.php @@ -45,7 +45,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesLeave * @@ -135,6 +134,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/CirclesList.php b/lib/Command/CirclesList.php index 8724a971b..88ce0a50c 100644 --- a/lib/Command/CirclesList.php +++ b/lib/Command/CirclesList.php @@ -65,15 +65,12 @@ use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesList * * @package OCA\Circles\Command */ class CirclesList extends Base { - - use TArrayTools; use TStringTools; @@ -233,6 +230,4 @@ private function displayCircles(array $circles): void { ); } } - } - diff --git a/lib/Command/CirclesMaintenance.php b/lib/Command/CirclesMaintenance.php index 603628bc9..d9e97fcc5 100644 --- a/lib/Command/CirclesMaintenance.php +++ b/lib/Command/CirclesMaintenance.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Command; - use OC\Core\Command\Base; use OCA\Circles\Db\CoreRequestBuilder; use OCA\Circles\Exceptions\MaintenanceException; @@ -43,7 +42,6 @@ use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; - /** * Class CirclesMaintenance * @@ -169,8 +167,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - - - diff --git a/lib/Command/CirclesMemberships.php b/lib/Command/CirclesMemberships.php index 39e729159..743ad1bd6 100644 --- a/lib/Command/CirclesMemberships.php +++ b/lib/Command/CirclesMemberships.php @@ -73,15 +73,12 @@ use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesMemberships * * @package OCA\Circles\Command */ class CirclesMemberships extends Base { - - use TArrayTools; use TNC22ConsoleTree; @@ -245,7 +242,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->drawTree( $tree, [$this, 'displayLeaf'], [ - 'height' => 3, + 'height' => 3, 'node-spacing' => 0, 'item-spacing' => 1, ] @@ -276,8 +273,8 @@ private function generateTree(string $id, NC22TreeNode $tree, array $knownIds = $item = new NC22TreeNode( $tree, new SimpleDataStore( [ - 'member' => $member, - 'cycling' => in_array($member->getCircleId(), $knownIds) + 'member' => $member, + 'cycling' => in_array($member->getCircleId(), $knownIds) ] ) ); @@ -400,6 +397,4 @@ private function manageAllMemberships() { $output->writeln($count . ' memberships updated'); } - } - diff --git a/lib/Command/CirclesRemote.php b/lib/Command/CirclesRemote.php index 54f15b72a..05572c2c1 100644 --- a/lib/Command/CirclesRemote.php +++ b/lib/Command/CirclesRemote.php @@ -57,15 +57,12 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; - /** * Class CirclesRemote * * @package OCA\Circles\Command */ class CirclesRemote extends Base { - - use TNC22WellKnown; use TStringTools; @@ -249,7 +246,7 @@ private function requestInstance(string $host): void { } $payload = [ - 'test' => 42, + 'test' => 42, 'token' => $this->uuid() ]; $signedRequest = $this->outgoingTest($testUrl, $payload); @@ -325,14 +322,12 @@ private function requestInstance(string $host): void { ); $this->remoteStreamService->update($remoteSignatory, RemoteStreamService::UPDATE_HREF); } - } catch (RemoteUidException $e) { $this->updateRemote($remoteSignatory); } catch (RemoteNotFoundException $e) { $this->saveRemote($remoteSignatory); } } - } @@ -435,7 +430,7 @@ private function checkKnownInstance(): void { private function verifyGSInstances(): void { $instances = $this->globalScaleService->getGlobalScaleInstances(); $known = array_map( - function(RemoteInstance $instance): string { + function (RemoteInstance $instance): string { return $instance->getInstance(); }, $this->remoteRequest->getFromType(RemoteInstance::TYPE_GLOBALSCALE) ); @@ -531,6 +526,4 @@ private function getRemoteInterface(): int { throw new Exception('Unknown interface: ' . implode(', ', InterfaceService::$LIST_IFACE)); } - } - diff --git a/lib/Command/CirclesReport.php b/lib/Command/CirclesReport.php index e7630470e..9c962a33c 100644 --- a/lib/Command/CirclesReport.php +++ b/lib/Command/CirclesReport.php @@ -57,15 +57,12 @@ use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesReport * * @package OCA\Circles\Command */ class CirclesReport extends Base implements IInteractiveShellClient { - - use TNC22Deserialize; use TArrayTools; @@ -435,7 +432,4 @@ public function onNewPrompt(NC22InteractiveShellSession $session): void { public function onNewCommand(NC22InteractiveShellSession $session, $command): void { echo $session->getPath(); } - - } - diff --git a/lib/Command/CirclesSync.php b/lib/Command/CirclesSync.php index 03c2bf1b3..ff04b1c28 100644 --- a/lib/Command/CirclesSync.php +++ b/lib/Command/CirclesSync.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Command; - use OC\Core\Command\Base; use OCA\Circles\Exceptions\ContactAddressBookNotFoundException; use OCA\Circles\Exceptions\ContactFormatException; @@ -49,7 +48,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class CirclesSync * @@ -178,6 +176,4 @@ private function filterSync(InputInterface $input): int { return $sync; } - } - diff --git a/lib/Command/CirclesTest.php b/lib/Command/CirclesTest.php index 6eb992f64..f350a468a 100644 --- a/lib/Command/CirclesTest.php +++ b/lib/Command/CirclesTest.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Command; - use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Exceptions\ItemNotFoundException; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; @@ -40,7 +39,6 @@ use Exception; use OC\Core\Command\Base; use OCA\Circles\AppInfo\Application; -use OCA\Circles\CirclesManager; use OCA\Circles\Db\CoreRequestBuilder; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Model\Circle; @@ -53,21 +51,18 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Process; - /** * Class CirclesTest * * @package OCA\Circles\Command */ class CirclesTest extends Base { - - use TArrayTools; use TStringTools; use TNC22Deserialize; - static $INSTANCES = [ + public static $INSTANCES = [ 'global-scale-1', 'global-scale-2', 'global-scale-3', @@ -77,7 +72,7 @@ class CirclesTest extends Base { ]; - static $TEST_CIRCLES = [ + public static $TEST_CIRCLES = [ 'test_001' ]; @@ -296,7 +291,6 @@ private function initEnvironment() { } $this->r(); } - } } @@ -575,7 +569,8 @@ private function circleCreation001() { /** @var Circle $createdCircle */ $createdCircle = $this->deserialize($dataCreatedCircle001, Circle::class); $this->circles[$localInstanceId][$createdCircle->getName()] = $createdCircle; - $this->r(true, $createdCircle->getSingleId());; + $this->r(true, $createdCircle->getSingleId()); + ; $this->p('Comparing data returned at creation'); if ($createdCircle->getSingleId() === '' || $createdCircle->getOwner()->getId() === '') { @@ -647,7 +642,8 @@ private function addLocalMemberByUserId() { $member = $this->getInstanceUsers($instanceId)[2]; $addedMember = $this->processMemberAdd($instanceId, $circleName, $member, 'user'); - $this->r(true, $addedMember->getId());; + $this->r(true, $addedMember->getId()); + ; // check test2 } @@ -673,7 +669,8 @@ private function addLocalMemberBySingleId() { ); /** @var Member $addedMember */ $addedMember = $this->deserialize($dataAddedMember, Member::class); - $this->r(true, $addedMember->getId());; + $this->r(true, $addedMember->getId()); + ; // check test6 } @@ -696,7 +693,8 @@ private function addLocalMemberUsingMember() { ); /** @var Member $addedMember */ $addedMember = $this->deserialize($dataAddedMember, Member::class); - $this->r(true, $addedMember->getId());; + $this->r(true, $addedMember->getId()); + ; } private function levelLocalMemberToModerator() { @@ -779,7 +777,6 @@ private function confirmCircleData( bool $versa = false, array $params = [] ) { - if (empty($params)) { $params = [ 'CIRCLEID' => $circle->getSingleId() @@ -1147,6 +1144,4 @@ private function processMemberAdd(string $instanceId, string $circleName, string return $addedMember; } - } - diff --git a/lib/Command/FixUniqueId.php b/lib/Command/FixUniqueId.php index 722d76a8c..2ea79a6fd 100644 --- a/lib/Command/FixUniqueId.php +++ b/lib/Command/FixUniqueId.php @@ -36,7 +36,6 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; - class FixUniqueId extends Base { /** @var IDBConnection */ @@ -58,7 +57,6 @@ protected function configure() { } protected function execute(InputInterface $input, OutputInterface $output) { - try { $this->swapToShortenUniqueId(); @@ -70,7 +68,6 @@ protected function execute(InputInterface $input, OutputInterface $output) { private function swapToShortenUniqueId() { - $qb = $this->connection->getQueryBuilder(); /** @noinspection PhpMethodParametersCountMismatchInspection */ @@ -109,7 +106,6 @@ private function swapToShortenUniqueId() { private function swapToShortenUniqueIdInTable($circleId, $shortenUniqueId, $table) { - $qb = $this->connection->getQueryBuilder(); $qb->update($table) ->where( @@ -140,9 +136,4 @@ private function swapToShortenUniqueIdInShares($circleId, $shortenUniqueId) { $qb->set('share_with', $qb->createNamedParameter($shortenUniqueId)); $qb->execute(); } - - } - - - diff --git a/lib/Command/Groups.php b/lib/Command/Groups.php index 27a9f9fc1..0457c9bf1 100644 --- a/lib/Command/Groups.php +++ b/lib/Command/Groups.php @@ -71,12 +71,10 @@ protected function configure() { protected function execute(InputInterface $input, OutputInterface $output) { - try { $this->listLinkedGroups($input, $output); $this->addLinkedGroups($input, $output); $this->delLinkedGroups($input, $output); - } catch (FakeException $e) { $output->writeln('done'); } catch (Exception $e) { @@ -112,7 +110,7 @@ private function addLinkedGroups(InputInterface $input, OutputInterface $output) return; } - list($circleId, $group) = $this->getCircleIdAndGroupFromArguments($input); + [$circleId, $group] = $this->getCircleIdAndGroupFromArguments($input); throw new FakeException(); } @@ -129,7 +127,7 @@ private function delLinkedGroups(InputInterface $input, OutputInterface $output) return; } - list($circleId, $group) = $this->getCircleIdAndGroupFromArguments($input); + [$circleId, $group] = $this->getCircleIdAndGroupFromArguments($input); throw new FakeException(); } @@ -148,6 +146,4 @@ private function getCircleIdAndGroupFromArguments(InputInterface $input) { return [$input->getArgument('circle_id'), $input->getArgument('group')]; } - } - diff --git a/lib/Command/MembersAdd.php b/lib/Command/MembersAdd.php index 9a360798a..b1e0faae3 100644 --- a/lib/Command/MembersAdd.php +++ b/lib/Command/MembersAdd.php @@ -51,7 +51,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class MembersAdd * @@ -186,7 +185,7 @@ private function findUserFromLookup(string $search, string &$instance = ''): str continue; } - list(, $host) = explode('@', $user['federationId']); + [, $host] = explode('@', $user['federationId']); if (strtolower($user['userid']['value']) === strtolower($search)) { $userId = $user['userid']['value']; $instance = $host; @@ -203,6 +202,4 @@ private function findUserFromLookup(string $search, string &$instance = ''): str return $userId; } - } - diff --git a/lib/Command/MembersDetails.php b/lib/Command/MembersDetails.php index 15ce4cfde..23a3451a6 100644 --- a/lib/Command/MembersDetails.php +++ b/lib/Command/MembersDetails.php @@ -56,7 +56,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class MembersDetails * @@ -142,6 +141,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/MembersLevel.php b/lib/Command/MembersLevel.php index 4d17d98b9..4a002e39c 100644 --- a/lib/Command/MembersLevel.php +++ b/lib/Command/MembersLevel.php @@ -31,10 +31,6 @@ namespace OCA\Circles\Command; - -use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; -use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; -use ArtificialOwl\MySmallPhpTools\Exceptions\SignatoryException; use OC\Core\Command\Base; use OCA\Circles\Db\MemberRequest; use OCA\Circles\Exceptions\CircleNotFoundException; @@ -63,7 +59,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class MembersLevel * @@ -173,6 +168,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/MembersList.php b/lib/Command/MembersList.php index f43b62233..31768e9c4 100644 --- a/lib/Command/MembersList.php +++ b/lib/Command/MembersList.php @@ -71,15 +71,12 @@ use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; - /** * Class MembersList * * @package OCA\Circles\Command */ class MembersList extends Base { - - use TNC22ConsoleTree; use TStringTools; @@ -212,7 +209,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->drawTree( $tree, [$this, 'displayLeaf'], [ - 'height' => 3, + 'height' => 3, 'node-spacing' => 1, 'item-spacing' => 0, ] @@ -364,9 +361,9 @@ private function getMembers( $node = new NC22TreeNode( $tree, new SimpleDataStore( [ - 'circle' => $circle, - 'member' => $member, - 'cycling' => in_array($member->getSingleId(), $knownIds), + 'circle' => $circle, + 'member' => $member, + 'cycling' => in_array($member->getSingleId(), $knownIds), ] ) ); @@ -384,8 +381,8 @@ private function getMembers( new NC22TreeNode( $tree, new SimpleDataStore( [ - 'member' => $member, - 'cycling' => in_array($member->getSingleId(), $knownIds) + 'member' => $member, + 'cycling' => in_array($member->getSingleId(), $knownIds) ] ) ); @@ -451,7 +448,6 @@ public function displayLeaf(SimpleDataStore $data, int $lineNumber): string { $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); $line .= ($type === '') ? '' : ' Config: ' . $type; } - } else { if ($lineNumber === 1 && !is_null($circle)) { $line .= '' . $circle->getSingleId() . ''; @@ -462,12 +458,9 @@ public function displayLeaf(SimpleDataStore $data, int $lineNumber): string { } return $line; - } catch (InvalidItemException | ItemNotFoundException | UnknownTypeException $e) { } return ''; } - } - diff --git a/lib/Command/MembersRemove.php b/lib/Command/MembersRemove.php index 7959e7c5e..03fe277fe 100644 --- a/lib/Command/MembersRemove.php +++ b/lib/Command/MembersRemove.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Command; -use Exception; use OC\Core\Command\Base; use OCA\Circles\Db\MemberRequest; use OCA\Circles\Exceptions\CircleNotFoundException; @@ -42,7 +41,6 @@ use OCA\Circles\Exceptions\InitiatorNotConfirmedException; use OCA\Circles\Exceptions\InitiatorNotFoundException; use OCA\Circles\Exceptions\InvalidIdException; -use OCA\Circles\Exceptions\MemberDoesNotExistException; use OCA\Circles\Exceptions\MemberNotFoundException; use OCA\Circles\Exceptions\OwnerNotFoundException; use OCA\Circles\Exceptions\RemoteInstanceException; @@ -60,7 +58,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class MembersRemove * @@ -149,6 +146,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - } - diff --git a/lib/Command/MembersSearch.php b/lib/Command/MembersSearch.php index a9739445a..2c58505bc 100644 --- a/lib/Command/MembersSearch.php +++ b/lib/Command/MembersSearch.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Command; - use OC\Core\Command\Base; use OCA\Circles\Model\FederatedUser; use OCA\Circles\Model\Member; @@ -44,7 +43,6 @@ use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; - /** * Class MembersSearch * @@ -123,6 +121,4 @@ private function displaySearchResult(array $result) { ); } } - } - diff --git a/lib/Command/SharesFiles.php b/lib/Command/SharesFiles.php index da3cdff4f..f7ffdc615 100644 --- a/lib/Command/SharesFiles.php +++ b/lib/Command/SharesFiles.php @@ -51,15 +51,12 @@ use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; - /** * Class SharesFilesList * * @package OCA\Circles\Command */ class SharesFiles extends Base { - - use TArrayTools; @@ -239,11 +236,11 @@ private function displayShares( if (!$filterRecipient) { $row = array_merge( $row, [ - $sharedTo . ' (' . $recipient->getSingleId() . ', ' - . Circle::$DEF_SOURCE[$recipient->getBasedOn()->getSource()] . ')', - (($share->getChildId() > 0) ? $share->getChildFileTarget( - ) : $share->getFileTarget()), - ] + $sharedTo . ' (' . $recipient->getSingleId() . ', ' + . Circle::$DEF_SOURCE[$recipient->getBasedOn()->getSource()] . ')', + (($share->getChildId() > 0) ? $share->getChildFileTarget( + ) : $share->getFileTarget()), + ] ); } @@ -275,7 +272,6 @@ private function getShares( bool $all, ?bool &$filterRecipient = false ): array { - if ($fileId > 0) { return $this->shareWrapperService->getSharesByFileId($this->fileId, true); } @@ -319,6 +315,4 @@ private function getShares( 'Specify a FileId or an option: --with (USER), --by (USER), --to (CIRCLE)' ); } - } - diff --git a/lib/Command/SyncContact.php b/lib/Command/SyncContact.php index 6cb29f3a9..90be29cbe 100644 --- a/lib/Command/SyncContact.php +++ b/lib/Command/SyncContact.php @@ -38,7 +38,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Class SyncContact * @@ -161,6 +160,4 @@ private function displayInfo(OutputInterface $output) { private function displayStatus(OutputInterface $output) { $output->writeln('not yet available'); } - } - diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 95f377f69..30aa1208f 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Controller; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use Exception; @@ -57,15 +56,12 @@ use OCP\IRequest; use OCP\IUserSession; - /** * Class AdminController * * @package OCA\Circles\Controller */ class AdminController extends OcsController { - - use TNC22Deserialize; use TNC22Logger; @@ -152,11 +148,11 @@ public function create( } catch (Exception $e) { $this->e( $e, [ - 'emulated' => $emulated, - 'name' => $name, - 'members' => $personal, - 'local' => $local - ] + 'emulated' => $emulated, + 'name' => $name, + 'members' => $personal, + 'local' => $local + ] ); throw new OcsException($e->getMessage(), $e->getCode()); } @@ -213,11 +209,11 @@ public function memberAdd(string $emulated, string $circleId, string $userId, in } catch (Exception $e) { $this->e( $e, [ - 'emulated' => $emulated, - 'circleId' => $circleId, - 'userId' => $userId, - 'type' => $type - ] + 'emulated' => $emulated, + 'circleId' => $circleId, + 'userId' => $userId, + 'type' => $type + ] ); throw new OCSException($e->getMessage(), $e->getCode()); } @@ -253,7 +249,7 @@ public function memberLevel(string $emulated, string $circleId, string $memberId 'emulated' => $emulated, 'circleId' => $circleId, 'memberId' => $memberId, - 'level' => $level + 'level' => $level ] ); throw new OcsException($e->getMessage(), $e->getCode()); @@ -532,6 +528,4 @@ private function setLocalFederatedUser(string $emulated): void { $this->federatedUserService->setCurrentPatron($user->getUID()); $this->federatedUserService->setLocalCurrentUserId($emulated); } - } - diff --git a/lib/Controller/EventWrapperController.php b/lib/Controller/EventWrapperController.php index 2638e5629..fb0616364 100644 --- a/lib/Controller/EventWrapperController.php +++ b/lib/Controller/EventWrapperController.php @@ -1,4 +1,6 @@ -fail(['data' => $data, 'error' => $e->getMessage()]); // } // } - } - diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index 1bba8d825..ff4873aaf 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Controller; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use Exception; @@ -55,15 +54,12 @@ use OCP\IRequest; use OCP\IUserSession; - /** * Class LocalController * * @package OCA\Circles\Controller */ class LocalController extends OcsController { - - use TNC22Deserialize; use TNC22Logger; @@ -278,7 +274,6 @@ public function membersAdd(string $circleId, array $members): DataResponse { $this->e($e, ['circleId' => $circleId, 'members' => $members]); throw new OCSException($e->getMessage(), $e->getCode()); } - } @@ -576,6 +571,4 @@ private function setCurrentFederatedUser() { $user = $this->userSession->getUser(); $this->federatedUserService->setLocalCurrentUser($user); } - } - diff --git a/lib/Controller/RemoteController.php b/lib/Controller/RemoteController.php index 9bc40110c..ee863907e 100644 --- a/lib/Controller/RemoteController.php +++ b/lib/Controller/RemoteController.php @@ -67,15 +67,12 @@ use OCP\AppFramework\Http\DataResponse; use OCP\IRequest; - /** * Class RemoteController * * @package OCA\Circles\Controller */ class RemoteController extends Controller { - - use TNC22Controller; use TNC22LocalSignatory; use TNC22Deserialize; @@ -339,9 +336,9 @@ public function member(string $type, string $userId): DataResponse { // FILTER CIRCLE BASED ON THE CONFIG/FEDERATED_8192 !! if ($type === Member::$TYPE[Member::TYPE_SINGLE]) { $federatedUser = $this->federatedUserService->getFederatedUser($userId, Member::TYPE_SINGLE); - } else if ($type === Member::$TYPE[Member::TYPE_CIRCLE]) { + } elseif ($type === Member::$TYPE[Member::TYPE_CIRCLE]) { $federatedUser = $this->federatedUserService->getFederatedUser($userId, Member::TYPE_CIRCLE); - } else if ($type === Member::$TYPE[Member::TYPE_USER]) { + } elseif ($type === Member::$TYPE[Member::TYPE_USER]) { $federatedUser = $this->federatedUserService->getLocalFederatedUser($userId); } else { throw new FederatedUserNotFoundException('Entity not found'); @@ -471,11 +468,9 @@ public function exceptionResponse( return new DataResponse( [ 'message' => $e->getMessage(), - 'code' => $e->getCode() + 'code' => $e->getCode() ], ($e->getCode() > 0) ? $e->getCode() : $httpErrorCode ); } - } - diff --git a/lib/Cron/ContactsExistingShares.php b/lib/Cron/ContactsExistingShares.php index 81422a57e..7362cf171 100644 --- a/lib/Cron/ContactsExistingShares.php +++ b/lib/Cron/ContactsExistingShares.php @@ -1,4 +1,6 @@ -synchronize($circles); } - } - diff --git a/lib/Cron/Maintenance.php b/lib/Cron/Maintenance.php index 3744f93cd..98588df40 100644 --- a/lib/Cron/Maintenance.php +++ b/lib/Cron/Maintenance.php @@ -1,4 +1,6 @@ - 60, // every minute 2 => 300, // every 5 minutes @@ -141,6 +141,4 @@ private function canRunLevel(int $level, SimpleDataStore $last): bool { return ($timeLastRun + self::$DELAY[$level] < $now); } - } - diff --git a/lib/Db/AccountsRequest.php b/lib/Db/AccountsRequest.php index 1e362e465..8044af5f5 100644 --- a/lib/Db/AccountsRequest.php +++ b/lib/Db/AccountsRequest.php @@ -27,13 +27,10 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\Exceptions\MemberDoesNotExistException; class AccountsRequest extends AccountsRequestBuilder { - - use TStringTools; @@ -76,5 +73,4 @@ public function getAll(): array { return $accounts; } - } diff --git a/lib/Db/AccountsRequestBuilder.php b/lib/Db/AccountsRequestBuilder.php index 049dc45d8..e6b5d386c 100644 --- a/lib/Db/AccountsRequestBuilder.php +++ b/lib/Db/AccountsRequestBuilder.php @@ -28,19 +28,15 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use OCP\DB\QueryBuilder\IQueryBuilder; - /** * Class AccountsRequestBuilder * * @package OCA\Circles\Db */ class AccountsRequestBuilder extends DeprecatedRequestBuilder { - - use TArrayTools; @@ -111,10 +107,8 @@ protected function parseAccountsSelectSql(array $entry): array { } return [ - 'userId' => $entry['uid'], + 'userId' => $entry['uid'], 'displayName' => $this->get('displayname.value', $data) ]; } - } - diff --git a/lib/Db/CircleProviderRequest.php b/lib/Db/CircleProviderRequest.php index 1e64d5985..209d321da 100644 --- a/lib/Db/CircleProviderRequest.php +++ b/lib/Db/CircleProviderRequest.php @@ -27,7 +27,6 @@ namespace OCA\Circles\Db; - use OCA\Circles\Exceptions\GSStatusException; /** @@ -49,7 +48,6 @@ class CircleProviderRequest extends CircleProviderRequestBuilder { * @throws GSStatusException */ public function getFilesForCircles($userId, $circleUniqueIds, $limit, $offset) { - $qb = $this->getCompleteSelectSql(); $this->linkToFileCache($qb, $userId); $this->limitToPage($qb, $limit, $offset); @@ -102,5 +100,4 @@ protected static function editShareFromParentEntry(&$data) { $data['file_target'] = $data['parent_target']; } } - } diff --git a/lib/Db/CircleProviderRequestBuilder.php b/lib/Db/CircleProviderRequestBuilder.php index bb5505fe4..b401151f2 100644 --- a/lib/Db/CircleProviderRequestBuilder.php +++ b/lib/Db/CircleProviderRequestBuilder.php @@ -30,7 +30,6 @@ namespace OCA\Circles\Db; - use Doctrine\DBAL\Query\QueryBuilder; use OC; use OCA\Circles\Model\DeprecatedMember; @@ -57,7 +56,6 @@ class CircleProviderRequestBuilder extends DeprecatedRequestBuilder { * @return IQueryBuilder */ protected function findShareParentSql($fileId, $circleId) { - $qb = $this->getBaseSelectSql(); $this->limitToShareParent($qb); $this->limitToCircles($qb, [$circleId]); @@ -74,9 +72,8 @@ protected function findShareParentSql($fileId, $circleId) { * @param array $circleUniqueIds */ protected function limitToCircles(IQueryBuilder $qb, $circleUniqueIds) { - if (!is_array($circleUniqueIds)) { - $circleUniqueIds = array($circleUniqueIds); + $circleUniqueIds = [$circleUniqueIds]; } $expr = $qb->expr(); @@ -162,9 +159,8 @@ protected function limitToShareAndChildren(IQueryBuilder $qb, $circleId) { * @param $files */ protected function limitToFiles(IQueryBuilder $qb, $files) { - if (!is_array($files)) { - $files = array($files); + $files = [$files]; } $expr = $qb->expr(); @@ -327,7 +323,6 @@ private function exprLinkToMemberAsCircleMember( private function exprLinkToMemberAsGroupMember( IQueryBuilder $qb, string $userId, string $aliasM, string $aliasC ) { - $expr = $qb->expr(); $qb->leftJoin( $aliasM, self::NC_TABLE_GROUP_USER, 'ncgu', @@ -386,7 +381,6 @@ protected function linkToFileCache(IQueryBuilder $qb, $userId) { $qb->selectAlias('s2.id', 'parent_id'); $qb->selectAlias('s2.file_target', 'parent_target'); $qb->selectAlias('s2.permissions', 'parent_perms'); - } diff --git a/lib/Db/CircleRequest.php b/lib/Db/CircleRequest.php index 2b5bce4c3..3b908f530 100644 --- a/lib/Db/CircleRequest.php +++ b/lib/Db/CircleRequest.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Exceptions\FederatedUserNotFoundException; @@ -45,7 +44,6 @@ use OCA\Circles\Model\FederatedUser; use OCA\Circles\Model\Member; - /** * Class CircleRequest * @@ -174,8 +172,8 @@ public function getCircles( $qb->setOptions( [CoreQueryBuilder::CIRCLE], [ - 'getData' => true, - 'mustBeMember' => $params->gBool('mustBeMember'), + 'getData' => true, + 'mustBeMember' => $params->gBool('mustBeMember'), 'initiatorDirectMember' => true ] ); @@ -243,8 +241,8 @@ public function getCircle( $qb->setOptions( [CoreQueryBuilder::CIRCLE], [ - 'getData' => true, - 'canBeVisitor' => true, + 'getData' => true, + 'canBeVisitor' => true, 'initiatorDirectMember' => true ] ); @@ -404,6 +402,4 @@ public function deleteFederatedUser(IFederatedUser $federatedUser): void { $qb->execute(); } - } - diff --git a/lib/Db/CircleRequestBuilder.php b/lib/Db/CircleRequestBuilder.php index cff58cb3c..d0cb5f588 100644 --- a/lib/Db/CircleRequestBuilder.php +++ b/lib/Db/CircleRequestBuilder.php @@ -31,12 +31,10 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OCA\Circles\Exceptions\CircleNotFoundException; use OCA\Circles\Model\Circle; - /** * Class CircleRequestBuilder * @@ -122,5 +120,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb): array { /** @var Circle[] $result */ return $qb->asItems(Circle::class); } - } diff --git a/lib/Db/CoreQueryBuilder.php b/lib/Db/CoreQueryBuilder.php index b9ae6d7d5..68596e881 100644 --- a/lib/Db/CoreQueryBuilder.php +++ b/lib/Db/CoreQueryBuilder.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Db\Nextcloud\nc22\NC22ExtendedQueryBuilder; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use Doctrine\DBAL\Query\QueryBuilder; @@ -47,90 +46,87 @@ use OCP\DB\QueryBuilder\ICompositeExpression; use OCP\DB\QueryBuilder\IQueryBuilder; - /** * Class CoreQueryBuilder * * @package OCA\Circles\Db */ class CoreQueryBuilder extends NC22ExtendedQueryBuilder { - - use TArrayTools; - const SINGLE = 'single'; - const CIRCLE = 'circle'; - const MEMBER = 'member'; - const MEMBER_COUNT = 'membercount'; - const OWNER = 'owner'; - const FEDERATED_EVENT = 'federatedevent'; - const REMOTE = 'remote'; - const BASED_ON = 'basedon'; - const INITIATOR = 'initiator'; - const DIRECT_INITIATOR = 'initiatordirect'; - const MEMBERSHIPS = 'memberships'; - const CONFIG = 'config'; - const UPSTREAM_MEMBERSHIPS = 'upstreammemberships'; - const INHERITANCE_FROM = 'inheritancefrom'; - const INHERITED_BY = 'inheritedby'; - const INVITED_BY = 'invitedby'; - const MOUNT = 'mount'; - const MOUNTPOINT = 'mountpoint'; - const SHARE = 'share'; - const FILE_CACHE = 'filecache'; - const STORAGES = 'storages'; - const TOKEN = 'token'; - const OPTIONS = 'options'; - const HELPER = 'circleshelper'; + public const SINGLE = 'single'; + public const CIRCLE = 'circle'; + public const MEMBER = 'member'; + public const MEMBER_COUNT = 'membercount'; + public const OWNER = 'owner'; + public const FEDERATED_EVENT = 'federatedevent'; + public const REMOTE = 'remote'; + public const BASED_ON = 'basedon'; + public const INITIATOR = 'initiator'; + public const DIRECT_INITIATOR = 'initiatordirect'; + public const MEMBERSHIPS = 'memberships'; + public const CONFIG = 'config'; + public const UPSTREAM_MEMBERSHIPS = 'upstreammemberships'; + public const INHERITANCE_FROM = 'inheritancefrom'; + public const INHERITED_BY = 'inheritedby'; + public const INVITED_BY = 'invitedby'; + public const MOUNT = 'mount'; + public const MOUNTPOINT = 'mountpoint'; + public const SHARE = 'share'; + public const FILE_CACHE = 'filecache'; + public const STORAGES = 'storages'; + public const TOKEN = 'token'; + public const OPTIONS = 'options'; + public const HELPER = 'circleshelper'; public static $SQL_PATH = [ - self::SINGLE => [ + self::SINGLE => [ self::MEMBER ], - self::CIRCLE => [ - self::OPTIONS => [ + self::CIRCLE => [ + self::OPTIONS => [ ], self::MEMBER, self::MEMBER_COUNT, - self::OWNER => [ + self::OWNER => [ self::BASED_ON ], - self::MEMBERSHIPS => [ + self::MEMBERSHIPS => [ self::CONFIG ], self::DIRECT_INITIATOR => [ self::BASED_ON ], - self::INITIATOR => [ + self::INITIATOR => [ self::BASED_ON, self::INHERITED_BY => [ self::MEMBERSHIPS ] ], - self::REMOTE => [ + self::REMOTE => [ self::MEMBER, self::CIRCLE => [ self::OWNER ] ] ], - self::MEMBER => [ + self::MEMBER => [ self::MEMBERSHIPS => [ self::CONFIG ], self::INHERITANCE_FROM, - self::CIRCLE => [ - self::OPTIONS => [ + self::CIRCLE => [ + self::OPTIONS => [ 'getData' => true ], self::OWNER, self::MEMBERSHIPS => [ self::CONFIG ], - self::INITIATOR => [ - self::OPTIONS => [ + self::INITIATOR => [ + self::OPTIONS => [ 'mustBeMember' => true, 'canBeVisitor' => false ], @@ -138,13 +134,13 @@ class CoreQueryBuilder extends NC22ExtendedQueryBuilder { self::INHERITED_BY => [ self::MEMBERSHIPS ], - self::INVITED_BY => [ + self::INVITED_BY => [ self::OWNER, self::BASED_ON ] ] ], - self::BASED_ON => [ + self::BASED_ON => [ self::OWNER, self::MEMBERSHIPS, self::INITIATOR => [ @@ -154,13 +150,13 @@ class CoreQueryBuilder extends NC22ExtendedQueryBuilder { ] ] ], - self::REMOTE => [ + self::REMOTE => [ self::MEMBER, self::CIRCLE => [ self::OWNER ] ], - self::INVITED_BY => [ + self::INVITED_BY => [ self::OWNER, self::BASED_ON ] @@ -168,10 +164,10 @@ class CoreQueryBuilder extends NC22ExtendedQueryBuilder { self::MEMBERSHIPS => [ self::CONFIG ], - self::SHARE => [ + self::SHARE => [ self::SHARE, self::TOKEN, - self::FILE_CACHE => [ + self::FILE_CACHE => [ self::STORAGES ], self::UPSTREAM_MEMBERSHIPS => [ @@ -181,31 +177,31 @@ class CoreQueryBuilder extends NC22ExtendedQueryBuilder { ], self::SHARE, ], - self::MEMBERSHIPS => [ + self::MEMBERSHIPS => [ self::CONFIG ], self::INHERITANCE_FROM, - self::INHERITED_BY => [ + self::INHERITED_BY => [ self::BASED_ON ], - self::CIRCLE => [ + self::CIRCLE => [ self::OWNER ], - self::INITIATOR => [ + self::INITIATOR => [ self::BASED_ON, self::INHERITED_BY => [ self::MEMBERSHIPS ] ] ], - self::REMOTE => [ + self::REMOTE => [ self::MEMBER ], - self::MOUNT => [ - self::MEMBER => [ + self::MOUNT => [ + self::MEMBER => [ self::REMOTE ], - self::INITIATOR => [ + self::INITIATOR => [ self::INHERITED_BY => [ self::MEMBERSHIPS ] @@ -215,20 +211,20 @@ class CoreQueryBuilder extends NC22ExtendedQueryBuilder { self::CONFIG ] ], - self::HELPER => [ + self::HELPER => [ self::MEMBERSHIPS => [ self::CONFIG ], - self::INITIATOR => [ + self::INITIATOR => [ self::INHERITED_BY => [ self::MEMBERSHIPS ] ], - self::CIRCLE => [ + self::CIRCLE => [ self::OPTIONS => [ ], self::MEMBER, - self::OWNER => [ + self::OWNER => [ self::BASED_ON ] ] @@ -437,7 +433,6 @@ public function limitToRemoteInstance( bool $filterSensitiveData = true, string $aliasCircle = '' ): void { - if ($aliasCircle === '') { $aliasCircle = $alias; } @@ -1215,11 +1210,11 @@ public function leftJoinInitiator( $default = []; if ($this->getBool('canBeVisitor', $options, false)) { $default = [ - 'user_id' => $initiator->getUserId(), - 'single_id' => $initiator->getSingleId(), - 'user_type' => $initiator->getUserType(), + 'user_id' => $initiator->getUserId(), + 'single_id' => $initiator->getSingleId(), + 'user_type' => $initiator->getUserType(), 'cached_name' => $initiator->getDisplayName(), - 'instance' => $initiator->getInstance() + 'instance' => $initiator->getInstance() ]; } $aliasInheritedByMembership = $this->generateAlias($aliasInheritedBy, self::MEMBERSHIPS); @@ -1649,6 +1644,4 @@ private function orXCheckLevel(array $aliases, int $level): ICompositeExpression return $orX; } - } - diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php index 173e77cc5..41a5cea71 100644 --- a/lib/Db/CoreRequestBuilder.php +++ b/lib/Db/CoreRequestBuilder.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Db; - use Exception; use OC\DB\Connection; use OC\DB\SchemaWrapper; @@ -40,40 +39,37 @@ use OCA\Circles\Service\TimezoneService; use OCP\Share\IShare; - /** * Class CoreQueryBuilder * * @package OCA\Circles\Db */ class CoreRequestBuilder { - - - const TABLE_SHARE = 'share'; - const TABLE_FILE_CACHE = 'filecache'; - const TABLE_STORAGES = 'storages'; - - const TABLE_CIRCLE = 'circles_circle'; - const TABLE_MEMBER = 'circles_member'; - const TABLE_MEMBERSHIP = 'circles_membership'; - const TABLE_REMOTE = 'circles_remote'; - const TABLE_EVENT = 'circles_event'; - const TABLE_MOUNT = 'circles_mount'; - const TABLE_MOUNTPOINT = 'circles_mountpoint'; + public const TABLE_SHARE = 'share'; + public const TABLE_FILE_CACHE = 'filecache'; + public const TABLE_STORAGES = 'storages'; + + public const TABLE_CIRCLE = 'circles_circle'; + public const TABLE_MEMBER = 'circles_member'; + public const TABLE_MEMBERSHIP = 'circles_membership'; + public const TABLE_REMOTE = 'circles_remote'; + public const TABLE_EVENT = 'circles_event'; + public const TABLE_MOUNT = 'circles_mount'; + public const TABLE_MOUNTPOINT = 'circles_mountpoint'; // wip - const TABLE_SHARE_LOCK = 'circles_share_lock'; - const TABLE_TOKEN = 'circles_token'; + public const TABLE_SHARE_LOCK = 'circles_share_lock'; + public const TABLE_TOKEN = 'circles_token'; - const TABLE_GSSHARES = 'circle_gsshares'; // rename ? - const TABLE_GSSHARES_MOUNTPOINT = 'circle_gsshares_mp'; // rename ? + public const TABLE_GSSHARES = 'circle_gsshares'; // rename ? + public const TABLE_GSSHARES_MOUNTPOINT = 'circle_gsshares_mp'; // rename ? - const NC_TABLE_ACCOUNTS = 'accounts'; - const NC_TABLE_GROUP_USER = 'group_user'; + public const NC_TABLE_ACCOUNTS = 'accounts'; + public const NC_TABLE_GROUP_USER = 'group_user'; /** @var array */ - static $tables = [ - self::TABLE_CIRCLE => [ + public static $tables = [ + self::TABLE_CIRCLE => [ 'unique_id', 'name', 'display_name', @@ -86,7 +82,7 @@ class CoreRequestBuilder { 'contact_groupname', 'creation' ], - self::TABLE_MEMBER => [ + self::TABLE_MEMBER => [ 'circle_id', 'member_id', 'single_id', @@ -102,7 +98,7 @@ class CoreRequestBuilder { 'contact_meta', 'joined' ], - self::TABLE_MEMBERSHIP => [ + self::TABLE_MEMBERSHIP => [ 'single_id', 'circle_id', 'level', @@ -111,7 +107,7 @@ class CoreRequestBuilder { 'inheritance_path', 'inheritance_depth' ], - self::TABLE_REMOTE => [ + self::TABLE_REMOTE => [ 'id', 'type', 'interface', @@ -121,7 +117,7 @@ class CoreRequestBuilder { 'item', 'creation' ], - self::TABLE_EVENT => [ + self::TABLE_EVENT => [ 'token', 'event', 'result', @@ -132,7 +128,7 @@ class CoreRequestBuilder { 'status', 'creation' ], - self::TABLE_MOUNT => [ + self::TABLE_MOUNT => [ 'id', 'mount_id', 'circle_id', @@ -142,9 +138,9 @@ class CoreRequestBuilder { 'mountpoint', 'mountpoint_hash' ], - self::TABLE_MOUNTPOINT => [], - self::TABLE_SHARE_LOCK => [], - self::TABLE_TOKEN => [ + self::TABLE_MOUNTPOINT => [], + self::TABLE_SHARE_LOCK => [], + self::TABLE_TOKEN => [ 'id', 'share_id', 'circle_id', @@ -154,13 +150,13 @@ class CoreRequestBuilder { 'password', 'accepted' ], - self::TABLE_GSSHARES => [], + self::TABLE_GSSHARES => [], self::TABLE_GSSHARES_MOUNTPOINT => [] ]; - static $outsideTables = [ - self::TABLE_SHARE => [ + public static $outsideTables = [ + self::TABLE_SHARE => [ 'id', 'share_type', 'share_with', @@ -197,7 +193,7 @@ class CoreRequestBuilder { 'etag', 'checksum' ], - self::TABLE_STORAGES => [ + self::TABLE_STORAGES => [ 'id' ] ]; @@ -320,6 +316,4 @@ public function uninstallFromJobs() { // $qb->where($this->exprLimitToDBField($qb, 'class', 'OCA\Circles\', true, true)); // $qb->execute(); } - } - diff --git a/lib/Db/DeprecatedCirclesRequest.php b/lib/Db/DeprecatedCirclesRequest.php index e54b3c213..67cee5060 100644 --- a/lib/Db/DeprecatedCirclesRequest.php +++ b/lib/Db/DeprecatedCirclesRequest.php @@ -1,4 +1,6 @@ -getCirclesSelectSql(); $this->limitToName($qb, $name); @@ -236,7 +236,6 @@ public function getCircle( * @param DeprecatedCircle $circle */ public function createCircle(DeprecatedCircle $circle) { - $config = DeprecatedCircle::convertTypeToConfig($circle->getType()); $qb = $this->getCirclesInsertSql(); @@ -437,5 +436,4 @@ public function getFromContactGroup(int $addressBookId, string $group): Deprecat return $this->parseCirclesSelectSql($data); } - } diff --git a/lib/Db/DeprecatedCirclesRequestBuilder.php b/lib/Db/DeprecatedCirclesRequestBuilder.php index cd26900ec..1636ab795 100644 --- a/lib/Db/DeprecatedCirclesRequestBuilder.php +++ b/lib/Db/DeprecatedCirclesRequestBuilder.php @@ -27,7 +27,6 @@ namespace OCA\Circles\Db; - use Doctrine\DBAL\Query\QueryBuilder; use OCA\Circles\Exceptions\ConfigNoCircleAvailableException; use OCA\Circles\Model\DeprecatedCircle; @@ -275,7 +274,6 @@ public function leftJoinUserIdAsViewer(IQueryBuilder $qb, string $userId, int $t * @param string $ownerId */ public function leftJoinOwner(IQueryBuilder $qb, string $ownerId = '') { - if ($qb->getType() !== QueryBuilder::SELECT) { return; } @@ -385,7 +383,6 @@ protected function getCirclesSelectSql() { * @return DeprecatedCircle */ protected function parseCirclesSelectSql($data, bool $allSettings = false) { - $circle = new DeprecatedCircle(); $circle->setId($data['id']); $circle->setUniqueId($data['unique_id']); @@ -425,6 +422,4 @@ protected function parseCirclesSelectSql($data, bool $allSettings = false) { return $circle; } - - } diff --git a/lib/Db/DeprecatedMembersRequest.php b/lib/Db/DeprecatedMembersRequest.php index a48e98b95..c452bf46b 100644 --- a/lib/Db/DeprecatedMembersRequest.php +++ b/lib/Db/DeprecatedMembersRequest.php @@ -27,7 +27,6 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use Exception; @@ -38,8 +37,6 @@ use OCP\IGroup; class DeprecatedMembersRequest extends DeprecatedMembersRequestBuilder { - - use TStringTools; @@ -159,7 +156,6 @@ public function forceGetMembers( * @return DeprecatedMember[] */ public function forceGetAllMembers() { - $qb = $this->getMembersSelectSql(); $members = []; @@ -231,7 +227,7 @@ public function getMembers(string $circleUniqueId, ?DeprecatedMember $viewer, bo if ($force === false) { if (!$viewer->isLevel(DeprecatedMember::LEVEL_MODERATOR)) { array_map( - function(DeprecatedMember $m) { + function (DeprecatedMember $m) { $m->setNote(''); }, $members ); @@ -309,7 +305,7 @@ public function avoidDuplicateMembers(array &$members, array $groupMembers) { $index = $this->indexOfMember($members, $member->getUserId()); if ($index === -1) { array_push($members, $member); - } else if ($members[$index]->getLevel() < $member->getLevel()) { + } elseif ($members[$index]->getLevel() < $member->getLevel()) { $members[$index] = $member; } } @@ -325,7 +321,6 @@ public function avoidDuplicateMembers(array &$members, array $groupMembers) { * @return int */ private function indexOfMember(array $members, $userId) { - foreach ($members as $k => $member) { if ($member->getUserId() === $userId) { return intval($k); @@ -348,7 +343,6 @@ private function indexOfMember(array $members, $userId) { * @return DeprecatedMember */ public function getFreshNewMember($circleUniqueId, string $name, int $type, string $instance) { - try { $member = $this->forceGetMember($circleUniqueId, $name, $type, $instance); } catch (MemberDoesNotExistException $e) { @@ -473,7 +467,6 @@ public function forceGetHigherLevelGroupFromUser($circleUniqueId, $userId) { * @throws MemberAlreadyExistsException */ public function createMember(DeprecatedMember $member) { - if ($member->getMemberId() === '') { $member->setMemberId($this->token(14)); } @@ -785,6 +778,4 @@ public function removeMembersByContactId(string $contactId, int $type = 0) { $qb->execute(); } - - } diff --git a/lib/Db/DeprecatedMembersRequestBuilder.php b/lib/Db/DeprecatedMembersRequestBuilder.php index d52637add..561e3bd3b 100644 --- a/lib/Db/DeprecatedMembersRequestBuilder.php +++ b/lib/Db/DeprecatedMembersRequestBuilder.php @@ -28,7 +28,6 @@ namespace OCA\Circles\Db; - use OCA\Circles\Model\DeprecatedMember; use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\MiscService; @@ -188,5 +187,4 @@ protected function parseGroupsSelectSql(array $data) { return $member; } - } diff --git a/lib/Db/DeprecatedRequestBuilder.php b/lib/Db/DeprecatedRequestBuilder.php index c85aea044..54a9a178c 100644 --- a/lib/Db/DeprecatedRequestBuilder.php +++ b/lib/Db/DeprecatedRequestBuilder.php @@ -8,7 +8,6 @@ namespace OCA\Circles\Db; - use Doctrine\DBAL\Query\QueryBuilder; use OCA\Circles\Exceptions\GSStatusException; use OCA\Circles\Model\DeprecatedMember; @@ -20,23 +19,22 @@ use OCP\IL10N; class DeprecatedRequestBuilder { - - const TABLE_FILE_SHARES = 'share'; - const SHARE_TYPE = 7; - - const TABLE_CIRCLES = 'circle_circles'; - const TABLE_MEMBERS = 'circle_members'; - const TABLE_GROUPS = 'circle_groups'; - const TABLE_SHARES = 'circle_shares'; - const TABLE_LINKS = 'circle_links'; - const TABLE_TOKENS = 'circle_tokens'; - const TABLE_GSEVENTS = 'circle_gsevents'; - const TABLE_GSSHARES = 'circle_gsshares'; - const TABLE_GSSHARES_MOUNTPOINT = 'circle_gsshares_mp'; - const TABLE_REMOTE = 'circle_remotes'; - - const NC_TABLE_ACCOUNTS = 'accounts'; - const NC_TABLE_GROUP_USER = 'group_user'; + public const TABLE_FILE_SHARES = 'share'; + public const SHARE_TYPE = 7; + + public const TABLE_CIRCLES = 'circle_circles'; + public const TABLE_MEMBERS = 'circle_members'; + public const TABLE_GROUPS = 'circle_groups'; + public const TABLE_SHARES = 'circle_shares'; + public const TABLE_LINKS = 'circle_links'; + public const TABLE_TOKENS = 'circle_tokens'; + public const TABLE_GSEVENTS = 'circle_gsevents'; + public const TABLE_GSSHARES = 'circle_gsshares'; + public const TABLE_GSSHARES_MOUNTPOINT = 'circle_gsshares_mp'; + public const TABLE_REMOTE = 'circle_remotes'; + + public const NC_TABLE_ACCOUNTS = 'accounts'; + public const NC_TABLE_GROUP_USER = 'group_user'; /** @var array */ private $tables = [ @@ -512,8 +510,4 @@ protected function leftJoinNCGroupAndUser(IQueryBuilder $qb, $userId, $field) { $this->leftJoinedNCGroupAndUser = true; } - } - - - diff --git a/lib/Db/EventWrapperRequest.php b/lib/Db/EventWrapperRequest.php index ef9cc3f7b..c1d92789f 100644 --- a/lib/Db/EventWrapperRequest.php +++ b/lib/Db/EventWrapperRequest.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Db; - use OCA\Circles\Model\Federated\EventWrapper; - /** * Class EventWrapperRequest * @@ -121,6 +119,4 @@ public function getByToken(string $token): array { return $this->getItemsFromRequest($qb); } - } - diff --git a/lib/Db/EventWrapperRequestBuilder.php b/lib/Db/EventWrapperRequestBuilder.php index b77a70e37..3f5c5cc98 100644 --- a/lib/Db/EventWrapperRequestBuilder.php +++ b/lib/Db/EventWrapperRequestBuilder.php @@ -31,12 +31,10 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OCA\Circles\Exceptions\EventWrapperNotFoundException; use OCA\Circles\Model\Federated\EventWrapper; - /** * Class GSEventsRequestBuilder * @@ -120,6 +118,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb): array { /** @var EventWrapper[] $result */ return $qb->asItems(EventWrapper::class); } - } - diff --git a/lib/Db/FederatedLinksRequest.php b/lib/Db/FederatedLinksRequest.php index 02a2086d8..9bb94ab33 100644 --- a/lib/Db/FederatedLinksRequest.php +++ b/lib/Db/FederatedLinksRequest.php @@ -27,7 +27,6 @@ namespace OCA\Circles\Db; - use OCA\Circles\Exceptions\FederatedLinkDoesNotExistException; use OCA\Circles\Model\FederatedLink; @@ -68,7 +67,6 @@ public function create(FederatedLink $link) { * @param FederatedLink $link */ public function update(FederatedLink $link) { - if ($link->getStatus() === FederatedLink::STATUS_LINK_REMOVE) { $this->delete($link); @@ -92,7 +90,6 @@ public function update(FederatedLink $link) { * @param FederatedLink $link */ public function delete(FederatedLink $link) { - if ($link === null) { return; } @@ -225,6 +222,4 @@ public function getLinkFromId($linkUniqueId) { return $this->parseLinksSelectSql($data); } - - } diff --git a/lib/Db/FederatedLinksRequestBuilder.php b/lib/Db/FederatedLinksRequestBuilder.php index 40efcce9c..276aedf80 100644 --- a/lib/Db/FederatedLinksRequestBuilder.php +++ b/lib/Db/FederatedLinksRequestBuilder.php @@ -27,7 +27,6 @@ namespace OCA\Circles\Db; - use OCA\Circles\Model\FederatedLink; use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\MiscService; @@ -36,7 +35,6 @@ use OCP\IDBConnection; use OCP\IL10N; - /** * @deprecated * Class FederatedLinksRequestBuilder @@ -134,5 +132,4 @@ protected function parseLinksSelectSql($data) { return $link; } - } diff --git a/lib/Db/FileSharesRequest.php b/lib/Db/FileSharesRequest.php index 037647efc..23de882f1 100644 --- a/lib/Db/FileSharesRequest.php +++ b/lib/Db/FileSharesRequest.php @@ -27,10 +27,8 @@ namespace OCA\Circles\Db; - use OCA\Circles\Model\DeprecatedMember; - /** * @deprecated * Class SharesRequest @@ -117,6 +115,4 @@ public function getShares(): array { return $shares; } - } - diff --git a/lib/Db/FileSharesRequestBuilder.php b/lib/Db/FileSharesRequestBuilder.php index 61c4c48cb..163cdff5e 100644 --- a/lib/Db/FileSharesRequestBuilder.php +++ b/lib/Db/FileSharesRequestBuilder.php @@ -27,10 +27,8 @@ namespace OCA\Circles\Db; - use OCP\DB\QueryBuilder\IQueryBuilder; - /** * @deprecated * Class FileSharesRequestBuilder @@ -92,6 +90,4 @@ protected function getFileSharesUpdateSql(): IQueryBuilder { return $qb; } - - } diff --git a/lib/Db/GSSharesRequest.php b/lib/Db/GSSharesRequest.php index 8e7075081..c0054e673 100644 --- a/lib/Db/GSSharesRequest.php +++ b/lib/Db/GSSharesRequest.php @@ -27,7 +27,6 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\Model\GlobalScale\GSShare; use OCA\Circles\Model\GlobalScale\GSShareMountpoint; @@ -35,7 +34,6 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Share\Exceptions\ShareNotFound; - /** * @deprecated * Class GSSharesRequest @@ -43,8 +41,6 @@ * @package OCA\Circles\Db */ class GSSharesRequest extends GSSharesRequestBuilder { - - use TStringTools; @@ -219,8 +215,4 @@ public function updateShareMountPoint(GSShareMountpoint $mountpoint) { return ($nb === 1); } - - - } - diff --git a/lib/Db/GSSharesRequestBuilder.php b/lib/Db/GSSharesRequestBuilder.php index f816bf8eb..625832fe2 100644 --- a/lib/Db/GSSharesRequestBuilder.php +++ b/lib/Db/GSSharesRequestBuilder.php @@ -28,14 +28,12 @@ namespace OCA\Circles\Db; - use OCA\Circles\Model\GlobalScale\GSShare; use OCA\Circles\Model\GlobalScale\GSShareMountpoint; use OCP\DB\QueryBuilder\IQueryBuilder; - /** * @deprecated - + * * Class GSSharesRequestBuilder * * @package OCA\Circles\Db @@ -180,5 +178,4 @@ protected function parseGSSharesMountpointSelectSql($data): GSShareMountpoint { return $share; } - } diff --git a/lib/Db/MemberRequest.php b/lib/Db/MemberRequest.php index 612d55057..9051ef9c9 100644 --- a/lib/Db/MemberRequest.php +++ b/lib/Db/MemberRequest.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Db; - use OCA\Circles\Exceptions\InvalidIdException; use OCA\Circles\Exceptions\MemberNotFoundException; use OCA\Circles\Exceptions\RequestBuilderException; @@ -41,7 +40,6 @@ use OCA\Circles\Model\FederatedUser; use OCA\Circles\Model\Member; - /** * Class MemberRequest * @@ -328,7 +326,7 @@ public function getMemberInstances(string $circleId): array { $qb->andwhere($qb->expr()->nonEmptyString(CoreQueryBuilder::MEMBER . '.instance')); return array_map( - function(Member $member): string { + function (Member $member): string { return $member->getInstance(); }, $this->getItemsFromRequest($qb) ); @@ -406,6 +404,4 @@ public function getAlternateSingleId(IFederatedUser $federatedUser): array { return $this->getItemsFromRequest($qb); } - } - diff --git a/lib/Db/MemberRequestBuilder.php b/lib/Db/MemberRequestBuilder.php index d32524605..f61d610c9 100644 --- a/lib/Db/MemberRequestBuilder.php +++ b/lib/Db/MemberRequestBuilder.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OCA\Circles\Exceptions\MemberNotFoundException; use OCA\Circles\Exceptions\RequestBuilderException; @@ -39,7 +38,6 @@ use OCA\Circles\Model\FederatedUser; use OCA\Circles\Model\Member; - /** * Class MemberRequestBuilder * @@ -144,5 +142,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb, bool $asFederatedUser /** @var Member|FederatedUser[] $result */ return $qb->asItems($object); } - } diff --git a/lib/Db/MembershipRequest.php b/lib/Db/MembershipRequest.php index 1ec14b691..0d1f5ccd5 100644 --- a/lib/Db/MembershipRequest.php +++ b/lib/Db/MembershipRequest.php @@ -31,13 +31,11 @@ namespace OCA\Circles\Db; - use OCA\Circles\Exceptions\MembershipNotFoundException; use OCA\Circles\Model\FederatedUser; use OCA\Circles\Model\Membership; use OCP\DB\QueryBuilder\IQueryBuilder; - /** * Class MembershipRequest * @@ -176,6 +174,4 @@ public function deleteFederatedUser(FederatedUser $federatedUser): void { $qb->execute(); } - } - diff --git a/lib/Db/MembershipRequestBuilder.php b/lib/Db/MembershipRequestBuilder.php index 42488c2cd..1363d692e 100644 --- a/lib/Db/MembershipRequestBuilder.php +++ b/lib/Db/MembershipRequestBuilder.php @@ -31,12 +31,10 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OCA\Circles\Exceptions\MembershipNotFoundException; use OCA\Circles\Model\Membership; - /** * Class MembershipRequestBuilder * @@ -121,5 +119,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb): array { /** @var Membership[] $result */ return $qb->asItems(Membership::class); } - } diff --git a/lib/Db/MountRequest.php b/lib/Db/MountRequest.php index b34012aab..f0f064a2e 100644 --- a/lib/Db/MountRequest.php +++ b/lib/Db/MountRequest.php @@ -31,21 +31,17 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\Exceptions\RequestBuilderException; use OCA\Circles\IFederatedUser; use OCA\Circles\Model\Mount; - /** * Class GSSharesRequest * * @package OCA\Circles\Db */ class MountRequest extends MountRequestBuilder { - - use TStringTools; @@ -288,7 +284,4 @@ public function getForUser(IFederatedUser $federatedUser): array { // return ($nb === 1); // } // - - } - diff --git a/lib/Db/MountRequestBuilder.php b/lib/Db/MountRequestBuilder.php index 31faac45f..0625dbb78 100644 --- a/lib/Db/MountRequestBuilder.php +++ b/lib/Db/MountRequestBuilder.php @@ -31,12 +31,10 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OCA\Circles\Exceptions\MountNotFoundException; use OCA\Circles\Model\Mount; - /** * Class MountRequestBuilder * @@ -117,6 +115,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb): array { /** @var Mount[] $result */ return $qb->asItems(Mount::class); } - } - diff --git a/lib/Db/RemoteRequest.php b/lib/Db/RemoteRequest.php index 8a2e2683c..a6d3fd19e 100644 --- a/lib/Db/RemoteRequest.php +++ b/lib/Db/RemoteRequest.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Db; - use OCA\Circles\Exceptions\RemoteNotFoundException; use OCA\Circles\Exceptions\RemoteUidException; use OCA\Circles\Exceptions\RequestBuilderException; @@ -40,7 +39,6 @@ use OCA\Circles\Model\Member; use OCP\DB\QueryBuilder\IQueryBuilder; - /** * Class RemoteRequest * @@ -289,7 +287,4 @@ public function deleteById(RemoteInstance $remoteInstance) { $qb->limitToId($remoteInstance->getDbId()); $qb->execute(); } - - } - diff --git a/lib/Db/RemoteRequestBuilder.php b/lib/Db/RemoteRequestBuilder.php index 719742a75..d178ffcf0 100644 --- a/lib/Db/RemoteRequestBuilder.php +++ b/lib/Db/RemoteRequestBuilder.php @@ -31,12 +31,10 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OCA\Circles\Exceptions\RemoteNotFoundException; use OCA\Circles\Model\Federated\RemoteInstance; - /** * Class RemoteRequestBuilder * @@ -122,6 +120,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb): array { /** @var RemoteInstance[] $result */ return $qb->asItems(RemoteInstance::class); } - } - diff --git a/lib/Db/ShareLockRequest.php b/lib/Db/ShareLockRequest.php index 26e3e6923..d1301da56 100644 --- a/lib/Db/ShareLockRequest.php +++ b/lib/Db/ShareLockRequest.php @@ -31,12 +31,10 @@ namespace OCA\Circles\Db; - use OCA\Circles\Exceptions\FederatedShareNotFoundException; use OCA\Circles\Exceptions\InvalidIdException; use OCA\Circles\Model\Federated\FederatedShare; - /** * Class ShareRequest * @@ -79,6 +77,4 @@ public function getShare(string $itemId, string $circleId = ''): FederatedShare return $this->getItemFromRequest($qb); } - } - diff --git a/lib/Db/ShareLockRequestBuilder.php b/lib/Db/ShareLockRequestBuilder.php index 22bcb5c41..10d8ecb8e 100644 --- a/lib/Db/ShareLockRequestBuilder.php +++ b/lib/Db/ShareLockRequestBuilder.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OCA\Circles\Exceptions\FederatedShareNotFoundException; use OCA\Circles\Model\Federated\FederatedShare; @@ -117,6 +116,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb): array { /** @var FederatedShare[] $result */ return $qb->asItems(FederatedShare::class); } - - } diff --git a/lib/Db/ShareTokenRequest.php b/lib/Db/ShareTokenRequest.php index ccf3048a5..0815ecec7 100644 --- a/lib/Db/ShareTokenRequest.php +++ b/lib/Db/ShareTokenRequest.php @@ -31,11 +31,9 @@ namespace OCA\Circles\Db; - use OCA\Circles\Exceptions\ShareTokenNotFoundException; use OCA\Circles\Model\ShareToken; - /** * Class ShareTokenRequest * @@ -106,6 +104,4 @@ public function removeTokens(string $singleId, string $circleId) { $qb->execute(); } - } - diff --git a/lib/Db/ShareTokenRequestBuilder.php b/lib/Db/ShareTokenRequestBuilder.php index 38e84b327..076b2e399 100644 --- a/lib/Db/ShareTokenRequestBuilder.php +++ b/lib/Db/ShareTokenRequestBuilder.php @@ -31,12 +31,10 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OCA\Circles\Exceptions\ShareTokenNotFoundException; use OCA\Circles\Model\ShareToken; - /** * Class ShareTokenRequestBuilder * @@ -121,6 +119,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb): array { /** @var ShareToken[] $result */ return $qb->asItems(ShareToken::class); } - } - diff --git a/lib/Db/ShareWrapperRequest.php b/lib/Db/ShareWrapperRequest.php index fc6cbec21..f992dc8a5 100644 --- a/lib/Db/ShareWrapperRequest.php +++ b/lib/Db/ShareWrapperRequest.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Db; - use OCA\Circles\Exceptions\RequestBuilderException; use OCA\Circles\Exceptions\ShareWrapperNotFoundException; use OCA\Circles\Model\FederatedUser; @@ -41,7 +40,6 @@ use OCP\Share\Exceptions\IllegalIDChangeException; use OCP\Share\IShare; - /** * Class ShareWrapperRequest * @@ -452,6 +450,4 @@ public function delete(int $shareId): void { $qb->execute(); } - } - diff --git a/lib/Db/ShareWrapperRequestBuilder.php b/lib/Db/ShareWrapperRequestBuilder.php index f508baa53..ce0a4e84a 100644 --- a/lib/Db/ShareWrapperRequestBuilder.php +++ b/lib/Db/ShareWrapperRequestBuilder.php @@ -31,13 +31,11 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Exceptions\RowNotFoundException; use OC\Share20\Share; use OCA\Circles\Exceptions\ShareWrapperNotFoundException; use OCA\Circles\Model\ShareWrapper; - /** * Class ShareWrapperRequestBuilder * @@ -124,6 +122,4 @@ public function getItemsFromRequest(CoreQueryBuilder $qb): array { /** @var ShareWrapper[] $result */ return $qb->asItems(ShareWrapper::class); } - } - diff --git a/lib/Db/TokensRequest.php b/lib/Db/TokensRequest.php index a5a537a8e..12bac56e7 100644 --- a/lib/Db/TokensRequest.php +++ b/lib/Db/TokensRequest.php @@ -27,13 +27,11 @@ namespace OCA\Circles\Db; - use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use OCA\Circles\Exceptions\TokenDoesNotExistException; use OCA\Circles\Model\DeprecatedMember; use OCA\Circles\Model\SharesToken; - /** * @deprecated * Class TokensRequest @@ -179,6 +177,4 @@ public function updateSinglePassword(string $circleId, string $password) { $qb->execute(); } - } - diff --git a/lib/Db/TokensRequestBuilder.php b/lib/Db/TokensRequestBuilder.php index 65e2e595f..2c08f2d6b 100644 --- a/lib/Db/TokensRequestBuilder.php +++ b/lib/Db/TokensRequestBuilder.php @@ -28,12 +28,10 @@ namespace OCA\Circles\Db; - use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use OCA\Circles\Model\SharesToken; use OCP\DB\QueryBuilder\IQueryBuilder; - /** * @deprecated * Class TokensRequestBuilder @@ -41,8 +39,6 @@ * @package OCA\Circles\Db */ class TokensRequestBuilder extends DeprecatedRequestBuilder { - - use TArrayTools; @@ -112,5 +108,4 @@ protected function parseTokensSelectSql($data) { return $sharesToken; } - } diff --git a/lib/Events/AddingCircleMemberEvent.php b/lib/Events/AddingCircleMemberEvent.php index 1aeb05a9a..1266d66bd 100644 --- a/lib/Events/AddingCircleMemberEvent.php +++ b/lib/Events/AddingCircleMemberEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class AddingCircleMemberEvent * @@ -85,6 +83,4 @@ public function setType(int $type): self { public function getType(): int { return $this->type; } - } - diff --git a/lib/Events/CircleCreatedEvent.php b/lib/Events/CircleCreatedEvent.php index 06efe0ce6..a2c498f0f 100644 --- a/lib/Events/CircleCreatedEvent.php +++ b/lib/Events/CircleCreatedEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CircleCreatedEvent * @@ -61,6 +59,4 @@ class CircleCreatedEvent extends CircleResultGenericEvent { public function __construct(FederatedEvent $federatedEvent, array $results) { parent::__construct($federatedEvent, $results); } - } - diff --git a/lib/Events/CircleDestroyedEvent.php b/lib/Events/CircleDestroyedEvent.php index cdb6a2b84..caa3874c5 100644 --- a/lib/Events/CircleDestroyedEvent.php +++ b/lib/Events/CircleDestroyedEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CircleDestroyedEvent * @@ -60,6 +58,4 @@ class CircleDestroyedEvent extends CircleResultGenericEvent { public function __construct(FederatedEvent $federatedEvent, array $results) { parent::__construct($federatedEvent, $results); } - } - diff --git a/lib/Events/CircleEditedEvent.php b/lib/Events/CircleEditedEvent.php index bec51ec0d..f5f0fe15d 100644 --- a/lib/Events/CircleEditedEvent.php +++ b/lib/Events/CircleEditedEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CircleEditedEvent * @@ -60,6 +58,4 @@ class CircleEditedEvent extends CircleResultGenericEvent { public function __construct(FederatedEvent $federatedEvent, array $results) { parent::__construct($federatedEvent, $results); } - } - diff --git a/lib/Events/CircleGenericEvent.php b/lib/Events/CircleGenericEvent.php index a239f3d8e..c84efe71c 100644 --- a/lib/Events/CircleGenericEvent.php +++ b/lib/Events/CircleGenericEvent.php @@ -31,29 +31,25 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Circle; use OCA\Circles\Model\Federated\FederatedEvent; use OCP\EventDispatcher\Event; - /** * Class CircleMemberAddedEvent * * @package OCA\Circles\Events */ class CircleGenericEvent extends Event { - - - const INVITED = 1; - const JOINED = 2; + public const INVITED = 1; + public const JOINED = 2; /** @deprecated */ - const MULTIPLE = 3; - const REMOVED = 4; - const LEFT = 5; - const LEVEL = 6; - const NAME = 7; - const REQUESTED = 8; + public const MULTIPLE = 3; + public const REMOVED = 4; + public const LEFT = 5; + public const LEVEL = 6; + public const NAME = 7; + public const REQUESTED = 8; /** @var FederatedEvent */ @@ -89,6 +85,4 @@ public function getFederatedEvent(): FederatedEvent { public function getCircle(): Circle { return $this->circle; } - } - diff --git a/lib/Events/CircleMemberAddedEvent.php b/lib/Events/CircleMemberAddedEvent.php index 3fca9a1c9..f85b975e2 100644 --- a/lib/Events/CircleMemberAddedEvent.php +++ b/lib/Events/CircleMemberAddedEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CircleMemberAddedEvent * @@ -82,6 +80,4 @@ public function setType(int $type): self { public function getType(): int { return $this->type; } - } - diff --git a/lib/Events/CircleMemberEditedEvent.php b/lib/Events/CircleMemberEditedEvent.php index 8cfc06719..d8fbeb1b3 100644 --- a/lib/Events/CircleMemberEditedEvent.php +++ b/lib/Events/CircleMemberEditedEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CircleMemberEditedEvent * @@ -125,6 +123,4 @@ public function setNewDisplayName(string $newDisplayName): self { public function getNewDisplayName(): string { return $this->newDisplayName; } - } - diff --git a/lib/Events/CircleMemberGenericEvent.php b/lib/Events/CircleMemberGenericEvent.php index 97784605a..b6cbb70fc 100644 --- a/lib/Events/CircleMemberGenericEvent.php +++ b/lib/Events/CircleMemberGenericEvent.php @@ -31,11 +31,9 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; use OCA\Circles\Model\Member; - /** * Class CircleMemberAddedEvent * @@ -66,6 +64,4 @@ public function __construct(FederatedEvent $federatedEvent) { public function getMember(): Member { return $this->member; } - } - diff --git a/lib/Events/CircleMemberRemovedEvent.php b/lib/Events/CircleMemberRemovedEvent.php index 1744ea403..9fc74567e 100644 --- a/lib/Events/CircleMemberRemovedEvent.php +++ b/lib/Events/CircleMemberRemovedEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CircleMemberRemovedEvent * @@ -82,6 +80,4 @@ public function setType(int $type): self { public function getType(): int { return $this->type; } - } - diff --git a/lib/Events/CircleMemberRequestedEvent.php b/lib/Events/CircleMemberRequestedEvent.php index f70b47cf5..cf1ef56ce 100644 --- a/lib/Events/CircleMemberRequestedEvent.php +++ b/lib/Events/CircleMemberRequestedEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CircleMemberRequestedEvent * @@ -82,6 +80,4 @@ public function setType(int $type): self { public function getType(): int { return $this->type; } - } - diff --git a/lib/Events/CircleResultGenericEvent.php b/lib/Events/CircleResultGenericEvent.php index 7a9be296c..59ff21ae7 100644 --- a/lib/Events/CircleResultGenericEvent.php +++ b/lib/Events/CircleResultGenericEvent.php @@ -31,14 +31,12 @@ namespace OCA\Circles\Events; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use OCA\Circles\Model\Circle; use OCA\Circles\Model\Federated\FederatedEvent; use OCA\Circles\Model\Member; use OCP\EventDispatcher\Event; - /** * Class CircleResultGenericEvent * @@ -116,6 +114,4 @@ public function hasMember(): bool { public function getMember(): ?Member { return $this->member; } - } - diff --git a/lib/Events/CreatingCircleEvent.php b/lib/Events/CreatingCircleEvent.php index 7d2a1003e..86dd9d6f6 100644 --- a/lib/Events/CreatingCircleEvent.php +++ b/lib/Events/CreatingCircleEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CreatingCircleEvent * @@ -63,6 +61,4 @@ class CreatingCircleEvent extends CircleGenericEvent { public function __construct(FederatedEvent $federatedEvent) { parent::__construct($federatedEvent); } - } - diff --git a/lib/Events/DestroyingCircleEvent.php b/lib/Events/DestroyingCircleEvent.php index d096dda2f..37d3088a1 100644 --- a/lib/Events/DestroyingCircleEvent.php +++ b/lib/Events/DestroyingCircleEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class DestroyingCircleEvent * @@ -63,6 +61,4 @@ class DestroyingCircleEvent extends CircleGenericEvent { public function __construct(FederatedEvent $federatedEvent) { parent::__construct($federatedEvent); } - } - diff --git a/lib/Events/EditingCircleEvent.php b/lib/Events/EditingCircleEvent.php index 2280c0cdc..9281bdb03 100644 --- a/lib/Events/EditingCircleEvent.php +++ b/lib/Events/EditingCircleEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class EditingCircleEvent * @@ -62,6 +60,4 @@ class EditingCircleEvent extends CircleGenericEvent { public function __construct(FederatedEvent $federatedEvent) { parent::__construct($federatedEvent); } - } - diff --git a/lib/Events/EditingCircleMemberEvent.php b/lib/Events/EditingCircleMemberEvent.php index 5deb30d8f..551fb9d43 100644 --- a/lib/Events/EditingCircleMemberEvent.php +++ b/lib/Events/EditingCircleMemberEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class EditingCircleMemberEvent * @@ -130,7 +128,4 @@ public function setDisplayName(string $displayName): self { public function getDisplayName(): string { return $this->displayName; } - - } - diff --git a/lib/Events/MembershipsCreatedEvent.php b/lib/Events/MembershipsCreatedEvent.php index 213ba16b3..0150a96e2 100644 --- a/lib/Events/MembershipsCreatedEvent.php +++ b/lib/Events/MembershipsCreatedEvent.php @@ -31,11 +31,9 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Membership; use OCP\EventDispatcher\Event; - /** * Class MembershipsCreatedEvent * @@ -66,6 +64,4 @@ public function __construct(array $memberships) { public function getMemberships(): array { return $this->memberships; } - } - diff --git a/lib/Events/MembershipsEditedEvent.php b/lib/Events/MembershipsEditedEvent.php index 3993058e0..36e8eabc7 100644 --- a/lib/Events/MembershipsEditedEvent.php +++ b/lib/Events/MembershipsEditedEvent.php @@ -31,11 +31,9 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Membership; use OCP\EventDispatcher\Event; - /** * Class MembershipsEditedEvent * @@ -66,6 +64,4 @@ public function __construct(array $memberships) { public function getMemberships(): array { return $this->memberships; } - } - diff --git a/lib/Events/MembershipsRemovedEvent.php b/lib/Events/MembershipsRemovedEvent.php index aed7f5397..261f1da50 100644 --- a/lib/Events/MembershipsRemovedEvent.php +++ b/lib/Events/MembershipsRemovedEvent.php @@ -31,11 +31,9 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Membership; use OCP\EventDispatcher\Event; - /** * Class MembershipsRemovedEvent * @@ -66,6 +64,4 @@ public function __construct(array $memberships) { public function getMemberships(): array { return $this->memberships; } - } - diff --git a/lib/Events/RemovingCircleMemberEvent.php b/lib/Events/RemovingCircleMemberEvent.php index e6b273f4d..5ae5a0bda 100644 --- a/lib/Events/RemovingCircleMemberEvent.php +++ b/lib/Events/RemovingCircleMemberEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class RemovingCircleMemberEvent * @@ -85,6 +83,4 @@ public function setType(int $type): self { public function getType(): int { return $this->type; } - } - diff --git a/lib/Events/RequestingCircleMemberEvent.php b/lib/Events/RequestingCircleMemberEvent.php index 75233cb1e..27ea08527 100644 --- a/lib/Events/RequestingCircleMemberEvent.php +++ b/lib/Events/RequestingCircleMemberEvent.php @@ -31,10 +31,8 @@ namespace OCA\Circles\Events; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class RequestingCircleMemberEvent * @@ -84,6 +82,4 @@ public function setType(int $type): self { public function getType(): int { return $this->type; } - } - diff --git a/lib/Events/SharedItemsSyncRequestedEvent.php b/lib/Events/SharedItemsSyncRequestedEvent.php index 6bad951d3..4513b267a 100644 --- a/lib/Events/SharedItemsSyncRequestedEvent.php +++ b/lib/Events/SharedItemsSyncRequestedEvent.php @@ -31,13 +31,11 @@ namespace OCA\Circles\Events; - use JsonSerializable; use OCA\Circles\Model\Circle; use OCA\Circles\Model\Federated\FederatedEvent; use OCP\EventDispatcher\Event; - /** * Class CircleMemberAddedEvent * @@ -120,6 +118,4 @@ private function initArray(string $appId, string $itemType) { $this->sharedItems[$appId][$itemType] = []; } } - } - diff --git a/lib/Exceptions/ApiVersionIncompatibleException.php b/lib/Exceptions/ApiVersionIncompatibleException.php index 269663f18..3daad448f 100644 --- a/lib/Exceptions/ApiVersionIncompatibleException.php +++ b/lib/Exceptions/ApiVersionIncompatibleException.php @@ -29,6 +29,4 @@ use Exception; class ApiVersionIncompatibleException extends Exception { - } - diff --git a/lib/Exceptions/BroadcasterIsNotCompatibleException.php b/lib/Exceptions/BroadcasterIsNotCompatibleException.php index 32089610c..59e60283a 100644 --- a/lib/Exceptions/BroadcasterIsNotCompatibleException.php +++ b/lib/Exceptions/BroadcasterIsNotCompatibleException.php @@ -29,6 +29,4 @@ use Exception; class BroadcasterIsNotCompatibleException extends Exception { - } - diff --git a/lib/Exceptions/CircleAlreadyExistsException.php b/lib/Exceptions/CircleAlreadyExistsException.php index be1a0b83f..c448464ab 100644 --- a/lib/Exceptions/CircleAlreadyExistsException.php +++ b/lib/Exceptions/CircleAlreadyExistsException.php @@ -27,7 +27,4 @@ namespace OCA\Circles\Exceptions; class CircleAlreadyExistsException extends \Exception { - } - - diff --git a/lib/Exceptions/CircleDoesNotExistException.php b/lib/Exceptions/CircleDoesNotExistException.php index e3bf1dfb1..8a796ce5f 100644 --- a/lib/Exceptions/CircleDoesNotExistException.php +++ b/lib/Exceptions/CircleDoesNotExistException.php @@ -26,7 +26,6 @@ namespace OCA\Circles\Exceptions; - /** * Class CircleDoesNotExistException * @@ -34,6 +33,4 @@ * @package OCA\Circles\Exceptions */ class CircleDoesNotExistException extends \Exception { - } - diff --git a/lib/Exceptions/CircleNameFirstCharException.php b/lib/Exceptions/CircleNameFirstCharException.php index bc0be33f4..b187f0fc0 100644 --- a/lib/Exceptions/CircleNameFirstCharException.php +++ b/lib/Exceptions/CircleNameFirstCharException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class CircleNameFirstCharException extends \Exception { - } - - diff --git a/lib/Exceptions/CircleNameTooShortException.php b/lib/Exceptions/CircleNameTooShortException.php index 0187afcc9..6dbafff4b 100644 --- a/lib/Exceptions/CircleNameTooShortException.php +++ b/lib/Exceptions/CircleNameTooShortException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class CircleNameTooShortException extends FederatedItemBadRequestException { - } - - diff --git a/lib/Exceptions/CircleNotFoundException.php b/lib/Exceptions/CircleNotFoundException.php index 326cfa9a3..d2a236b00 100644 --- a/lib/Exceptions/CircleNotFoundException.php +++ b/lib/Exceptions/CircleNotFoundException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class CircleNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/CircleTypeDisabledException.php b/lib/Exceptions/CircleTypeDisabledException.php index cf2598321..3f72a413a 100644 --- a/lib/Exceptions/CircleTypeDisabledException.php +++ b/lib/Exceptions/CircleTypeDisabledException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class CircleTypeDisabledException extends \Exception { - } - - diff --git a/lib/Exceptions/CircleTypeIsEmptyException.php b/lib/Exceptions/CircleTypeIsEmptyException.php index 7ff58e271..f967a6626 100644 --- a/lib/Exceptions/CircleTypeIsEmptyException.php +++ b/lib/Exceptions/CircleTypeIsEmptyException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class CircleTypeIsEmptyException extends \Exception { - } - - diff --git a/lib/Exceptions/CircleTypeNotValidException.php b/lib/Exceptions/CircleTypeNotValidException.php index c6a9782f9..e03fdc0f7 100644 --- a/lib/Exceptions/CircleTypeNotValidException.php +++ b/lib/Exceptions/CircleTypeNotValidException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class CircleTypeNotValidException extends \Exception { - } - diff --git a/lib/Exceptions/CommandMissingArgumentException.php b/lib/Exceptions/CommandMissingArgumentException.php index 5f5a6c751..fd19d2b22 100644 --- a/lib/Exceptions/CommandMissingArgumentException.php +++ b/lib/Exceptions/CommandMissingArgumentException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class CommandMissingArgumentException extends \Exception { - } - - diff --git a/lib/Exceptions/ConfigNoCircleAvailableException.php b/lib/Exceptions/ConfigNoCircleAvailableException.php index bbe434bed..f9240101c 100644 --- a/lib/Exceptions/ConfigNoCircleAvailableException.php +++ b/lib/Exceptions/ConfigNoCircleAvailableException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class ConfigNoCircleAvailableException extends \Exception { - } - diff --git a/lib/Exceptions/ContactAddressBookNotFoundException.php b/lib/Exceptions/ContactAddressBookNotFoundException.php index d3d4c17b1..bd112212f 100644 --- a/lib/Exceptions/ContactAddressBookNotFoundException.php +++ b/lib/Exceptions/ContactAddressBookNotFoundException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class ContactAddressBookNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/ContactFormatException.php b/lib/Exceptions/ContactFormatException.php index 702e6c3ef..7198f4fa1 100644 --- a/lib/Exceptions/ContactFormatException.php +++ b/lib/Exceptions/ContactFormatException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class ContactFormatException extends FederatedItemBadRequestException { - } - - diff --git a/lib/Exceptions/ContactNotFoundException.php b/lib/Exceptions/ContactNotFoundException.php index 0e8acad5e..caeb38e1b 100644 --- a/lib/Exceptions/ContactNotFoundException.php +++ b/lib/Exceptions/ContactNotFoundException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class ContactNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/EmailAccountInvalidFormatException.php b/lib/Exceptions/EmailAccountInvalidFormatException.php index 7c506673a..327903a8b 100644 --- a/lib/Exceptions/EmailAccountInvalidFormatException.php +++ b/lib/Exceptions/EmailAccountInvalidFormatException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class EmailAccountInvalidFormatException extends \Exception { - } - diff --git a/lib/Exceptions/EventWrapperNotFoundException.php b/lib/Exceptions/EventWrapperNotFoundException.php index 620e37e18..41ee3b01a 100644 --- a/lib/Exceptions/EventWrapperNotFoundException.php +++ b/lib/Exceptions/EventWrapperNotFoundException.php @@ -32,6 +32,4 @@ namespace OCA\Circles\Exceptions; class EventWrapperNotFoundException extends \Exception { - } - diff --git a/lib/Exceptions/FakeException.php b/lib/Exceptions/FakeException.php index 50fbfbc54..cffbc09ab 100644 --- a/lib/Exceptions/FakeException.php +++ b/lib/Exceptions/FakeException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FakeException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedCircleLinkFormatException.php b/lib/Exceptions/FederatedCircleLinkFormatException.php index f98fb27bf..a336814d5 100644 --- a/lib/Exceptions/FederatedCircleLinkFormatException.php +++ b/lib/Exceptions/FederatedCircleLinkFormatException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedCircleLinkFormatException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedCircleNotAllowedException.php b/lib/Exceptions/FederatedCircleNotAllowedException.php index 7fc2971a4..23ce36850 100644 --- a/lib/Exceptions/FederatedCircleNotAllowedException.php +++ b/lib/Exceptions/FederatedCircleNotAllowedException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedCircleNotAllowedException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedCircleStatusUpdateException.php b/lib/Exceptions/FederatedCircleStatusUpdateException.php index b4f5deee1..5cea03288 100644 --- a/lib/Exceptions/FederatedCircleStatusUpdateException.php +++ b/lib/Exceptions/FederatedCircleStatusUpdateException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedCircleStatusUpdateException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedEventDSyncException.php b/lib/Exceptions/FederatedEventDSyncException.php index 3a1b2bf3c..9e3044478 100644 --- a/lib/Exceptions/FederatedEventDSyncException.php +++ b/lib/Exceptions/FederatedEventDSyncException.php @@ -28,15 +28,10 @@ namespace OCA\Circles\Exceptions; -use Exception; - - /** * Class FederatedEventDSyncException * * @package OCA\Circles\Exceptions */ class FederatedEventDSyncException extends FederatedItemConflictException { - } - diff --git a/lib/Exceptions/FederatedEventException.php b/lib/Exceptions/FederatedEventException.php index eba9eac6c..9763f8c4b 100644 --- a/lib/Exceptions/FederatedEventException.php +++ b/lib/Exceptions/FederatedEventException.php @@ -37,6 +37,4 @@ * @package OCA\Circles\Exceptions */ class FederatedEventException extends FederatedItemServerException { - } - diff --git a/lib/Exceptions/FederatedItemBadRequestException.php b/lib/Exceptions/FederatedItemBadRequestException.php index 1b7d0ab37..7832ccc98 100644 --- a/lib/Exceptions/FederatedItemBadRequestException.php +++ b/lib/Exceptions/FederatedItemBadRequestException.php @@ -30,20 +30,16 @@ namespace OCA\Circles\Exceptions; - use OCP\AppFramework\Http; use Throwable; - /** * Class FederatedItemBadRequestException * * @package OCA\Circles\Exceptions */ class FederatedItemBadRequestException extends FederatedItemException { - - - const STATUS = Http::STATUS_BAD_REQUEST; + public const STATUS = Http::STATUS_BAD_REQUEST; /** @@ -61,6 +57,4 @@ public function __construct( parent::__construct($message, ($code > 0) ? $code : self::STATUS, $previous); $this->setStatus(self::STATUS); } - } - diff --git a/lib/Exceptions/FederatedItemConflictException.php b/lib/Exceptions/FederatedItemConflictException.php index ed2b0e68d..5e2f43be1 100644 --- a/lib/Exceptions/FederatedItemConflictException.php +++ b/lib/Exceptions/FederatedItemConflictException.php @@ -30,20 +30,16 @@ namespace OCA\Circles\Exceptions; - use OCP\AppFramework\Http; use Throwable; - /** * Class FederatedItemConflictException * * @package OCA\Circles\Exceptions */ class FederatedItemConflictException extends FederatedItemException { - - - const STATUS = Http::STATUS_CONFLICT; + public const STATUS = Http::STATUS_CONFLICT; /** @@ -61,6 +57,4 @@ public function __construct( parent::__construct($message, ($code > 0) ? $code : self::STATUS, $previous); $this->setStatus(self::STATUS); } - } - diff --git a/lib/Exceptions/FederatedItemException.php b/lib/Exceptions/FederatedItemException.php index 88b97a2ca..8522fd579 100644 --- a/lib/Exceptions/FederatedItemException.php +++ b/lib/Exceptions/FederatedItemException.php @@ -32,22 +32,18 @@ namespace OCA\Circles\Exceptions; - use Exception; use JsonSerializable; use OCP\AppFramework\Http; use Throwable; - /** * Class FederatedItemException * * @package OCA\Circles\Exceptions */ class FederatedItemException extends Exception implements JsonSerializable { - - - static $CHILDREN = [ + public static $CHILDREN = [ FederatedItemBadRequestException::class, FederatedItemConflictException::class, FederatedItemForbiddenException::class, @@ -94,12 +90,10 @@ public function getStatus(): int { */ public function jsonSerialize(): array { return [ - 'class' => get_class($this), - 'status' => $this->getStatus(), - 'code' => $this->getCode(), + 'class' => get_class($this), + 'status' => $this->getStatus(), + 'code' => $this->getCode(), 'message' => $this->getMessage() ]; } - } - diff --git a/lib/Exceptions/FederatedItemForbiddenException.php b/lib/Exceptions/FederatedItemForbiddenException.php index 224ae6bc2..07822c898 100644 --- a/lib/Exceptions/FederatedItemForbiddenException.php +++ b/lib/Exceptions/FederatedItemForbiddenException.php @@ -30,20 +30,16 @@ namespace OCA\Circles\Exceptions; - use OCP\AppFramework\Http; use Throwable; - /** * Class FederatedItemForbiddenException * * @package OCA\Circles\Exceptions */ class FederatedItemForbiddenException extends FederatedItemException { - - - const STATUS = Http::STATUS_FORBIDDEN; + public const STATUS = Http::STATUS_FORBIDDEN; /** @@ -61,6 +57,4 @@ public function __construct( parent::__construct($message, ($code > 0) ? $code : self::STATUS, $previous); $this->setStatus(self::STATUS); } - } - diff --git a/lib/Exceptions/FederatedItemNotFoundException.php b/lib/Exceptions/FederatedItemNotFoundException.php index 315f80bc9..89c991ef6 100644 --- a/lib/Exceptions/FederatedItemNotFoundException.php +++ b/lib/Exceptions/FederatedItemNotFoundException.php @@ -30,20 +30,16 @@ namespace OCA\Circles\Exceptions; - use OCP\AppFramework\Http; use Throwable; - /** * Class FederatedItemNotFoundException * * @package OCA\Circles\Exceptions */ class FederatedItemNotFoundException extends FederatedItemException { - - - const STATUS = Http::STATUS_NOT_FOUND; + public const STATUS = Http::STATUS_NOT_FOUND; /** @@ -61,6 +57,4 @@ public function __construct( parent::__construct($message, ($code > 0) ? $code : self::STATUS, $previous); $this->setStatus(self::STATUS); } - } - diff --git a/lib/Exceptions/FederatedItemRemoteException.php b/lib/Exceptions/FederatedItemRemoteException.php index d200d667a..8bcd4bfb3 100644 --- a/lib/Exceptions/FederatedItemRemoteException.php +++ b/lib/Exceptions/FederatedItemRemoteException.php @@ -30,20 +30,16 @@ namespace OCA\Circles\Exceptions; - use OCP\AppFramework\Http; use Throwable; - /** * Class FederatedItemRemoteException * * @package OCA\Circles\Exceptions */ class FederatedItemRemoteException extends FederatedItemException { - - - const STATUS = Http::STATUS_REQUEST_TIMEOUT; + public const STATUS = Http::STATUS_REQUEST_TIMEOUT; /** @@ -61,6 +57,4 @@ public function __construct( parent::__construct($message, ($code > 0) ? $code : self::STATUS, $previous); $this->setStatus(self::STATUS); } - } - diff --git a/lib/Exceptions/FederatedItemServerException.php b/lib/Exceptions/FederatedItemServerException.php index 34809a273..b1cd24f69 100644 --- a/lib/Exceptions/FederatedItemServerException.php +++ b/lib/Exceptions/FederatedItemServerException.php @@ -30,20 +30,16 @@ namespace OCA\Circles\Exceptions; - use OCP\AppFramework\Http; use Throwable; - /** * Class FederatedItemServerException * * @package OCA\Circles\Exceptions */ class FederatedItemServerException extends FederatedItemException { - - - const STATUS = Http::STATUS_INTERNAL_SERVER_ERROR; + public const STATUS = Http::STATUS_INTERNAL_SERVER_ERROR; /** @@ -61,6 +57,4 @@ public function __construct( parent::__construct($message, ($code > 0) ? $code : self::STATUS, $previous); $this->setStatus(self::STATUS); } - } - diff --git a/lib/Exceptions/FederatedItemUnauthorizedException.php b/lib/Exceptions/FederatedItemUnauthorizedException.php index 879bd580e..739d7fd1d 100644 --- a/lib/Exceptions/FederatedItemUnauthorizedException.php +++ b/lib/Exceptions/FederatedItemUnauthorizedException.php @@ -30,20 +30,16 @@ namespace OCA\Circles\Exceptions; - use OCP\AppFramework\Http; use Throwable; - /** * Class FederatedItemUnauthorizedException * * @package OCA\Circles\Exceptions */ class FederatedItemUnauthorizedException extends FederatedItemException { - - - const STATUS = Http::STATUS_UNAUTHORIZED; + public const STATUS = Http::STATUS_UNAUTHORIZED; /** @@ -61,6 +57,4 @@ public function __construct( parent::__construct($message, $code, $previous); $this->setStatus(self::STATUS); } - } - diff --git a/lib/Exceptions/FederatedLinkCircleNotFoundException.php b/lib/Exceptions/FederatedLinkCircleNotFoundException.php index d2e93b9e6..0523479a0 100644 --- a/lib/Exceptions/FederatedLinkCircleNotFoundException.php +++ b/lib/Exceptions/FederatedLinkCircleNotFoundException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedLinkCircleNotFoundException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedLinkCreationException.php b/lib/Exceptions/FederatedLinkCreationException.php index 68b17e084..e91400bf1 100644 --- a/lib/Exceptions/FederatedLinkCreationException.php +++ b/lib/Exceptions/FederatedLinkCreationException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedLinkCreationException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedLinkDoesNotExistException.php b/lib/Exceptions/FederatedLinkDoesNotExistException.php index c85feff36..353241297 100644 --- a/lib/Exceptions/FederatedLinkDoesNotExistException.php +++ b/lib/Exceptions/FederatedLinkDoesNotExistException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedLinkDoesNotExistException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedLinkUpdateException.php b/lib/Exceptions/FederatedLinkUpdateException.php index eef48e1fe..f2ecfc84a 100644 --- a/lib/Exceptions/FederatedLinkUpdateException.php +++ b/lib/Exceptions/FederatedLinkUpdateException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedLinkUpdateException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedRemoteCircleDoesNotExistException.php b/lib/Exceptions/FederatedRemoteCircleDoesNotExistException.php index e756b031f..132cc35d7 100644 --- a/lib/Exceptions/FederatedRemoteCircleDoesNotExistException.php +++ b/lib/Exceptions/FederatedRemoteCircleDoesNotExistException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedRemoteCircleDoesNotExistException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedRemoteDoesNotAllowException.php b/lib/Exceptions/FederatedRemoteDoesNotAllowException.php index f831e8112..e65b86427 100644 --- a/lib/Exceptions/FederatedRemoteDoesNotAllowException.php +++ b/lib/Exceptions/FederatedRemoteDoesNotAllowException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedRemoteDoesNotAllowException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedRemoteIsDownException.php b/lib/Exceptions/FederatedRemoteIsDownException.php index f4ed8f238..5e0147ee6 100644 --- a/lib/Exceptions/FederatedRemoteIsDownException.php +++ b/lib/Exceptions/FederatedRemoteIsDownException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class FederatedRemoteIsDownException extends \Exception { - } - diff --git a/lib/Exceptions/FederatedShareAlreadyLockedException.php b/lib/Exceptions/FederatedShareAlreadyLockedException.php index 46c6a3b33..993339c88 100644 --- a/lib/Exceptions/FederatedShareAlreadyLockedException.php +++ b/lib/Exceptions/FederatedShareAlreadyLockedException.php @@ -32,9 +32,5 @@ use Exception; - class FederatedShareAlreadyLockedException extends Exception { - } - - diff --git a/lib/Exceptions/FederatedShareBelongingException.php b/lib/Exceptions/FederatedShareBelongingException.php index 79e8102a7..42f7e0b1d 100644 --- a/lib/Exceptions/FederatedShareBelongingException.php +++ b/lib/Exceptions/FederatedShareBelongingException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class FederatedShareBelongingException extends FederatedItemException { - } - - diff --git a/lib/Exceptions/FederatedShareNotFoundException.php b/lib/Exceptions/FederatedShareNotFoundException.php index bb7e9ad6a..9113fdfab 100644 --- a/lib/Exceptions/FederatedShareNotFoundException.php +++ b/lib/Exceptions/FederatedShareNotFoundException.php @@ -32,9 +32,5 @@ use Exception; - class FederatedShareNotFoundException extends Exception { - } - - diff --git a/lib/Exceptions/FederatedUserException.php b/lib/Exceptions/FederatedUserException.php index db2b33824..0838f4809 100644 --- a/lib/Exceptions/FederatedUserException.php +++ b/lib/Exceptions/FederatedUserException.php @@ -31,9 +31,5 @@ namespace OCA\Circles\Exceptions; - class FederatedUserException extends FederatedItemServerException { - } - - diff --git a/lib/Exceptions/FederatedUserNotFoundException.php b/lib/Exceptions/FederatedUserNotFoundException.php index 2375db0e5..f2455e11b 100644 --- a/lib/Exceptions/FederatedUserNotFoundException.php +++ b/lib/Exceptions/FederatedUserNotFoundException.php @@ -31,8 +31,5 @@ namespace OCA\Circles\Exceptions; - class FederatedUserNotFoundException extends FederatedItemNotFoundException { - } - diff --git a/lib/Exceptions/FileCacheNotFoundException.php b/lib/Exceptions/FileCacheNotFoundException.php index 0b3b2460b..b121a34c9 100644 --- a/lib/Exceptions/FileCacheNotFoundException.php +++ b/lib/Exceptions/FileCacheNotFoundException.php @@ -30,13 +30,10 @@ namespace OCA\Circles\Exceptions; - /** * Class MemberNotFoundException * * @package OCA\Circles\Exceptions */ class FileCacheNotFoundException extends FederatedItemNotFoundException { - } - diff --git a/lib/Exceptions/FrontendException.php b/lib/Exceptions/FrontendException.php index c2cfdabc3..5c1a11203 100644 --- a/lib/Exceptions/FrontendException.php +++ b/lib/Exceptions/FrontendException.php @@ -30,14 +30,10 @@ namespace OCA\Circles\Exceptions; - /** * Class FrontendException * * @package OCA\Circles\Exceptions */ class FrontendException extends FederatedItemBadRequestException { - } - - diff --git a/lib/Exceptions/GSKeyException.php b/lib/Exceptions/GSKeyException.php index da4fa59b6..a28198851 100644 --- a/lib/Exceptions/GSKeyException.php +++ b/lib/Exceptions/GSKeyException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class GSKeyException extends \Exception { - } - - diff --git a/lib/Exceptions/GSStatusException.php b/lib/Exceptions/GSStatusException.php index 0e3de4750..8d54dcc59 100644 --- a/lib/Exceptions/GSStatusException.php +++ b/lib/Exceptions/GSStatusException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class GSStatusException extends \Exception { - } - - diff --git a/lib/Exceptions/GlobalScaleDSyncException.php b/lib/Exceptions/GlobalScaleDSyncException.php index e485f212c..0d804f2d3 100644 --- a/lib/Exceptions/GlobalScaleDSyncException.php +++ b/lib/Exceptions/GlobalScaleDSyncException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class GlobalScaleDSyncException extends \Exception { - } - diff --git a/lib/Exceptions/GlobalScaleEventException.php b/lib/Exceptions/GlobalScaleEventException.php index cf721d092..9b6eaf737 100644 --- a/lib/Exceptions/GlobalScaleEventException.php +++ b/lib/Exceptions/GlobalScaleEventException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class GlobalScaleEventException extends \Exception { - } - diff --git a/lib/Exceptions/GroupCannotBeOwnerException.php b/lib/Exceptions/GroupCannotBeOwnerException.php index dfdbe2454..e30cf796f 100644 --- a/lib/Exceptions/GroupCannotBeOwnerException.php +++ b/lib/Exceptions/GroupCannotBeOwnerException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class GroupCannotBeOwnerException extends \Exception { - } - diff --git a/lib/Exceptions/GroupDoesNotExistException.php b/lib/Exceptions/GroupDoesNotExistException.php index ae8d048fb..88de4f1b5 100644 --- a/lib/Exceptions/GroupDoesNotExistException.php +++ b/lib/Exceptions/GroupDoesNotExistException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class GroupDoesNotExistException extends \Exception { - } - diff --git a/lib/Exceptions/GroupNotFoundException.php b/lib/Exceptions/GroupNotFoundException.php index 1b84d1e20..a0424c370 100644 --- a/lib/Exceptions/GroupNotFoundException.php +++ b/lib/Exceptions/GroupNotFoundException.php @@ -31,8 +31,5 @@ namespace OCA\Circles\Exceptions; - class GroupNotFoundException extends FederatedItemNotFoundException { - } - diff --git a/lib/Exceptions/InitiatorNotConfirmedException.php b/lib/Exceptions/InitiatorNotConfirmedException.php index feeb15c08..63c1d9d7e 100644 --- a/lib/Exceptions/InitiatorNotConfirmedException.php +++ b/lib/Exceptions/InitiatorNotConfirmedException.php @@ -30,8 +30,5 @@ namespace OCA\Circles\Exceptions; - class InitiatorNotConfirmedException extends FederatedItemForbiddenException { - } - diff --git a/lib/Exceptions/InitiatorNotFoundException.php b/lib/Exceptions/InitiatorNotFoundException.php index 1efacf884..ad9950df4 100644 --- a/lib/Exceptions/InitiatorNotFoundException.php +++ b/lib/Exceptions/InitiatorNotFoundException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class InitiatorNotFoundException extends FederatedItemUnauthorizedException { - } - - diff --git a/lib/Exceptions/InvalidIdException.php b/lib/Exceptions/InvalidIdException.php index e51b945a4..ee0c103b5 100644 --- a/lib/Exceptions/InvalidIdException.php +++ b/lib/Exceptions/InvalidIdException.php @@ -28,15 +28,10 @@ namespace OCA\Circles\Exceptions; -use Exception; - - /** * Class FederatedEventException * * @package OCA\Circles\Exceptions */ class InvalidIdException extends FederatedItemServerException { - } - diff --git a/lib/Exceptions/InvalidModelException.php b/lib/Exceptions/InvalidModelException.php index 9b447d411..935039176 100644 --- a/lib/Exceptions/InvalidModelException.php +++ b/lib/Exceptions/InvalidModelException.php @@ -31,13 +31,10 @@ namespace OCA\Circles\Exceptions; - /** * Class MemberLevelException * * @package OCA\Circles\Exceptions */ class InvalidModelException extends FederatedItemBadRequestException { - } - diff --git a/lib/Exceptions/JsonException.php b/lib/Exceptions/JsonException.php index 2760a1c7f..a8419372a 100644 --- a/lib/Exceptions/JsonException.php +++ b/lib/Exceptions/JsonException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class JsonException extends \Exception { - } - - diff --git a/lib/Exceptions/LinkedGroupNotAllowedException.php b/lib/Exceptions/LinkedGroupNotAllowedException.php index d45dce4a1..16a11f2cc 100644 --- a/lib/Exceptions/LinkedGroupNotAllowedException.php +++ b/lib/Exceptions/LinkedGroupNotAllowedException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class LinkedGroupNotAllowedException extends \Exception { - } - diff --git a/lib/Exceptions/MaintenanceException.php b/lib/Exceptions/MaintenanceException.php index 65a0f9478..12b05f944 100644 --- a/lib/Exceptions/MaintenanceException.php +++ b/lib/Exceptions/MaintenanceException.php @@ -30,17 +30,12 @@ namespace OCA\Circles\Exceptions; - use Exception; - /** * Class MaintenanceException * * @package OCA\Circles\Exceptions */ class MaintenanceException extends Exception { - } - - diff --git a/lib/Exceptions/MemberAlreadyExistsException.php b/lib/Exceptions/MemberAlreadyExistsException.php index 90a94e79a..104aad88c 100644 --- a/lib/Exceptions/MemberAlreadyExistsException.php +++ b/lib/Exceptions/MemberAlreadyExistsException.php @@ -31,13 +31,10 @@ namespace OCA\Circles\Exceptions; - /** * Class MemberAlreadyExistsException * * @package OCA\Circles\Exceptions */ class MemberAlreadyExistsException extends FederatedItemBadRequestException { - } - diff --git a/lib/Exceptions/MemberCantJoinCircleException.php b/lib/Exceptions/MemberCantJoinCircleException.php index 8af27f722..ccce21eee 100644 --- a/lib/Exceptions/MemberCantJoinCircleException.php +++ b/lib/Exceptions/MemberCantJoinCircleException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class MemberCantJoinCircleException extends \Exception { - } - diff --git a/lib/Exceptions/MemberDoesNotExistException.php b/lib/Exceptions/MemberDoesNotExistException.php index 95ccdf825..ee37449b1 100644 --- a/lib/Exceptions/MemberDoesNotExistException.php +++ b/lib/Exceptions/MemberDoesNotExistException.php @@ -26,7 +26,6 @@ namespace OCA\Circles\Exceptions; - /** * Class MemberDoesNotExistException * @@ -34,6 +33,4 @@ * @package OCA\Circles\Exceptions */ class MemberDoesNotExistException extends \Exception { - } - diff --git a/lib/Exceptions/MemberHelperException.php b/lib/Exceptions/MemberHelperException.php index 84b85b416..ed1445740 100644 --- a/lib/Exceptions/MemberHelperException.php +++ b/lib/Exceptions/MemberHelperException.php @@ -31,13 +31,10 @@ namespace OCA\Circles\Exceptions; - /** * Class MemberLevelException * * @package OCA\Circles\Exceptions */ class MemberHelperException extends FederatedItemBadRequestException { - } - diff --git a/lib/Exceptions/MemberIsBlockedException.php b/lib/Exceptions/MemberIsBlockedException.php index a25cbe1a5..db659fac9 100644 --- a/lib/Exceptions/MemberIsBlockedException.php +++ b/lib/Exceptions/MemberIsBlockedException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class MemberIsBlockedException extends \Exception { - } - diff --git a/lib/Exceptions/MemberIsNotAdminException.php b/lib/Exceptions/MemberIsNotAdminException.php index 91a05afb6..007c47933 100644 --- a/lib/Exceptions/MemberIsNotAdminException.php +++ b/lib/Exceptions/MemberIsNotAdminException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class MemberIsNotAdminException extends \Exception { - } - diff --git a/lib/Exceptions/MemberIsNotModeratorException.php b/lib/Exceptions/MemberIsNotModeratorException.php index d7002c374..01aff9744 100644 --- a/lib/Exceptions/MemberIsNotModeratorException.php +++ b/lib/Exceptions/MemberIsNotModeratorException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class MemberIsNotModeratorException extends \Exception { - } - diff --git a/lib/Exceptions/MemberIsNotOwnerException.php b/lib/Exceptions/MemberIsNotOwnerException.php index a87893b53..6115e7558 100644 --- a/lib/Exceptions/MemberIsNotOwnerException.php +++ b/lib/Exceptions/MemberIsNotOwnerException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class MemberIsNotOwnerException extends \Exception { - } - diff --git a/lib/Exceptions/MemberIsOwnerException.php b/lib/Exceptions/MemberIsOwnerException.php index 7fb3ec121..0707ed2bc 100644 --- a/lib/Exceptions/MemberIsOwnerException.php +++ b/lib/Exceptions/MemberIsOwnerException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class MemberIsOwnerException extends \Exception { - } - diff --git a/lib/Exceptions/MemberLevelException.php b/lib/Exceptions/MemberLevelException.php index 72526a70f..7890bb078 100644 --- a/lib/Exceptions/MemberLevelException.php +++ b/lib/Exceptions/MemberLevelException.php @@ -31,13 +31,10 @@ namespace OCA\Circles\Exceptions; - /** * Class MemberLevelException * * @package OCA\Circles\Exceptions */ class MemberLevelException extends FederatedItemBadRequestException { - } - diff --git a/lib/Exceptions/MemberNotFoundException.php b/lib/Exceptions/MemberNotFoundException.php index af2198a4b..5ee8ac2b2 100644 --- a/lib/Exceptions/MemberNotFoundException.php +++ b/lib/Exceptions/MemberNotFoundException.php @@ -30,14 +30,10 @@ namespace OCA\Circles\Exceptions; - /** * Class MemberNotFoundException * * @package OCA\Circles\Exceptions */ class MemberNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/MemberTypeCantEditLevelException.php b/lib/Exceptions/MemberTypeCantEditLevelException.php index 27983935a..e55e9eb77 100644 --- a/lib/Exceptions/MemberTypeCantEditLevelException.php +++ b/lib/Exceptions/MemberTypeCantEditLevelException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class MemberTypeCantEditLevelException extends \Exception { - } - diff --git a/lib/Exceptions/MembersLimitException.php b/lib/Exceptions/MembersLimitException.php index 96fc02ea4..a5c1c1370 100644 --- a/lib/Exceptions/MembersLimitException.php +++ b/lib/Exceptions/MembersLimitException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class MembersLimitException extends FederatedItemBadRequestException { - } - - diff --git a/lib/Exceptions/MembershipNotFoundException.php b/lib/Exceptions/MembershipNotFoundException.php index a952e3a00..aecdf6981 100644 --- a/lib/Exceptions/MembershipNotFoundException.php +++ b/lib/Exceptions/MembershipNotFoundException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class MembershipNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/MigrationException.php b/lib/Exceptions/MigrationException.php index 71b947523..8fe0ead1d 100644 --- a/lib/Exceptions/MigrationException.php +++ b/lib/Exceptions/MigrationException.php @@ -31,16 +31,12 @@ namespace OCA\Circles\Exceptions; - use Exception; - /** * Class MigrationTo22Exception * * @package OCA\Circles\Exceptions */ class MigrationException extends Exception { - } - diff --git a/lib/Exceptions/MissingKeyInArrayException.php b/lib/Exceptions/MissingKeyInArrayException.php index b90431a67..3ec997be9 100644 --- a/lib/Exceptions/MissingKeyInArrayException.php +++ b/lib/Exceptions/MissingKeyInArrayException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class MissingKeyInArrayException extends \Exception { - } - diff --git a/lib/Exceptions/ModelException.php b/lib/Exceptions/ModelException.php index ad64949e6..1d11f93e8 100644 --- a/lib/Exceptions/ModelException.php +++ b/lib/Exceptions/ModelException.php @@ -26,9 +26,5 @@ namespace OCA\Circles\Exceptions; - class ModelException extends \Exception { - } - - diff --git a/lib/Exceptions/ModeratorIsNotHighEnoughException.php b/lib/Exceptions/ModeratorIsNotHighEnoughException.php index 2be538220..60c41880c 100644 --- a/lib/Exceptions/ModeratorIsNotHighEnoughException.php +++ b/lib/Exceptions/ModeratorIsNotHighEnoughException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class ModeratorIsNotHighEnoughException extends \Exception { - } - diff --git a/lib/Exceptions/MountNotFoundException.php b/lib/Exceptions/MountNotFoundException.php index f80493a5a..f7521c191 100644 --- a/lib/Exceptions/MountNotFoundException.php +++ b/lib/Exceptions/MountNotFoundException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class MountNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/MountPointConstructionException.php b/lib/Exceptions/MountPointConstructionException.php index c90c36c94..56cf13bb3 100644 --- a/lib/Exceptions/MountPointConstructionException.php +++ b/lib/Exceptions/MountPointConstructionException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class MountPointConstructionException extends FederatedItemServerException { - } - - diff --git a/lib/Exceptions/NotContactAddressException.php b/lib/Exceptions/NotContactAddressException.php index 79a679708..4db00ba39 100644 --- a/lib/Exceptions/NotContactAddressException.php +++ b/lib/Exceptions/NotContactAddressException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class NotContactAddressException extends \Exception { - } - diff --git a/lib/Exceptions/NotLocalMemberException.php b/lib/Exceptions/NotLocalMemberException.php index 6506e0c6f..6061b2483 100644 --- a/lib/Exceptions/NotLocalMemberException.php +++ b/lib/Exceptions/NotLocalMemberException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class NotLocalMemberException extends \Exception { - } - diff --git a/lib/Exceptions/OwnerNotFoundException.php b/lib/Exceptions/OwnerNotFoundException.php index 7d976998c..a5869acb0 100644 --- a/lib/Exceptions/OwnerNotFoundException.php +++ b/lib/Exceptions/OwnerNotFoundException.php @@ -31,8 +31,5 @@ namespace OCA\Circles\Exceptions; - class OwnerNotFoundException extends FederatedItemServerException { - } - diff --git a/lib/Exceptions/ParseMemberLevelException.php b/lib/Exceptions/ParseMemberLevelException.php index 224bb1870..c0cf2b185 100644 --- a/lib/Exceptions/ParseMemberLevelException.php +++ b/lib/Exceptions/ParseMemberLevelException.php @@ -31,13 +31,10 @@ namespace OCA\Circles\Exceptions; - /** * Class MemberLevelException * * @package OCA\Circles\Exceptions */ class ParseMemberLevelException extends FederatedItemBadRequestException { - } - diff --git a/lib/Exceptions/PayloadDeliveryException.php b/lib/Exceptions/PayloadDeliveryException.php index 8dfa5915f..a1166e78e 100644 --- a/lib/Exceptions/PayloadDeliveryException.php +++ b/lib/Exceptions/PayloadDeliveryException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class PayloadDeliveryException extends \Exception { - } - diff --git a/lib/Exceptions/RemoteAlreadyExistsException.php b/lib/Exceptions/RemoteAlreadyExistsException.php index 64ecbc6e7..8b36296a6 100644 --- a/lib/Exceptions/RemoteAlreadyExistsException.php +++ b/lib/Exceptions/RemoteAlreadyExistsException.php @@ -32,9 +32,5 @@ use Exception; - class RemoteAlreadyExistsException extends Exception { - } - - diff --git a/lib/Exceptions/RemoteInstanceException.php b/lib/Exceptions/RemoteInstanceException.php index 216a28214..b081f63d9 100644 --- a/lib/Exceptions/RemoteInstanceException.php +++ b/lib/Exceptions/RemoteInstanceException.php @@ -31,13 +31,10 @@ namespace OCA\Circles\Exceptions; - /** * Class RemoteInstanceException * * @package OCA\Circles\Exceptions */ class RemoteInstanceException extends FederatedItemRemoteException { - } - diff --git a/lib/Exceptions/RemoteNotFoundException.php b/lib/Exceptions/RemoteNotFoundException.php index 98f8258a3..85a9c06e4 100644 --- a/lib/Exceptions/RemoteNotFoundException.php +++ b/lib/Exceptions/RemoteNotFoundException.php @@ -30,14 +30,10 @@ namespace OCA\Circles\Exceptions; - /** * Class RemoteNotFoundException * * @package OCA\Circles\Exceptions */ class RemoteNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/RemoteResourceNotFoundException.php b/lib/Exceptions/RemoteResourceNotFoundException.php index a2f949ab0..206f728cb 100644 --- a/lib/Exceptions/RemoteResourceNotFoundException.php +++ b/lib/Exceptions/RemoteResourceNotFoundException.php @@ -30,8 +30,5 @@ namespace OCA\Circles\Exceptions; - class RemoteResourceNotFoundException extends FederatedItemRemoteException { - } - diff --git a/lib/Exceptions/RemoteUidException.php b/lib/Exceptions/RemoteUidException.php index 251a4962e..20737f29a 100644 --- a/lib/Exceptions/RemoteUidException.php +++ b/lib/Exceptions/RemoteUidException.php @@ -32,8 +32,5 @@ use Exception; - class RemoteUidException extends Exception { - } - diff --git a/lib/Exceptions/RequestBuilderException.php b/lib/Exceptions/RequestBuilderException.php index e04fe9bbc..acbad7ee9 100644 --- a/lib/Exceptions/RequestBuilderException.php +++ b/lib/Exceptions/RequestBuilderException.php @@ -31,16 +31,12 @@ namespace OCA\Circles\Exceptions; - use Exception; - /** * Class MigrationTo22Exception * * @package OCA\Circles\Exceptions */ class RequestBuilderException extends Exception { - } - diff --git a/lib/Exceptions/ShareTokenAlreadyExistException.php b/lib/Exceptions/ShareTokenAlreadyExistException.php index 70597bfcc..f1e531e65 100644 --- a/lib/Exceptions/ShareTokenAlreadyExistException.php +++ b/lib/Exceptions/ShareTokenAlreadyExistException.php @@ -30,16 +30,12 @@ namespace OCA\Circles\Exceptions; - use Exception; - /** * Class ShareTokenAlreadyExistException * * @package OCA\Circles\Exceptions */ class ShareTokenAlreadyExistException extends Exception { - } - diff --git a/lib/Exceptions/ShareTokenNotFoundException.php b/lib/Exceptions/ShareTokenNotFoundException.php index 969ab1d38..ea30499dc 100644 --- a/lib/Exceptions/ShareTokenNotFoundException.php +++ b/lib/Exceptions/ShareTokenNotFoundException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class ShareTokenNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/ShareWrapperNotFoundException.php b/lib/Exceptions/ShareWrapperNotFoundException.php index d23b78445..b982a3cfd 100644 --- a/lib/Exceptions/ShareWrapperNotFoundException.php +++ b/lib/Exceptions/ShareWrapperNotFoundException.php @@ -30,9 +30,5 @@ namespace OCA\Circles\Exceptions; - class ShareWrapperNotFoundException extends FederatedItemNotFoundException { - } - - diff --git a/lib/Exceptions/SharingFrameAlreadyDeliveredException.php b/lib/Exceptions/SharingFrameAlreadyDeliveredException.php index 7b305eeea..e8128cb5d 100644 --- a/lib/Exceptions/SharingFrameAlreadyDeliveredException.php +++ b/lib/Exceptions/SharingFrameAlreadyDeliveredException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class SharingFrameAlreadyDeliveredException extends \Exception { - } - diff --git a/lib/Exceptions/SharingFrameAlreadyExistException.php b/lib/Exceptions/SharingFrameAlreadyExistException.php index 464640507..32a465d87 100644 --- a/lib/Exceptions/SharingFrameAlreadyExistException.php +++ b/lib/Exceptions/SharingFrameAlreadyExistException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class SharingFrameAlreadyExistException extends \Exception { - } - diff --git a/lib/Exceptions/SharingFrameDoesNotExistException.php b/lib/Exceptions/SharingFrameDoesNotExistException.php index 7b556a292..6f1921a88 100644 --- a/lib/Exceptions/SharingFrameDoesNotExistException.php +++ b/lib/Exceptions/SharingFrameDoesNotExistException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class SharingFrameDoesNotExistException extends \Exception { - } - diff --git a/lib/Exceptions/SharingFrameSourceCannotBeAppCirclesException.php b/lib/Exceptions/SharingFrameSourceCannotBeAppCirclesException.php index e2140cde7..e97036e75 100644 --- a/lib/Exceptions/SharingFrameSourceCannotBeAppCirclesException.php +++ b/lib/Exceptions/SharingFrameSourceCannotBeAppCirclesException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class SharingFrameSourceCannotBeAppCirclesException extends \Exception { - } - diff --git a/lib/Exceptions/SingleCircleNotFoundException.php b/lib/Exceptions/SingleCircleNotFoundException.php index b1f54cec3..079d45915 100644 --- a/lib/Exceptions/SingleCircleNotFoundException.php +++ b/lib/Exceptions/SingleCircleNotFoundException.php @@ -31,13 +31,10 @@ namespace OCA\Circles\Exceptions; - /** * Class SingleCircleNotFoundException * * @package OCA\Circles\Exceptions */ class SingleCircleNotFoundException extends FederatedItemServerException { - } - diff --git a/lib/Exceptions/TokenDoesNotExistException.php b/lib/Exceptions/TokenDoesNotExistException.php index cf1d3ee38..c942229df 100644 --- a/lib/Exceptions/TokenDoesNotExistException.php +++ b/lib/Exceptions/TokenDoesNotExistException.php @@ -27,6 +27,4 @@ namespace OCA\Circles\Exceptions; class TokenDoesNotExistException extends \Exception { - } - diff --git a/lib/Exceptions/UnknownFederatedItemException.php b/lib/Exceptions/UnknownFederatedItemException.php index f6b05054d..e2d8545aa 100644 --- a/lib/Exceptions/UnknownFederatedItemException.php +++ b/lib/Exceptions/UnknownFederatedItemException.php @@ -32,11 +32,7 @@ namespace OCA\Circles\Exceptions; - use Exception; -use JsonSerializable; -use Throwable; - /** * Class UnknownFederatedItemException @@ -44,6 +40,4 @@ * @package OCA\Circles\Exceptions */ class UnknownFederatedItemException extends Exception { - } - diff --git a/lib/Exceptions/UnknownInterfaceException.php b/lib/Exceptions/UnknownInterfaceException.php index de74a3fed..f9173c73a 100644 --- a/lib/Exceptions/UnknownInterfaceException.php +++ b/lib/Exceptions/UnknownInterfaceException.php @@ -31,9 +31,5 @@ namespace OCA\Circles\Exceptions; - class UnknownInterfaceException extends FederatedItemServerException { - } - - diff --git a/lib/Exceptions/UnknownRemoteException.php b/lib/Exceptions/UnknownRemoteException.php index cf0f9a803..0f2f7fddf 100644 --- a/lib/Exceptions/UnknownRemoteException.php +++ b/lib/Exceptions/UnknownRemoteException.php @@ -31,9 +31,5 @@ namespace OCA\Circles\Exceptions; - class UnknownRemoteException extends FederatedItemRemoteException { - } - - diff --git a/lib/Exceptions/UserTypeNotFoundException.php b/lib/Exceptions/UserTypeNotFoundException.php index 4ef13ac61..c28b31d6b 100644 --- a/lib/Exceptions/UserTypeNotFoundException.php +++ b/lib/Exceptions/UserTypeNotFoundException.php @@ -31,9 +31,5 @@ namespace OCA\Circles\Exceptions; - class UserTypeNotFoundException extends FederatedItemBadRequestException { - } - - diff --git a/lib/FederatedItems/CircleConfig.php b/lib/FederatedItems/CircleConfig.php index 510571f23..d44c6a1bf 100644 --- a/lib/FederatedItems/CircleConfig.php +++ b/lib/FederatedItems/CircleConfig.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use OCA\Circles\Db\CircleRequest; use OCA\Circles\Exceptions\FederatedItemBadRequestException; @@ -42,7 +41,6 @@ use OCA\Circles\Model\Federated\FederatedEvent; use OCA\Circles\Model\Helpers\MemberHelper; - /** * Class CircleConfig * @@ -51,8 +49,6 @@ class CircleConfig implements IFederatedItem, IFederatedItemAsyncProcess { - - use TNC22Deserialize; @@ -161,6 +157,4 @@ public function manage(FederatedEvent $event): void { */ public function result(FederatedEvent $event, array $results): void { } - } - diff --git a/lib/FederatedItems/CircleCreate.php b/lib/FederatedItems/CircleCreate.php index a1a3a68b6..eab1d4bc2 100644 --- a/lib/FederatedItems/CircleCreate.php +++ b/lib/FederatedItems/CircleCreate.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use OCA\Circles\Db\CircleRequest; use OCA\Circles\Db\MemberRequest; @@ -49,7 +48,6 @@ use OCA\Circles\Service\EventService; use OCA\Circles\Service\MembershipService; - /** * Class CircleCreate * @@ -60,8 +58,6 @@ class CircleCreate implements IFederatedItemHighSeverity, IFederatedItemCircleCheckNotRequired, IFederatedItemMustBeInitializedLocally { - - use TNC22Deserialize; @@ -159,6 +155,4 @@ public function manage(FederatedEvent $event): void { public function result(FederatedEvent $event, array $results): void { $this->eventService->circleCreated($event, $results); } - } - diff --git a/lib/FederatedItems/CircleDestroy.php b/lib/FederatedItems/CircleDestroy.php index 1a152f411..bc2d76166 100644 --- a/lib/FederatedItems/CircleDestroy.php +++ b/lib/FederatedItems/CircleDestroy.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use OCA\Circles\Db\CircleRequest; use OCA\Circles\Db\MemberRequest; @@ -45,7 +44,6 @@ use OCA\Circles\Service\EventService; use OCA\Circles\Service\MembershipService; - /** * Class CircleDestroy * @@ -56,8 +54,6 @@ class CircleDestroy implements IFederatedItemHighSeverity, IFederatedItemAsyncProcess, IFederatedItemMemberEmpty { - - use TNC22Deserialize; @@ -130,6 +126,4 @@ public function manage(FederatedEvent $event): void { public function result(FederatedEvent $event, array $results): void { $this->eventService->circleDestroyed($event, $results); } - } - diff --git a/lib/FederatedItems/CircleEdit.php b/lib/FederatedItems/CircleEdit.php index 1c296f6d2..2a73b37bf 100644 --- a/lib/FederatedItems/CircleEdit.php +++ b/lib/FederatedItems/CircleEdit.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use OCA\Circles\Db\CircleRequest; use OCA\Circles\Exceptions\CircleNameTooShortException; @@ -42,15 +41,12 @@ use OCA\Circles\Service\CircleService; use OCA\Circles\Service\EventService; - /** * Class CircleEdit * * @package OCA\Circles\FederatedItems */ class CircleEdit implements IFederatedItem { - - use TNC22Deserialize; @@ -149,6 +145,4 @@ public function manage(FederatedEvent $event): void { public function result(FederatedEvent $event, array $results): void { $this->eventService->circleEdited($event, $results); } - } - diff --git a/lib/FederatedItems/CircleJoin.php b/lib/FederatedItems/CircleJoin.php index 53cdc4fa6..d98d2a9ac 100644 --- a/lib/FederatedItems/CircleJoin.php +++ b/lib/FederatedItems/CircleJoin.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; @@ -65,7 +64,6 @@ use OCA\Circles\StatusCode; use OCP\IUserManager; - /** * Class CircleJoin * @@ -78,8 +76,6 @@ class CircleJoin implements IFederatedItemHighSeverity, IFederatedItemMemberCheckNotRequired, IFederatedItemMemberOptional { - - use TStringTools; use TNC22Logger; use TNC22Deserialize; @@ -319,6 +315,4 @@ private function manageMemberStatus(Circle $circle, Member $member) { } } } - } - diff --git a/lib/FederatedItems/CircleLeave.php b/lib/FederatedItems/CircleLeave.php index b5ded7187..5b40d6dfa 100644 --- a/lib/FederatedItems/CircleLeave.php +++ b/lib/FederatedItems/CircleLeave.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use OCA\Circles\AppInfo\Application; @@ -55,7 +54,6 @@ use OCA\Circles\Service\MembershipService; use OCA\Circles\StatusCode; - /** * Class CircleLeave * @@ -67,8 +65,6 @@ class CircleLeave implements IFederatedItemAsyncProcess, IFederatedItemInitiatorMembershipNotRequired, IFederatedItemMemberOptional { - - use TNC22Deserialize; use TNC22Logger; @@ -128,7 +124,7 @@ public function verify(FederatedEvent $event): void { if (!$event->getParams()->gBool('force')) { $memberHelper = new MemberHelper($member); $memberHelper->cannotBeOwner(); - } else if ($this->configService->isLocalInstance($event->getOrigin())) { + } elseif ($this->configService->isLocalInstance($event->getOrigin())) { if ($member->getLevel() === Member::LEVEL_OWNER) { try { $newOwner = $this->selectNewOwner($circle); @@ -227,7 +223,7 @@ private function selectNewOwner(Circle $circle): Member { if ($member->getLevel() > $newOwner->getLevel()) { $newOwner = $member; - } else if ($member->getLevel() === $newOwner->getLevel() + } elseif ($member->getLevel() === $newOwner->getLevel() && ($member->getJoined() < $newOwner->getJoined() || ($this->configService->isLocalInstance($member->getInstance()) && !$this->configService->isLocalInstance($newOwner->getInstance())) @@ -242,6 +238,4 @@ private function selectNewOwner(Circle $circle): Member { return $newOwner; } - } - diff --git a/lib/FederatedItems/CircleSettings.php b/lib/FederatedItems/CircleSettings.php index 7013a4c55..4f58f588a 100644 --- a/lib/FederatedItems/CircleSettings.php +++ b/lib/FederatedItems/CircleSettings.php @@ -31,21 +31,17 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use OCA\Circles\Db\CircleRequest; use OCA\Circles\IFederatedItem; use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class CircleSettings * * @package OCA\Circles\FederatedItems */ class CircleSettings implements IFederatedItem { - - use TNC22Deserialize; @@ -86,6 +82,4 @@ public function manage(FederatedEvent $event): void { */ public function result(FederatedEvent $event, array $results): void { } - } - diff --git a/lib/FederatedItems/Files/FileShare.php b/lib/FederatedItems/Files/FileShare.php index 62a986f1e..b9a4d5b01 100644 --- a/lib/FederatedItems/Files/FileShare.php +++ b/lib/FederatedItems/Files/FileShare.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems\Files; - use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Exceptions\UnknownTypeException; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; @@ -48,7 +47,6 @@ use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\EventService; - /** * Class FileShare * @@ -59,8 +57,6 @@ class FileShare implements IFederatedItemHighSeverity, IFederatedItemAsyncProcess, IFederatedItemMemberEmpty { - - use TStringTools; use TNC22Logger; @@ -196,6 +192,4 @@ public function result(FederatedEvent $event, array $results): void { // $this->sendShareToContact($event, $circle, $contact['memberId'], $contact['emails']); // } } - } - diff --git a/lib/FederatedItems/Files/FileUnshare.php b/lib/FederatedItems/Files/FileUnshare.php index 964f7a06f..b194d26b9 100644 --- a/lib/FederatedItems/Files/FileUnshare.php +++ b/lib/FederatedItems/Files/FileUnshare.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems\Files; - use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Exceptions\UnknownTypeException; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; @@ -46,7 +45,6 @@ use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\EventService; - /** * Class FileUnshare * @@ -57,8 +55,6 @@ class FileUnshare implements IFederatedItemHighSeverity, IFederatedItemAsyncProcess, IFederatedItemMemberEmpty { - - use TStringTools; use TNC22Logger; @@ -125,6 +121,4 @@ public function manage(FederatedEvent $event): void { */ public function result(FederatedEvent $event, array $results): void { } - } - diff --git a/lib/FederatedItems/ItemLock.php b/lib/FederatedItems/ItemLock.php index 2fe10ba0c..0babe32bc 100644 --- a/lib/FederatedItems/ItemLock.php +++ b/lib/FederatedItems/ItemLock.php @@ -31,18 +31,15 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\Db\ShareLockRequest; use OCA\Circles\Exceptions\FederatedShareNotFoundException; use OCA\Circles\Exceptions\InvalidIdException; use OCA\Circles\IFederatedItem; -use OCA\Circles\IFederatedItemCircleNotRequired; use OCA\Circles\IFederatedItemDataRequestOnly; use OCA\Circles\Model\Federated\FederatedEvent; use OCA\Circles\Model\Federated\FederatedShare; - /** * Class ItemLock * @@ -51,14 +48,12 @@ class ItemLock implements IFederatedItem, IFederatedItemDataRequestOnly { - - use TStringTools; - const STATUS_LOCKED = 'locked'; - const STATUS_ALREADY_LOCKED = 'already_locked'; - const STATUS_INSTANCE_LOCKED = 'instance_locked'; + public const STATUS_LOCKED = 'locked'; + public const STATUS_ALREADY_LOCKED = 'already_locked'; + public const STATUS_INSTANCE_LOCKED = 'instance_locked'; /** @var ShareLockRequest */ @@ -132,6 +127,4 @@ public function manage(FederatedEvent $event): void { */ public function result(FederatedEvent $event, array $results): void { } - } - diff --git a/lib/FederatedItems/LoopbackTest.php b/lib/FederatedItems/LoopbackTest.php index 1eca1c176..fce737a5b 100644 --- a/lib/FederatedItems/LoopbackTest.php +++ b/lib/FederatedItems/LoopbackTest.php @@ -31,14 +31,12 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use OCA\Circles\IFederatedItem; use OCA\Circles\IFederatedItemAsyncProcess; use OCA\Circles\IFederatedItemLoopbackTest; use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class LoopbackTest * @@ -48,10 +46,8 @@ class LoopbackTest implements IFederatedItem, IFederatedItemAsyncProcess, IFederatedItemLoopbackTest { - - - const VERIFY = 17; - const MANAGE = 42; + public const VERIFY = 17; + public const MANAGE = 42; /** @@ -83,6 +79,4 @@ public function manage(FederatedEvent $event): void { */ public function result(FederatedEvent $event, array $results): void { } - } - diff --git a/lib/FederatedItems/MassiveMemberAdd.php b/lib/FederatedItems/MassiveMemberAdd.php index dbe945710..38830e45a 100644 --- a/lib/FederatedItems/MassiveMemberAdd.php +++ b/lib/FederatedItems/MassiveMemberAdd.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use Exception; @@ -43,7 +42,6 @@ use OCA\Circles\Model\Helpers\MemberHelper; use OCA\Circles\Model\Member; - /** * Class MemberAdd * @@ -54,8 +52,6 @@ class MassiveMemberAdd extends SingleMemberAdd implements IFederatedItemAsyncProcess, IFederatedItemHighSeverity, IFederatedItemMemberEmpty { - - use TStringTools; use TNC22Logger; @@ -117,6 +113,4 @@ public function result(FederatedEvent $event, array $results): void { $this->eventService->memberAdded($event, $results); } } - } - diff --git a/lib/FederatedItems/MemberDisplayName.php b/lib/FederatedItems/MemberDisplayName.php index 62d9446a0..228077958 100644 --- a/lib/FederatedItems/MemberDisplayName.php +++ b/lib/FederatedItems/MemberDisplayName.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use OCA\Circles\Db\MemberRequest; use OCA\Circles\Exceptions\FederatedItemBadRequestException; @@ -46,7 +45,6 @@ use OCA\Circles\Service\MembershipService; use OCA\Circles\StatusCode; - /** * Class MemberDisplayName * @@ -56,8 +54,6 @@ class MemberDisplayName implements IFederatedItem, IFederatedItemHighSeverity, IFederatedItemMemberEmpty { - - use TNC22Deserialize; @@ -143,6 +139,4 @@ public function manage(FederatedEvent $event): void { public function result(FederatedEvent $event, array $results): void { $this->eventService->memberNameEdited($event, $results); } - } - diff --git a/lib/FederatedItems/MemberLevel.php b/lib/FederatedItems/MemberLevel.php index 512eaa876..22ea6cc08 100644 --- a/lib/FederatedItems/MemberLevel.php +++ b/lib/FederatedItems/MemberLevel.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Deserialize; use OCA\Circles\Db\MemberRequest; use OCA\Circles\Exceptions\FederatedItemBadRequestException; @@ -49,7 +48,6 @@ use OCA\Circles\Service\EventService; use OCA\Circles\Service\MembershipService; - /** * Class MemberLevel * @@ -59,8 +57,6 @@ class MemberLevel implements IFederatedItem, IFederatedItemHighSeverity, IFederatedItemMemberRequired { - - use TNC22Deserialize; @@ -216,6 +212,4 @@ private function verifySwitchOwner(Member $member, Member $initiator) { $memberHelper->mustBeMember(); $memberHelper->cannotBeOwner(); } - } - diff --git a/lib/FederatedItems/MemberRemove.php b/lib/FederatedItems/MemberRemove.php index fb5436a8b..2c730d8b2 100644 --- a/lib/FederatedItems/MemberRemove.php +++ b/lib/FederatedItems/MemberRemove.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use OCA\Circles\Db\MemberRequest; use OCA\Circles\Exceptions\FederatedItemException; use OCA\Circles\Exceptions\RequestBuilderException; @@ -44,7 +43,6 @@ use OCA\Circles\Service\EventService; use OCA\Circles\Service\MembershipService; - /** * Class MemberLevel * @@ -129,6 +127,4 @@ public function manage(FederatedEvent $event): void { public function result(FederatedEvent $event, array $results): void { $this->eventService->memberRemoved($event, $results); } - } - diff --git a/lib/FederatedItems/SharedItemsSync.php b/lib/FederatedItems/SharedItemsSync.php index 2d568ad1f..c69323a5e 100644 --- a/lib/FederatedItems/SharedItemsSync.php +++ b/lib/FederatedItems/SharedItemsSync.php @@ -31,14 +31,12 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use OCA\Circles\IFederatedItem; use OCA\Circles\IFederatedItemLimitedToInstanceWithMembership; use OCA\Circles\Model\Federated\FederatedEvent; use OCA\Circles\Service\CircleEventService; - /** * Class SharesSync * @@ -50,7 +48,7 @@ class SharedItemsSync implements // TODO: testing that IFederatedItemLimitedToInstanceWithMembership is working (since multi-instance) -// TODO: implements IFederatedItemInstanceMember to the check procedure + // TODO: implements IFederatedItemInstanceMember to the check procedure /** @var CircleEventService */ private $circleEventService; @@ -84,6 +82,4 @@ public function manage(FederatedEvent $event): void { */ public function result(FederatedEvent $event, array $results): void { } - } - diff --git a/lib/FederatedItems/SingleMemberAdd.php b/lib/FederatedItems/SingleMemberAdd.php index dcd6a7f3d..f71c42e7b 100644 --- a/lib/FederatedItems/SingleMemberAdd.php +++ b/lib/FederatedItems/SingleMemberAdd.php @@ -31,7 +31,6 @@ namespace OCA\Circles\FederatedItems; - use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; use ArtificialOwl\MySmallPhpTools\Exceptions\SignatoryException; @@ -89,7 +88,6 @@ use OCP\Mail\IEMailTemplate; use OCP\Util; - /** * Class MemberAdd * @@ -101,8 +99,6 @@ class SingleMemberAdd implements IFederatedItemHighSeverity, IFederatedItemMemberRequired, IFederatedItemMemberCheckNotRequired { - - use TNC22Deserialize; @@ -357,7 +353,6 @@ protected function generateMember(FederatedEvent $event, Circle $circle, Member if ($member->getSingleId() !== '') { $userId = $member->getSingleId() . '@' . $member->getInstance(); $federatedUser = $this->federatedUserService->getFederatedUser($userId, Member::TYPE_SINGLE); - } else { $userId = $member->getUserId() . '@' . $member->getInstance(); $federatedUser = $this->federatedUserService->getFederatedUser( @@ -365,7 +360,6 @@ protected function generateMember(FederatedEvent $event, Circle $circle, Member $member->getUserType() ); } - } catch (MemberNotFoundException $e) { throw new FederatedItemBadRequestException(StatusCode::$MEMBER_ADD[120], 120); } @@ -633,7 +627,6 @@ private function memberIsMailbox( } try { - $template = $this->generateMailExitingShares($author, $circle->getName()); $this->fillMailExistingShares($template, $links); $this->sendMailExistingShares($template, $author, $recipient); @@ -676,7 +669,7 @@ private function generateUnknownSharesLinks( private function getUnknownShares(DeprecatedMember $member): array { $allShares = $this->fileSharesRequest->getSharesForCircle($member->getCircleId()); $knownShares = array_map( - function(SharesToken $shareToken) { + function (SharesToken $shareToken) { return $shareToken->getShareId(); }, $this->tokensRequest->getTokensFromMember($member) @@ -711,8 +704,8 @@ private function getMailLinkFromShare(array $share, DeprecatedMember $member, st $filename = basename($share['file_target']); return [ - 'author' => $author, - 'link' => $link, + 'author' => $author, + 'link' => $link, 'filename' => $filename ]; } @@ -804,9 +797,9 @@ protected function sendPasswordExistingShares(string $author, string $email, str $emailTemplate = $this->mailer->createEMailTemplate( 'sharebymail.RecipientPasswordNotification', [ - 'password' => $password, - 'author' => $author - ] + 'password' => $password, + 'author' => $author + ] ); $emailTemplate->setSubject( @@ -842,6 +835,4 @@ protected function sendPasswordExistingShares(string $author, string $email, str $message->useTemplate($emailTemplate); $this->mailer->send($message); } - } - diff --git a/lib/GlobalScale/AGlobalScaleEvent.php b/lib/GlobalScale/AGlobalScaleEvent.php index e7fb8db95..7e10cd37e 100644 --- a/lib/GlobalScale/AGlobalScaleEvent.php +++ b/lib/GlobalScale/AGlobalScaleEvent.php @@ -1,4 +1,6 @@ -setInstance(''); } } - } - diff --git a/lib/GlobalScale/CircleCreate.php b/lib/GlobalScale/CircleCreate.php index 0de9d4b3f..5d30ebaa1 100644 --- a/lib/GlobalScale/CircleCreate.php +++ b/lib/GlobalScale/CircleCreate.php @@ -1,4 +1,6 @@ -mailer->createEMailTemplate( 'sharebymail.RecipientPasswordNotification', [ - 'filename' => $filename, - 'password' => $password, - 'initiator' => $initiatorDisplayName, - 'initiatorEmail' => $initiatorEmailAddress, - 'shareWith' => $shareWith, - ] + 'filename' => $filename, + 'password' => $password, + 'initiator' => $initiatorDisplayName, + 'initiatorEmail' => $initiatorEmailAddress, + 'shareWith' => $shareWith, + ] ); $emailTemplate->setSubject( @@ -398,11 +396,11 @@ private function generateEmailTemplate($subject, $text, $fileName, $link, $autho ) { $emailTemplate = $this->mailer->createEMailTemplate( 'circles.ShareNotification', [ - 'fileName' => $fileName, - 'fileLink' => $link, - 'author' => $author, - 'circleName' => $circleName, - ] + 'fileName' => $fileName, + 'fileLink' => $link, + 'author' => $author, + 'circleName' => $circleName, + ] ); $emailTemplate->addHeader(); @@ -431,7 +429,7 @@ private function getMailAddressFromCircle(string $circleId): array { ); return array_map( - function(DeprecatedMember $member) { + function (DeprecatedMember $member) { return $member->getUserId(); }, $members ); @@ -477,6 +475,4 @@ private function generateShare($data): IShare { return $share; } - - } diff --git a/lib/GlobalScale/FileUnshare.php b/lib/GlobalScale/FileUnshare.php index 02aaa460c..3bc0c93f4 100644 --- a/lib/GlobalScale/FileUnshare.php +++ b/lib/GlobalScale/FileUnshare.php @@ -1,4 +1,6 @@ -syncCircle($circle, $event->getSource()); $this->removeDeprecateMembers($circle, $event->getSource()); } - } @@ -129,7 +128,6 @@ private function syncCircle(DeprecatedCircle $circle, string $source): void { } } } - } @@ -168,6 +166,4 @@ private function getMember(DeprecatedMember $item, array $members, string $sourc throw new MemberDoesNotExistException(); } - } - diff --git a/lib/GlobalScale/MemberAdd.php b/lib/GlobalScale/MemberAdd.php index df7ba6c4f..201cefec2 100644 --- a/lib/GlobalScale/MemberAdd.php +++ b/lib/GlobalScale/MemberAdd.php @@ -1,4 +1,6 @@ -setData( new SimpleDataStore( [ - 'password' => $password, + 'password' => $password, 'passwordByMail' => $sendPasswordByMail ] ) @@ -157,7 +157,7 @@ public function manage(GSEvent $event): void { $shares = $this->generateUnknownSharesLinks($circle, $member, $password); $result = [ 'unknownShares' => $shares, - 'cachedName' => $cachedName + 'cachedName' => $cachedName ]; if ($member->getType() === DeprecatedMember::TYPE_CONTACT @@ -277,7 +277,7 @@ private function generateUnknownSharesLinks(DeprecatedCircle $circle, Deprecated private function getUnknownShares(DeprecatedMember $member): array { $allShares = $this->fileSharesRequest->getSharesForCircle($member->getCircleId()); $knownShares = array_map( - function(SharesToken $shareToken) { + function (SharesToken $shareToken) { return $shareToken->getShareId(); }, $this->tokensRequest->getTokensFromMember($member) @@ -312,8 +312,8 @@ private function getMailLinkFromShare(array $share, DeprecatedMember $member, st $filename = basename($share['file_target']); return [ - 'author' => $author, - 'link' => $link, + 'author' => $author, + 'link' => $link, 'filename' => $filename ]; } @@ -405,9 +405,9 @@ protected function sendPasswordExistingShares(string $author, string $email, str $emailTemplate = $this->mailer->createEMailTemplate( 'sharebymail.RecipientPasswordNotification', [ - 'password' => $password, - 'author' => $author - ] + 'password' => $password, + 'author' => $author + ] ); $emailTemplate->setSubject( @@ -443,5 +443,4 @@ protected function sendPasswordExistingShares(string $author, string $email, str $message->useTemplate($emailTemplate); $this->mailer->send($message); } - } diff --git a/lib/GlobalScale/MemberJoin.php b/lib/GlobalScale/MemberJoin.php index 3c3df19eb..81e62c375 100644 --- a/lib/GlobalScale/MemberJoin.php +++ b/lib/GlobalScale/MemberJoin.php @@ -1,4 +1,6 @@ -fileSharesRequest->removeSharesFromMember($member); $this->tokensRequest->removeTokensFromMember($member); } - } - diff --git a/lib/GlobalScale/MemberUpdate.php b/lib/GlobalScale/MemberUpdate.php index 51723912f..ff9273ae0 100644 --- a/lib/GlobalScale/MemberUpdate.php +++ b/lib/GlobalScale/MemberUpdate.php @@ -1,4 +1,6 @@ -remoteStreamService->getAppSignatory(); $href = $this->interfaceService->getCloudPath('circles.Remote.appService'); $info = [ - 'app' => Application::APP_ID, - 'name' => Application::APP_NAME, - 'token' => Application::APP_TOKEN, + 'app' => Application::APP_ID, + 'name' => Application::APP_NAME, + 'token' => Application::APP_TOKEN, 'version' => $this->configService->getAppValue('installed_version'), - 'api' => Application::APP_API + 'api' => Application::APP_API ]; } catch (UnknownInterfaceException | SignatoryException $e) { return $response; @@ -132,6 +127,4 @@ public function handle(string $service, IRequestContext $context, ?IResponse $re return $response->addLink(Application::APP_REL, 'application/json', $href, [], $info); } - } - diff --git a/lib/IBroadcaster.php b/lib/IBroadcaster.php index de8f26da6..8d2baf5af 100644 --- a/lib/IBroadcaster.php +++ b/lib/IBroadcaster.php @@ -3,7 +3,6 @@ namespace OCA\Circles; - use OCA\Circles\Model\DeprecatedCircle; use OCA\Circles\Model\DeprecatedMember; use OCA\Circles\Model\SharingFrame; @@ -74,5 +73,4 @@ public function editShareToMember(SharingFrame $frame, DeprecatedMember $member) * @param DeprecatedMember $member */ public function deleteShareToMember(SharingFrame $frame, DeprecatedMember $member); - } diff --git a/lib/IFederatedItem.php b/lib/IFederatedItem.php index f8d31c78b..d611fcc92 100644 --- a/lib/IFederatedItem.php +++ b/lib/IFederatedItem.php @@ -31,11 +31,9 @@ namespace OCA\Circles; - use OCA\Circles\Exceptions\FederatedItemException; use OCA\Circles\Model\Federated\FederatedEvent; - /** * Interface IFederatedItem * @@ -60,6 +58,4 @@ public function manage(FederatedEvent $event): void; * @param array $results */ public function result(FederatedEvent $event, array $results): void; - } - diff --git a/lib/IFederatedItemAsyncProcess.php b/lib/IFederatedItemAsyncProcess.php index 8a1329e3e..b94a6fb2a 100644 --- a/lib/IFederatedItemAsyncProcess.php +++ b/lib/IFederatedItemAsyncProcess.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemAsyncProcess * * @package OCA\Circles */ interface IFederatedItemAsyncProcess { - } - diff --git a/lib/IFederatedItemCircleCheckNotRequired.php b/lib/IFederatedItemCircleCheckNotRequired.php index a5e677738..d0a29d9f3 100644 --- a/lib/IFederatedItemCircleCheckNotRequired.php +++ b/lib/IFederatedItemCircleCheckNotRequired.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemBypassLocalCircleCheck * * @package OCA\Circles */ interface IFederatedItemCircleCheckNotRequired { - } - diff --git a/lib/IFederatedItemDataRequestOnly.php b/lib/IFederatedItemDataRequestOnly.php index c6475a445..23bab1c06 100644 --- a/lib/IFederatedItemDataRequestOnly.php +++ b/lib/IFederatedItemDataRequestOnly.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemRequestOnly * * @package OCA\Circles */ interface IFederatedItemDataRequestOnly { - } - diff --git a/lib/IFederatedItemHighSeverity.php b/lib/IFederatedItemHighSeverity.php index e646e974b..a33b0bcf6 100644 --- a/lib/IFederatedItemHighSeverity.php +++ b/lib/IFederatedItemHighSeverity.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemHighSeverity * * @package OCA\Circles */ interface IFederatedItemHighSeverity { - } - diff --git a/lib/IFederatedItemInitiatorCheckNotRequired.php b/lib/IFederatedItemInitiatorCheckNotRequired.php index cf1b01e63..51ea6ca47 100644 --- a/lib/IFederatedItemInitiatorCheckNotRequired.php +++ b/lib/IFederatedItemInitiatorCheckNotRequired.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemBypassInitiatorCheck * * @package OCA\Circles */ interface IFederatedItemInitiatorCheckNotRequired { - } - diff --git a/lib/IFederatedItemInitiatorMembershipNotRequired.php b/lib/IFederatedItemInitiatorMembershipNotRequired.php index 53249a85a..b310dcf70 100644 --- a/lib/IFederatedItemInitiatorMembershipNotRequired.php +++ b/lib/IFederatedItemInitiatorMembershipNotRequired.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemInitiatorMembershipNotRequired * * @package OCA\Circles */ interface IFederatedItemInitiatorMembershipNotRequired { - } - diff --git a/lib/IFederatedItemLimitedToInstanceWithMembership.php b/lib/IFederatedItemLimitedToInstanceWithMembership.php index f9b98e632..00333aa57 100644 --- a/lib/IFederatedItemLimitedToInstanceWithMembership.php +++ b/lib/IFederatedItemLimitedToInstanceWithMembership.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemInstanceMember * * @package OCA\Circles */ interface IFederatedItemLimitedToInstanceWithMembership { - } - diff --git a/lib/IFederatedItemLoopbackTest.php b/lib/IFederatedItemLoopbackTest.php index 0a39b7876..a14e1081e 100644 --- a/lib/IFederatedItemLoopbackTest.php +++ b/lib/IFederatedItemLoopbackTest.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemLoopbackTest * * @package OCA\Circles */ interface IFederatedItemLoopbackTest { - } - diff --git a/lib/IFederatedItemMemberCheckNotRequired.php b/lib/IFederatedItemMemberCheckNotRequired.php index ee4acb66a..16add2bdd 100644 --- a/lib/IFederatedItemMemberCheckNotRequired.php +++ b/lib/IFederatedItemMemberCheckNotRequired.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemBypassLocalCircleCheck * * @package OCA\Circles */ interface IFederatedItemMemberCheckNotRequired { - } - diff --git a/lib/IFederatedItemMemberEmpty.php b/lib/IFederatedItemMemberEmpty.php index 9c9ef5cc0..a3bf83983 100644 --- a/lib/IFederatedItemMemberEmpty.php +++ b/lib/IFederatedItemMemberEmpty.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemMustHaveMember * * @package OCA\Circles */ interface IFederatedItemMemberEmpty { - } - diff --git a/lib/IFederatedItemMemberOptional.php b/lib/IFederatedItemMemberOptional.php index 618042a3b..90c5f37ad 100644 --- a/lib/IFederatedItemMemberOptional.php +++ b/lib/IFederatedItemMemberOptional.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemMustHaveMember * * @package OCA\Circles */ interface IFederatedItemMemberOptional { - } - diff --git a/lib/IFederatedItemMemberRequired.php b/lib/IFederatedItemMemberRequired.php index 55f214b6f..affcc5e89 100644 --- a/lib/IFederatedItemMemberRequired.php +++ b/lib/IFederatedItemMemberRequired.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemMustHaveMember * * @package OCA\Circles */ interface IFederatedItemMemberRequired { - } - diff --git a/lib/IFederatedItemMustBeInitializedLocally.php b/lib/IFederatedItemMustBeInitializedLocally.php index 7d4f2dbd9..04f52b2ad 100644 --- a/lib/IFederatedItemMustBeInitializedLocally.php +++ b/lib/IFederatedItemMustBeInitializedLocally.php @@ -31,13 +31,10 @@ namespace OCA\Circles; - /** * Interface IFederatedItemMustBeInitializedLocally * * @package OCA\Circles */ interface IFederatedItemMustBeInitializedLocally { - } - diff --git a/lib/IFederatedItemShareManagement.php b/lib/IFederatedItemShareManagement.php index e23c00677..34b9a6ebb 100644 --- a/lib/IFederatedItemShareManagement.php +++ b/lib/IFederatedItemShareManagement.php @@ -31,10 +31,8 @@ namespace OCA\Circles; - use OCA\Circles\Model\Federated\FederatedEvent; - /** * Interface IFederatedItemShareManagement * @@ -134,6 +132,4 @@ public function shareUpdate(FederatedEvent $event): void; * @param FederatedEvent $event */ public function shareDelete(FederatedEvent $event): void; - } - diff --git a/lib/IFederatedItemSharedItem.php b/lib/IFederatedItemSharedItem.php index 4dfb47ccf..15e7cf1b1 100644 --- a/lib/IFederatedItemSharedItem.php +++ b/lib/IFederatedItemSharedItem.php @@ -31,7 +31,6 @@ namespace OCA\Circles; - /** * Interface IFederatedItemSharedItem * @@ -40,6 +39,4 @@ interface IFederatedItemSharedItem { // meaning that the verify() will be run on the instance that locked the item, not on the main instance of the Circle. - } - diff --git a/lib/IFederatedModel.php b/lib/IFederatedModel.php index 9355595ab..0e346fe54 100644 --- a/lib/IFederatedModel.php +++ b/lib/IFederatedModel.php @@ -31,7 +31,6 @@ namespace OCA\Circles; - /** * Interface IFederatedModel * @@ -48,6 +47,4 @@ public function getInstance(): string; * @return bool */ public function isLocal(): bool; - } - diff --git a/lib/IFederatedSync.php b/lib/IFederatedSync.php index ba1a0ddb9..38fe24385 100644 --- a/lib/IFederatedSync.php +++ b/lib/IFederatedSync.php @@ -31,10 +31,8 @@ namespace OCA\Circles; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; - /** * Interface IFederatedSync * @@ -53,6 +51,4 @@ public function export(string $circleId): SimpleDataStore; * @param SimpleDataStore $data */ public function import(SimpleDataStore $data): void; - } - diff --git a/lib/IFederatedUser.php b/lib/IFederatedUser.php index 639444f3b..2d29c2a41 100644 --- a/lib/IFederatedUser.php +++ b/lib/IFederatedUser.php @@ -31,17 +31,14 @@ namespace OCA\Circles; - use OCA\Circles\Model\Circle; - /** * Interface IFederatedUser * * @package OCA\Circles */ interface IFederatedUser extends IFederatedModel { - public function getSingleId(): string; public function getUserId(): string; @@ -51,6 +48,4 @@ public function getUserType(): int; public function getDisplayName(): string; public function getBasedOn(): ?Circle; - } - diff --git a/lib/IMemberships.php b/lib/IMemberships.php index 43b280691..452ab5dca 100644 --- a/lib/IMemberships.php +++ b/lib/IMemberships.php @@ -31,7 +31,6 @@ namespace OCA\Circles; - use OCA\Circles\Model\Membership; /** @@ -57,6 +56,4 @@ public function setMemberships(array $memberships): self; * @return Membership[] */ public function getMemberships(): array; - } - diff --git a/lib/ISearch.php b/lib/ISearch.php index bf5165db4..3300bbe57 100644 --- a/lib/ISearch.php +++ b/lib/ISearch.php @@ -31,10 +31,8 @@ namespace OCA\Circles; - use OCA\Circles\Model\FederatedUser; - /** * Interface ISearch * @@ -48,6 +46,4 @@ interface ISearch { * @return FederatedUser[] */ public function search(string $needle): array; - } - diff --git a/lib/Listeners/DeprecatedListener.php b/lib/Listeners/DeprecatedListener.php index dd00a5037..3da31f733 100644 --- a/lib/Listeners/DeprecatedListener.php +++ b/lib/Listeners/DeprecatedListener.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use Exception; use OCA\Circles\Db\CircleRequest; @@ -51,7 +50,6 @@ use OCA\Circles\Service\FederatedUserService; use OCP\IUser; - /** * Class DeprecatedListener * @@ -126,8 +124,5 @@ public function userAccountUpdated(IUser $user) { } catch (Exception $e) { } } - } - } - diff --git a/lib/Listeners/Examples/ExampleAddingCircleMember.php b/lib/Listeners/Examples/ExampleAddingCircleMember.php index 2a2df05e8..3e8f51954 100644 --- a/lib/Listeners/Examples/ExampleAddingCircleMember.php +++ b/lib/Listeners/Examples/ExampleAddingCircleMember.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Examples; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use OCA\Circles\AppInfo\Application; use OCA\Circles\Events\AddingCircleMemberEvent; @@ -42,15 +41,12 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; - /** * Class ExampleAddingCircleMember * * @package OCA\Circles\Listeners\Files */ class ExampleAddingCircleMember implements IEventListener { - - use TNC22Logger; @@ -97,7 +93,7 @@ public function handle(Event $event): void { . Member::$DEF_LEVEL[$member->getLevel()] . '; '; $memberships = array_map( - function(Membership $membership) { + function (Membership $membership) { return $membership->getCircleId(); }, $circle->getMemberships() ); @@ -109,7 +105,7 @@ function(Membership $membership) { if ($member->getUserType() === Member::TYPE_CIRCLE) { $basedOn = $member->getBasedOn(); $members = array_map( - function(Member $member) { + function (Member $member) { return $member->getUserId() . ' (' . Member::$TYPE[$member->getUserType()] . ')'; }, $basedOn->getInheritedMembers() ); @@ -120,6 +116,4 @@ function(Member $member) { $this->log(3, $prefix . $info); } - } - diff --git a/lib/Listeners/Examples/ExampleMembershipsCreated.php b/lib/Listeners/Examples/ExampleMembershipsCreated.php index 950c6bcac..441e68aa3 100644 --- a/lib/Listeners/Examples/ExampleMembershipsCreated.php +++ b/lib/Listeners/Examples/ExampleMembershipsCreated.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Examples; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use Exception; @@ -44,15 +43,12 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; - /** * Class ExampleMembershipsCreated * * @package OCA\Circles\Listeners\Files */ class ExampleMembershipsCreated implements IEventListener { - - use TStringTools; use TNC22Logger; @@ -96,7 +92,7 @@ public function handle(Event $event): void { $prefix = '[Example Event] (ExampleMembershipsCreated) '; $memberships = array_map( - function(Membership $membership) { + function (Membership $membership) { $inheritance = ($membership->getInheritanceDepth() > 1) ? 'an inherited member' : 'a direct member'; try { @@ -115,6 +111,4 @@ function(Membership $membership) { $this->log(3, $prefix . implode('. ', $memberships)); } - } - diff --git a/lib/Listeners/Examples/ExampleMembershipsRemoved.php b/lib/Listeners/Examples/ExampleMembershipsRemoved.php index 96e2784b3..a46901ad2 100644 --- a/lib/Listeners/Examples/ExampleMembershipsRemoved.php +++ b/lib/Listeners/Examples/ExampleMembershipsRemoved.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Examples; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use Exception; @@ -44,15 +43,12 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; - /** * Class ExampleMembershipsRemoved * * @package OCA\Circles\Listeners\Files */ class ExampleMembershipsRemoved implements IEventListener { - - use TStringTools; use TNC22Logger; @@ -96,7 +92,7 @@ public function handle(Event $event): void { $prefix = '[Example Event] (ExampleMembershipsRemoved) '; $memberships = array_map( - function(Membership $membership) { + function (Membership $membership) { $inheritance = ($membership->getInheritanceDepth() > 1) ? 'an inherited member' : 'a direct member'; try { @@ -115,6 +111,4 @@ function(Membership $membership) { $this->log(3, $prefix . implode('. ', $memberships)); } - } - diff --git a/lib/Listeners/Examples/ExampleRequestingCircleMember.php b/lib/Listeners/Examples/ExampleRequestingCircleMember.php index 96cfcde76..da1053dd7 100644 --- a/lib/Listeners/Examples/ExampleRequestingCircleMember.php +++ b/lib/Listeners/Examples/ExampleRequestingCircleMember.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Examples; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use OCA\Circles\AppInfo\Application; use OCA\Circles\Events\CircleGenericEvent; @@ -41,15 +40,12 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; - /** * Class ExampleRequestingCircleMember * * @package OCA\Circles\Listeners\Examples */ class ExampleRequestingCircleMember implements IEventListener { - - use TNC22Logger; @@ -97,6 +93,4 @@ public function handle(Event $event): void { $this->log(3, $prefix . $info); } - } - diff --git a/lib/Listeners/Files/AddingMember.php b/lib/Listeners/Files/AddingMember.php index 92ec83a4b..13c0ebf53 100644 --- a/lib/Listeners/Files/AddingMember.php +++ b/lib/Listeners/Files/AddingMember.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Files; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use Exception; @@ -47,15 +46,12 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; - /** * Class AddingMember * * @package OCA\Circles\Listeners\Files */ class AddingMember implements IEventListener { - - use TStringTools; use TNC22Logger; @@ -140,7 +136,7 @@ public function handle(Event $event): void { $result[$member->getId()] = [ 'shares' => $files, - 'mails' => $this->getMailAddressesFromContact($member) + 'mails' => $this->getMailAddressesFromContact($member) ]; } @@ -165,6 +161,4 @@ private function getMailAddressesFromContact(Member $member): array { return []; } } - } - diff --git a/lib/Listeners/Files/MemberAdded.php b/lib/Listeners/Files/MemberAdded.php index 385202aa4..4e6a9687a 100644 --- a/lib/Listeners/Files/MemberAdded.php +++ b/lib/Listeners/Files/MemberAdded.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Files; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use Exception; @@ -50,15 +49,12 @@ use OCP\Mail\IMailer; use OCP\Util; - /** * Class MemberAdded * * @package OCA\Circles\Listeners\Files */ class MemberAdded implements IEventListener { - - use TStringTools; use TNC22Logger; @@ -177,7 +173,7 @@ private function generateMail(Circle $circle, Member $member, array $shares, arr foreach ($shares as $share) { $links[] = [ 'filename' => $share->getFileTarget(), - 'link' => $share->getShareToken()->getLink() + 'link' => $share->getShareToken()->getLink() ]; } @@ -248,6 +244,4 @@ private function sendMailExistingShares( $this->mailer->send($message); } - } - diff --git a/lib/Listeners/Files/MembershipsRemoved.php b/lib/Listeners/Files/MembershipsRemoved.php index e0fea493c..0f1331438 100644 --- a/lib/Listeners/Files/MembershipsRemoved.php +++ b/lib/Listeners/Files/MembershipsRemoved.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Files; - use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\CirclesManager; use OCA\Circles\Db\ShareWrapperRequest; @@ -55,15 +54,12 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; - /** * Class MembershipsRemoved * * @package OCA\Circles\Listeners\Files */ class MembershipsRemoved implements IEventListener { - - use TStringTools; @@ -134,6 +130,4 @@ public function handle(Event $event): void { } } } - } - diff --git a/lib/Listeners/Files/RemovingMember.php b/lib/Listeners/Files/RemovingMember.php index 6e34a0e5f..7de96a4b3 100644 --- a/lib/Listeners/Files/RemovingMember.php +++ b/lib/Listeners/Files/RemovingMember.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Files; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\AppInfo\Application; @@ -44,15 +43,12 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; - /** * Class RemovingMember * * @package OCA\Circles\Listeners\Files */ class RemovingMember implements IEventListener { - - use TStringTools; use TNC22Logger; @@ -101,7 +97,7 @@ public function handle(Event $event): void { $singleIds = array_merge( [$circle->getSingleId()], array_map( - function(Membership $membership) { + function (Membership $membership) { return $membership->getCircleId(); }, $circle->getMemberships() ) @@ -126,6 +122,4 @@ function(Membership $membership) { } } } - } - diff --git a/lib/Listeners/GroupCreated.php b/lib/Listeners/GroupCreated.php index 5f466630d..7096d0e4c 100644 --- a/lib/Listeners/GroupCreated.php +++ b/lib/Listeners/GroupCreated.php @@ -37,7 +37,6 @@ use OCP\EventDispatcher\IEventListener; use OCP\Group\Events\GroupCreatedEvent; - /** * Class GroupCreated * @@ -74,6 +73,4 @@ public function handle(Event $event): void { } catch (Exception $e) { } } - } - diff --git a/lib/Listeners/GroupDeleted.php b/lib/Listeners/GroupDeleted.php index 0e5153d17..2c2ed8e55 100644 --- a/lib/Listeners/GroupDeleted.php +++ b/lib/Listeners/GroupDeleted.php @@ -37,7 +37,6 @@ use OCP\EventDispatcher\IEventListener; use OCP\Group\Events\GroupDeletedEvent; - /** * Class GroupDeleted * @@ -74,6 +73,4 @@ public function handle(Event $event): void { } catch (Exception $e) { } } - } - diff --git a/lib/Listeners/GroupMemberAdded.php b/lib/Listeners/GroupMemberAdded.php index e71aa80d3..cc09a0b2f 100644 --- a/lib/Listeners/GroupMemberAdded.php +++ b/lib/Listeners/GroupMemberAdded.php @@ -31,14 +31,12 @@ namespace OCA\Circles\Listeners; - use Exception; use OCA\Circles\Service\SyncService; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\Group\Events\UserAddedEvent; - /** * Class GroupMemberAdded * @@ -76,6 +74,4 @@ public function handle(Event $event): void { } catch (Exception $e) { } } - } - diff --git a/lib/Listeners/GroupMemberRemoved.php b/lib/Listeners/GroupMemberRemoved.php index b7a20864d..e5d26307b 100644 --- a/lib/Listeners/GroupMemberRemoved.php +++ b/lib/Listeners/GroupMemberRemoved.php @@ -37,7 +37,6 @@ use OCP\EventDispatcher\IEventListener; use OCP\Group\Events\UserRemovedEvent; - /** * Class GroupMemberRemoved * @@ -75,6 +74,4 @@ public function handle(Event $event): void { } catch (Exception $e) { } } - } - diff --git a/lib/Listeners/Notifications/RequestingMember.php b/lib/Listeners/Notifications/RequestingMember.php index 01728bcf4..b2f780360 100644 --- a/lib/Listeners/Notifications/RequestingMember.php +++ b/lib/Listeners/Notifications/RequestingMember.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Listeners\Notifications; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use OCA\Circles\AppInfo\Application; use OCA\Circles\Events\CircleGenericEvent; @@ -41,15 +40,12 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; - /** * Class RequestingMember * * @package OCA\Circles\Listeners\Notifications */ class RequestingMember implements IEventListener { - - use TNC22Logger; @@ -85,7 +81,4 @@ public function handle(Event $event): void { $this->notificationService->notificationInvited($member); } } - - } - diff --git a/lib/Listeners/UserCreated.php b/lib/Listeners/UserCreated.php index c767d3e48..489a54e11 100644 --- a/lib/Listeners/UserCreated.php +++ b/lib/Listeners/UserCreated.php @@ -37,7 +37,6 @@ use OCP\EventDispatcher\IEventListener; use OCP\User\Events\UserCreatedEvent; - /** * Class UserCreated * @@ -75,6 +74,4 @@ public function handle(Event $event): void { } catch (Exception $e) { } } - } - diff --git a/lib/Listeners/UserDeleted.php b/lib/Listeners/UserDeleted.php index 8ae6597ff..cf563fb16 100644 --- a/lib/Listeners/UserDeleted.php +++ b/lib/Listeners/UserDeleted.php @@ -37,7 +37,6 @@ use OCP\EventDispatcher\IEventListener; use OCP\User\Events\UserDeletedEvent; - /** * Class UserDeleted * @@ -74,6 +73,4 @@ public function handle(Event $event): void { } catch (Exception $e) { } } - } - diff --git a/lib/Migration/ImportOwncloudCustomGroups.php b/lib/Migration/ImportOwncloudCustomGroups.php index 76e090cc4..b36d71293 100644 --- a/lib/Migration/ImportOwncloudCustomGroups.php +++ b/lib/Migration/ImportOwncloudCustomGroups.php @@ -224,5 +224,4 @@ protected function shouldRun() { $alreadyImported = $this->config->getAppValue('circles', 'imported_custom_groups', 'false'); return !$alreadyImported && $this->connection->tableExists('custom_group') && $this->connection->tableExists('custom_group_member'); } - } diff --git a/lib/Migration/Migration.php b/lib/Migration/Migration.php index 489d30ce3..7ef0bd2c6 100644 --- a/lib/Migration/Migration.php +++ b/lib/Migration/Migration.php @@ -31,25 +31,20 @@ namespace OCA\Circles\Migration; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use Exception; -use OCA\Circles\AppInfo\Application; use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\MigrationService; use OCA\Circles\Service\OutputService; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; - /** * Class Migration * * @package OCA\Circles\Migration */ class Migration implements IRepairStep { - - use TNC22Logger; @@ -104,6 +99,4 @@ public function run(IOutput $output) { $this->e($e); } } - } - diff --git a/lib/Migration/Version0022Date20220526111723.php b/lib/Migration/Version0022Date20220526111723.php index 180a3d423..6979160f2 100644 --- a/lib/Migration/Version0022Date20220526111723.php +++ b/lib/Migration/Version0022Date20220526111723.php @@ -37,7 +37,6 @@ use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; - /** * Class Version0021Date20210105123456 * @@ -87,6 +86,4 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - } - diff --git a/lib/Migration/Version0022Date20220526113601.php b/lib/Migration/Version0022Date20220526113601.php index 67bcc0ffb..0bb15764c 100644 --- a/lib/Migration/Version0022Date20220526113601.php +++ b/lib/Migration/Version0022Date20220526113601.php @@ -39,7 +39,6 @@ use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; - /** * Class Version0022Date20220526113601 * @@ -76,86 +75,86 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table->addColumn( 'id', 'integer', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 4, - 'unsigned' => true, - ] + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + 'unsigned' => true, + ] ); $table->addColumn( 'unique_id', 'string', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->addColumn( 'name', 'string', [ - 'notnull' => true, - 'length' => 127, - ] + 'notnull' => true, + 'length' => 127, + ] ); $table->addColumn( 'display_name', 'string', [ - 'notnull' => false, - 'default' => '', - 'length' => 127 - ] + 'notnull' => false, + 'default' => '', + 'length' => 127 + ] ); $table->addColumn( 'sanitized_name', 'string', [ - 'notnull' => false, - 'default' => '', - 'length' => 127 - ] + 'notnull' => false, + 'default' => '', + 'length' => 127 + ] ); $table->addColumn( 'instance', 'string', [ - 'notnull' => false, - 'default' => '', - 'length' => 255 - ] + 'notnull' => false, + 'default' => '', + 'length' => 255 + ] ); $table->addColumn( 'config', 'integer', [ - 'notnull' => false, - 'length' => 11, - 'unsigned' => true - ] + 'notnull' => false, + 'length' => 11, + 'unsigned' => true + ] ); $table->addColumn( 'source', 'integer', [ - 'notnull' => false, - 'length' => 5, - 'unsigned' => true - ] + 'notnull' => false, + 'length' => 5, + 'unsigned' => true + ] ); $table->addColumn( 'settings', 'text', [ - 'notnull' => false - ] + 'notnull' => false + ] ); $table->addColumn( 'description', 'text', [ - 'notnull' => false - ] + 'notnull' => false + ] ); $table->addColumn( 'creation', 'datetime', [ - 'notnull' => false, - ] + 'notnull' => false, + ] ); $table->addColumn( 'contact_addressbook', 'integer', [ - 'notnull' => false, - 'unsigned' => true, - 'length' => 7, - ] + 'notnull' => false, + 'unsigned' => true, + 'length' => 7, + ] ); $table->addColumn( 'contact_groupname', 'string', [ - 'notnull' => false, - 'length' => 127, - ] + 'notnull' => false, + 'length' => 127, + ] ); $table->setPrimaryKey(['id']); @@ -175,99 +174,99 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table->addColumn( 'id', 'integer', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 4, - 'unsigned' => true, - ] + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + 'unsigned' => true, + ] ); $table->addColumn( 'single_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'circle_id', 'string', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->addColumn( 'member_id', Types::STRING, [ - 'notnull' => false, - 'length' => 31, - ] + 'notnull' => false, + 'length' => 31, + ] ); $table->addColumn( 'user_id', 'string', [ - 'notnull' => true, - 'length' => 127, - ] + 'notnull' => true, + 'length' => 127, + ] ); $table->addColumn( 'user_type', 'smallint', [ - 'notnull' => true, - 'length' => 1, - 'default' => 1, - ] + 'notnull' => true, + 'length' => 1, + 'default' => 1, + ] ); $table->addColumn( 'instance', 'string', [ - 'default' => '', - 'length' => 255 - ] + 'default' => '', + 'length' => 255 + ] ); $table->addColumn( 'invited_by', 'string', [ - 'notnull' => false, - 'length' => 31, - ] + 'notnull' => false, + 'length' => 31, + ] ); $table->addColumn( 'level', 'smallint', [ - 'notnull' => true, - 'length' => 1, - ] + 'notnull' => true, + 'length' => 1, + ] ); $table->addColumn( 'status', 'string', [ - 'notnull' => false, - 'length' => 15, - ] + 'notnull' => false, + 'length' => 15, + ] ); $table->addColumn( 'note', 'text', [ - 'notnull' => false - ] + 'notnull' => false + ] ); $table->addColumn( 'cached_name', 'string', [ - 'notnull' => false, - 'length' => 255, - 'default' => '' - ] + 'notnull' => false, + 'length' => 255, + 'default' => '' + ] ); $table->addColumn( 'cached_update', 'datetime', [ - 'notnull' => false, - ] + 'notnull' => false, + ] ); $table->addColumn( 'contact_id', 'string', [ - 'notnull' => false, - 'length' => 127, - ] + 'notnull' => false, + 'length' => 127, + ] ); $table->addColumn( 'contact_meta', 'text', [ - 'notnull' => false - ] + 'notnull' => false + ] ); $table->addColumn( 'joined', 'datetime', [ - 'notnull' => false, - ] + 'notnull' => false, + ] ); $table->setPrimaryKey(['id']); @@ -287,53 +286,53 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->createTable('circles_remote'); $table->addColumn( 'id', 'integer', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 4, - 'unsigned' => true, - ] + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + 'unsigned' => true, + ] ); $table->addColumn( 'type', 'string', [ - 'notnull' => true, - 'length' => 15, - 'default' => 'Unknown' - ] + 'notnull' => true, + 'length' => 15, + 'default' => 'Unknown' + ] ); $table->addColumn( 'interface', 'integer', [ - 'notnull' => true, - 'length' => 1, - 'default' => 0 - ] + 'notnull' => true, + 'length' => 1, + 'default' => 0 + ] ); $table->addColumn( 'uid', 'string', [ - 'notnull' => false, - 'length' => 20, - ] + 'notnull' => false, + 'length' => 20, + ] ); $table->addColumn( 'instance', 'string', [ - 'notnull' => false, - 'length' => 127, - ] + 'notnull' => false, + 'length' => 127, + ] ); $table->addColumn( 'href', 'string', [ - 'notnull' => false, - 'length' => 254, - ] + 'notnull' => false, + 'length' => 254, + ] ); $table->addColumn( 'item', 'text', [ - 'notnull' => false, - ] + 'notnull' => false, + ] ); $table->addColumn( 'creation', 'datetime', [ - 'notnull' => false, - ] + 'notnull' => false, + ] ); $table->setPrimaryKey(['id']); @@ -350,61 +349,61 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->createTable('circles_event'); $table->addColumn( 'token', 'string', [ - 'notnull' => false, - 'length' => 63, - ] + 'notnull' => false, + 'length' => 63, + ] ); $table->addColumn( 'event', 'text', [ - 'notnull' => false - ] + 'notnull' => false + ] ); $table->addColumn( 'result', 'text', [ - 'notnull' => false - ] + 'notnull' => false + ] ); $table->addColumn( 'instance', 'string', [ - 'length' => 255, - 'notnull' => false - ] + 'length' => 255, + 'notnull' => false + ] ); $table->addColumn( 'interface', 'integer', [ - 'notnull' => true, - 'length' => 1, - 'default' => 0 - ] + 'notnull' => true, + 'length' => 1, + 'default' => 0 + ] ); $table->addColumn( 'severity', 'integer', [ - 'length' => 3, - 'notnull' => false - ] + 'length' => 3, + 'notnull' => false + ] ); $table->addColumn( 'retry', 'integer', [ - 'length' => 3, - 'notnull' => false - ] + 'length' => 3, + 'notnull' => false + ] ); $table->addColumn( 'status', 'integer', [ - 'length' => 3, - 'notnull' => false - ] + 'length' => 3, + 'notnull' => false + ] ); $table->addColumn( 'updated', 'datetime', [ - 'notnull' => false, - ] + 'notnull' => false, + ] ); $table->addColumn( 'creation', 'bigint', [ - 'length' => 14, - 'notnull' => false - ] + 'length' => 14, + 'notnull' => false + ] ); $table->addUniqueIndex(['token', 'instance']); @@ -419,46 +418,46 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table->addColumn( 'circle_id', 'string', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->addColumn( 'single_id', 'string', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->addColumn( 'level', 'integer', [ - 'notnull' => true, - 'length' => 1, - 'unsigned' => true - ] + 'notnull' => true, + 'length' => 1, + 'unsigned' => true + ] ); $table->addColumn( 'inheritance_first', 'string', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->addColumn( 'inheritance_last', 'string', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->addColumn( 'inheritance_depth', 'integer', [ - 'notnull' => true, - 'length' => 2, - 'unsigned' => true - ] + 'notnull' => true, + 'length' => 2, + 'unsigned' => true + ] ); $table->addColumn( 'inheritance_path', 'text', [ - 'notnull' => true - ] + 'notnull' => true + ] ); $table->addIndex(['single_id']); @@ -476,53 +475,53 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->createTable('circles_token'); $table->addColumn( 'id', 'integer', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 11, - 'unsigned' => true, - ] + 'autoincrement' => true, + 'notnull' => true, + 'length' => 11, + 'unsigned' => true, + ] ); $table->addColumn( 'share_id', 'integer', [ - 'notnull' => false, - 'length' => 11 - ] + 'notnull' => false, + 'length' => 11 + ] ); $table->addColumn( 'circle_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'single_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'member_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'token', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'password', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'accepted', 'integer', [ - 'notnull' => false, - 'length' => 1 - ] + 'notnull' => false, + 'length' => 1 + ] ); $table->setPrimaryKey(['id']); @@ -537,52 +536,52 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->createTable('circles_mount'); $table->addColumn( 'id', 'integer', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 11, - 'unsigned' => true, - ] + 'autoincrement' => true, + 'notnull' => true, + 'length' => 11, + 'unsigned' => true, + ] ); $table->addColumn( 'mount_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'circle_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'single_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'token', 'string', [ - 'notnull' => false, - 'length' => 63 - ] + 'notnull' => false, + 'length' => 63 + ] ); $table->addColumn( 'parent', 'integer', [ - 'notnull' => false, - 'length' => 11 - ] + 'notnull' => false, + 'length' => 11 + ] ); $table->addColumn( 'mountpoint', 'text', [ - 'notnull' => false - ] + 'notnull' => false + ] ); $table->addColumn( 'mountpoint_hash', 'string', [ - 'notnull' => false, - 'length' => 64 - ] + 'notnull' => false, + 'length' => 64 + ] ); $table->setPrimaryKey(['id']); @@ -597,34 +596,34 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->createTable('circles_mountpoint'); $table->addColumn( 'id', 'integer', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 11, - 'unsigned' => true, - ] + 'autoincrement' => true, + 'notnull' => true, + 'length' => 11, + 'unsigned' => true, + ] ); $table->addColumn( 'mount_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'single_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'mountpoint', 'text', [ - 'notnull' => false - ] + 'notnull' => false + ] ); $table->addColumn( 'mountpoint_hash', 'string', [ - 'notnull' => false, - 'length' => 64 - ] + 'notnull' => false, + 'length' => 64 + ] ); $table->setPrimaryKey(['id']); @@ -639,29 +638,29 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->createTable('circles_share_lock'); $table->addColumn( 'id', 'integer', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 4, - 'unsigned' => true, - ] + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + 'unsigned' => true, + ] ); $table->addColumn( 'item_id', 'string', [ - 'notnull' => true, - 'length' => 31 - ] + 'notnull' => true, + 'length' => 31 + ] ); $table->addColumn( 'circle_id', 'string', [ - 'notnull' => true, - 'length' => 31 - ] + 'notnull' => true, + 'length' => 31 + ] ); $table->addColumn( 'instance', 'string', [ - 'notnull' => true, - 'length' => 127, - ] + 'notnull' => true, + 'length' => 127, + ] ); $table->setPrimaryKey(['id']); @@ -670,6 +669,4 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - } - diff --git a/lib/Migration/Version0022Date20220703115023.php b/lib/Migration/Version0022Date20220703115023.php index de1130464..0e5fb1295 100644 --- a/lib/Migration/Version0022Date20220703115023.php +++ b/lib/Migration/Version0022Date20220703115023.php @@ -38,7 +38,6 @@ use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; - /** * Class Version0022Date20220526113601 * @@ -71,16 +70,16 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt if (!$table->hasColumn('updated')) { $table->addColumn( 'updated', 'datetime', [ - 'notnull' => false, - ] + 'notnull' => false, + ] ); } if (!$table->hasColumn('retry')) { $table->addColumn( 'retry', 'integer', [ - 'length' => 3, - 'notnull' => false - ] + 'length' => 3, + 'notnull' => false + ] ); } } @@ -90,10 +89,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt if (!$table->hasColumn('invited_by')) { $table->addColumn( 'invited_by', 'string', [ - 'notnull' => false, - 'default' => '', - 'length' => 31, - ] + 'notnull' => false, + 'default' => '', + 'length' => 31, + ] ); } } @@ -104,10 +103,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt if (!$table->hasColumn('sanitized_name')) { $table->addColumn( 'sanitized_name', 'string', [ - 'notnull' => false, - 'default' => '', - 'length' => 127 - ] + 'notnull' => false, + 'default' => '', + 'length' => 127 + ] ); $table->addIndex(['sanitized_name']); @@ -119,27 +118,27 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->getTable('circles_membership'); $table->changeColumn( 'circle_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->changeColumn( 'single_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->changeColumn( 'inheritance_first', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->changeColumn( 'inheritance_last', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); } @@ -148,21 +147,21 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->getTable('circles_mount'); $table->changeColumn( 'mount_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->changeColumn( 'circle_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->changeColumn( 'single_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); } @@ -171,15 +170,15 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->getTable('circles_mountpoint'); $table->changeColumn( 'mount_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->changeColumn( 'single_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); } @@ -188,15 +187,15 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->getTable('circles_share_lock'); $table->changeColumn( 'item_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); $table->changeColumn( 'circle_id', [ - 'notnull' => true, - 'length' => 31, - ] + 'notnull' => true, + 'length' => 31, + ] ); } @@ -209,53 +208,53 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->createTable('circles_token'); $table->addColumn( 'id', 'integer', [ - 'autoincrement' => true, - 'notnull' => true, - 'length' => 11, - 'unsigned' => true, - ] + 'autoincrement' => true, + 'notnull' => true, + 'length' => 11, + 'unsigned' => true, + ] ); $table->addColumn( 'share_id', 'integer', [ - 'notnull' => false, - 'length' => 11 - ] + 'notnull' => false, + 'length' => 11 + ] ); $table->addColumn( 'circle_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'single_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'member_id', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'token', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'password', 'string', [ - 'notnull' => false, - 'length' => 31 - ] + 'notnull' => false, + 'length' => 31 + ] ); $table->addColumn( 'accepted', 'integer', [ - 'notnull' => false, - 'length' => 1 - ] + 'notnull' => false, + 'length' => 1 + ] ); $table->setPrimaryKey(['id']); @@ -265,6 +264,4 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - } - diff --git a/lib/Model/BaseCircle.php b/lib/Model/BaseCircle.php index 4f168a524..093b80a24 100644 --- a/lib/Model/BaseCircle.php +++ b/lib/Model/BaseCircle.php @@ -31,23 +31,22 @@ use OCP\IL10N; class BaseCircle { - - const CIRCLES_SETTINGS_DEFAULT = [ + public const CIRCLES_SETTINGS_DEFAULT = [ 'password_enforcement' => 'false', - 'password_single' => '', - 'allow_links' => 'false', - 'allow_links_auto' => 'false', - 'allow_links_files' => 'false' + 'password_single' => '', + 'allow_links' => 'false', + 'allow_links_auto' => 'false', + 'allow_links_files' => 'false' ]; - const CIRCLES_PERSONAL = 1; - const CIRCLES_SECRET = 2; - const CIRCLES_CLOSED = 4; - const CIRCLES_PUBLIC = 8; + public const CIRCLES_PERSONAL = 1; + public const CIRCLES_SECRET = 2; + public const CIRCLES_CLOSED = 4; + public const CIRCLES_PUBLIC = 8; - const CIRCLES_ALL = 15; + public const CIRCLES_ALL = 15; - const SHORT_UNIQUE_ID_LENGTH = 14; + public const SHORT_UNIQUE_ID_LENGTH = 14; /** @var int */ private $id; @@ -356,7 +355,7 @@ public function getContactGroupName() { public function setSettings($settings, bool $all = false) { if (is_array($settings)) { $this->settings = $settings; - } else if (is_string($settings)) { + } elseif (is_string($settings)) { $this->settings = (array)json_decode($settings, true); } @@ -376,7 +375,6 @@ public function setSettings($settings, bool $all = false) { * @return array|string */ public function getSettings($json = false) { - if ($json) { return json_encode($this->settings); } @@ -580,7 +578,6 @@ public function getLinks() { * @return integer */ public static function typeInt($type) { - if (is_numeric($type)) { return (int)$type; } diff --git a/lib/Model/BaseMember.php b/lib/Model/BaseMember.php index 2c212cadc..146f2af01 100644 --- a/lib/Model/BaseMember.php +++ b/lib/Model/BaseMember.php @@ -33,24 +33,23 @@ use OCP\IL10N; class BaseMember implements JsonSerializable { - - const LEVEL_NONE = 0; - const LEVEL_MEMBER = 1; - const LEVEL_MODERATOR = 4; - const LEVEL_ADMIN = 8; - const LEVEL_OWNER = 9; - - const STATUS_NONMEMBER = 'Unknown'; - const STATUS_INVITED = 'Invited'; - const STATUS_REQUEST = 'Requesting'; - const STATUS_MEMBER = 'Member'; - const STATUS_BLOCKED = 'Blocked'; - const STATUS_KICKED = 'Removed'; - - const TYPE_USER = 1; - const TYPE_GROUP = 2; - const TYPE_MAIL = 3; - const TYPE_CONTACT = 4; + public const LEVEL_NONE = 0; + public const LEVEL_MEMBER = 1; + public const LEVEL_MODERATOR = 4; + public const LEVEL_ADMIN = 8; + public const LEVEL_OWNER = 9; + + public const STATUS_NONMEMBER = 'Unknown'; + public const STATUS_INVITED = 'Invited'; + public const STATUS_REQUEST = 'Requesting'; + public const STATUS_MEMBER = 'Member'; + public const STATUS_BLOCKED = 'Blocked'; + public const STATUS_KICKED = 'Removed'; + + public const TYPE_USER = 1; + public const TYPE_GROUP = 2; + public const TYPE_MAIL = 3; + public const TYPE_CONTACT = 4; /** @var string */ private $circleUniqueId; @@ -411,18 +410,18 @@ public static function fromJSON($json) { public function jsonSerialize() { return [ - 'circle_id' => $this->getCircleId(), - 'member_id' => $this->getMemberId(), - 'user_id' => $this->getUserId(), - 'user_type' => $this->getType(), - 'cached_name' => $this->getCachedName(), - 'contact_id' => $this->getContactId(), - 'level' => $this->getLevel(), + 'circle_id' => $this->getCircleId(), + 'member_id' => $this->getMemberId(), + 'user_id' => $this->getUserId(), + 'user_type' => $this->getType(), + 'cached_name' => $this->getCachedName(), + 'contact_id' => $this->getContactId(), + 'level' => $this->getLevel(), 'level_string' => $this->getLevelString(), - 'status' => $this->getStatus(), - 'instance' => $this->getInstance(), - 'note' => $this->getNote(), - 'joined' => $this->getJoined() + 'status' => $this->getStatus(), + 'instance' => $this->getInstance(), + 'note' => $this->getNote(), + 'joined' => $this->getJoined() ]; } diff --git a/lib/Model/Circle.php b/lib/Model/Circle.php index 644680ca8..d9b20dc31 100644 --- a/lib/Model/Circle.php +++ b/lib/Model/Circle.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Model; - use ArtificialOwl\MySmallPhpTools\Db\Nextcloud\nc22\INC22QueryRow; use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\IDeserializable; @@ -43,7 +42,6 @@ use OCA\Circles\Exceptions\OwnerNotFoundException; use OCA\Circles\IMemberships; - /** * Class Circle * @@ -73,37 +71,35 @@ * @package OCA\Circles\Model */ class Circle extends ManagedModel implements IMemberships, IDeserializable, INC22QueryRow, JsonSerializable { - - use TArrayTools; use TNC22Deserialize; - const FLAGS_SHORT = 1; - const FLAGS_LONG = 2; + public const FLAGS_SHORT = 1; + public const FLAGS_LONG = 2; // specific value - const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. - const CFG_SINGLE = 1; // Circle with only one single member. - const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. + public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. + public const CFG_SINGLE = 1; // Circle with only one single member. + public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. // bitwise - const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited - const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it - const CFG_OPEN = 16; // Circle is open, people can join - const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted - const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator - const CFG_FRIEND = 128; // Members of the circle can invite their friends - const CFG_PROTECTED = 256; // Password protected to join/request - const CFG_NO_OWNER = 512; // no owner, only members - const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity - const CFG_BACKEND = 2048; // Fully hidden, only backend Circles - const CFG_LOCAL = 4096; // Local even on GlobalScale - const CFG_ROOT = 8192; // Circle cannot be inside another Circle - const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle - const CFG_FEDERATED = 32768; // Federated - const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle + public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited + public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it + public const CFG_OPEN = 16; // Circle is open, people can join + public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted + public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator + public const CFG_FRIEND = 128; // Members of the circle can invite their friends + public const CFG_PROTECTED = 256; // Password protected to join/request + public const CFG_NO_OWNER = 512; // no owner, only members + public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity + public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles + public const CFG_LOCAL = 4096; // Local even on GlobalScale + public const CFG_ROOT = 8192; // Circle cannot be inside another Circle + public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle + public const CFG_FEDERATED = 32768; // Federated + public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle public static $DEF_CFG_MAX = 131071; @@ -115,20 +111,20 @@ class Circle extends ManagedModel implements IMemberships, IDeserializable, INC2 * @var array */ public static $DEF_CFG = [ - 1 => 'S|Single', - 2 => 'P|Personal', - 4 => 'Y|System', - 8 => 'V|Visible', - 16 => 'O|Open', - 32 => 'I|Invite', - 64 => 'JR|Join Request', - 128 => 'F|Friends', - 256 => 'PP|Password Protected', - 512 => 'NO|No Owner', - 1024 => 'H|Hidden', - 2048 => 'T|Backend', - 4096 => 'L|Local', - 8192 => 'T|Root', + 1 => 'S|Single', + 2 => 'P|Personal', + 4 => 'Y|System', + 8 => 'V|Visible', + 16 => 'O|Open', + 32 => 'I|Invite', + 64 => 'JR|Join Request', + 128 => 'F|Friends', + 256 => 'PP|Password Protected', + 512 => 'NO|No Owner', + 1024 => 'H|Hidden', + 2048 => 'T|Backend', + 4096 => 'L|Local', + 8192 => 'T|Root', 16384 => 'CI|Circle Invite', 32768 => 'F|Federated', 65536 => 'M|Nountpoint' @@ -142,11 +138,11 @@ class Circle extends ManagedModel implements IMemberships, IDeserializable, INC2 * @var array */ public static $DEF_SOURCE = [ - 1 => 'Nextcloud User', - 2 => 'Nextcloud Group', - 4 => 'Email Address', - 8 => 'Contact', - 16 => 'Circle', + 1 => 'Nextcloud User', + 2 => 'Nextcloud Group', + 4 => 'Email Address', + 8 => 'Contact', + 16 => 'Circle', 10001 => 'Circles App', 10002 => 'Admin Command Line' ]; @@ -743,18 +739,18 @@ public function import(array $data): IDeserializable { */ public function jsonSerialize(): array { $arr = [ - 'id' => $this->getSingleId(), - 'name' => $this->getName(), - 'displayName' => $this->getDisplayName(), + 'id' => $this->getSingleId(), + 'name' => $this->getName(), + 'displayName' => $this->getDisplayName(), 'sanitizedName' => $this->getSanitizedName(), - 'source' => $this->getSource(), - 'population' => $this->getPopulation(), - 'config' => $this->getConfig(), - 'description' => $this->getDescription(), - 'settings' => $this->getSettings(), - 'url' => $this->getUrl(), - 'creation' => $this->getCreation(), - 'initiator' => ($this->hasInitiator()) ? $this->getInitiator() : null + 'source' => $this->getSource(), + 'population' => $this->getPopulation(), + 'config' => $this->getConfig(), + 'description' => $this->getDescription(), + 'settings' => $this->getSettings(), + 'url' => $this->getUrl(), + 'creation' => $this->getCreation(), + 'initiator' => ($this->hasInitiator()) ? $this->getInitiator() : null ]; if ($this->hasOwner()) { @@ -850,7 +846,7 @@ public static function getCircleFlags(Circle $circle, int $display = self::FLAGS $config = []; foreach (array_keys(Circle::$DEF_CFG) as $def) { if ($circle->isConfig($def)) { - list($short, $long) = explode('|', Circle::$DEF_CFG[$def]); + [$short, $long] = explode('|', Circle::$DEF_CFG[$def]); switch ($display) { case self::FLAGS_SHORT: @@ -866,6 +862,4 @@ public static function getCircleFlags(Circle $circle, int $display = self::FLAGS return $config; } - } - diff --git a/lib/Model/DavCard.php b/lib/Model/DavCard.php index ec92fcb89..112968e51 100644 --- a/lib/Model/DavCard.php +++ b/lib/Model/DavCard.php @@ -29,24 +29,20 @@ namespace OCA\Circles\Model; - use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use JsonSerializable; - /** * Class DavCard * * @package OCA\Circles\Model */ class DavCard implements JsonSerializable { - - use TArrayTools; - const TYPE_CONTACT = 1; - const TYPE_LOCAL = 2; + public const TYPE_CONTACT = 1; + public const TYPE_LOCAL = 2; // const TYPE_FEDERATED = 3; @@ -334,10 +330,10 @@ public function importFromDav(string $dav) { */ private function parseDav(string $dav): array { $result = [ - 'UID' => '', - 'FN' => '', - 'EMAILS' => [], - 'CLOUDS' => [], + 'UID' => '', + 'FN' => '', + 'EMAILS' => [], + 'CLOUDS' => [], 'CATEGORIES' => [] ]; @@ -346,11 +342,11 @@ private function parseDav(string $dav): array { if (trim($entry) === '' || strpos($entry, ':') === false) { continue; } - list($k, $v) = explode(':', $entry, 2); + [$k, $v] = explode(':', $entry, 2); $k = strtoupper($k); if (strpos($entry, ';') !== false) { - list($k) = explode(';', $entry, 2); + [$k] = explode(';', $entry, 2); } switch ($k) { @@ -382,7 +378,6 @@ private function parseDav(string $dav): array { } return $result; - } @@ -392,16 +387,15 @@ private function parseDav(string $dav): array { public function jsonSerialize(): array { return [ 'addressBookId' => $this->getAddressBookId(), - 'owner' => $this->getOwner(), - 'cardUri' => $this->getCardUri(), - 'contactId' => $this->getContactId(), - 'uniqueId' => $this->getUniqueId(), - 'fn' => $this->getFn(), - 'emails' => $this->getEmails(), - 'clouds' => $this->getClouds(), - 'groups' => $this->getGroups(), - 'userId' => $this->getUserId() + 'owner' => $this->getOwner(), + 'cardUri' => $this->getCardUri(), + 'contactId' => $this->getContactId(), + 'uniqueId' => $this->getUniqueId(), + 'fn' => $this->getFn(), + 'emails' => $this->getEmails(), + 'clouds' => $this->getClouds(), + 'groups' => $this->getGroups(), + 'userId' => $this->getUserId() ]; } - } diff --git a/lib/Model/DeprecatedCircle.php b/lib/Model/DeprecatedCircle.php index 11301f28c..56b530fa2 100644 --- a/lib/Model/DeprecatedCircle.php +++ b/lib/Model/DeprecatedCircle.php @@ -32,8 +32,6 @@ use OCA\Circles\Exceptions\FederatedCircleNotAllowedException; class DeprecatedCircle extends BaseCircle implements JsonSerializable { - - use TArrayTools; @@ -85,23 +83,23 @@ public function setFullJson(bool $fullJson): self { public function jsonSerialize() { $json = [ - 'id' => $this->getId(), - 'name' => $this->getName(true), - 'alt_name' => $this->getAltName(), - 'owner' => $this->getOwner(), - 'user' => $this->getViewer(), - 'group' => $this->getGroupViewer(), - 'viewer' => $this->getHigherViewer(), - 'description' => $this->getDescription(), - 'settings' => $this->getSettings(), - 'type' => $this->getType(), - 'creation' => $this->getCreation(), - 'type_string' => $this->getTypeString(), + 'id' => $this->getId(), + 'name' => $this->getName(true), + 'alt_name' => $this->getAltName(), + 'owner' => $this->getOwner(), + 'user' => $this->getViewer(), + 'group' => $this->getGroupViewer(), + 'viewer' => $this->getHigherViewer(), + 'description' => $this->getDescription(), + 'settings' => $this->getSettings(), + 'type' => $this->getType(), + 'creation' => $this->getCreation(), + 'type_string' => $this->getTypeString(), 'type_long_string' => $this->getTypeLongString(), - 'unique_id' => $this->getUniqueId($this->fullJson), - 'members' => $this->getMembers(), - 'groups' => $this->getGroups(), - 'links' => $this->getLinks() + 'unique_id' => $this->getUniqueId($this->fullJson), + 'members' => $this->getMembers(), + 'groups' => $this->getGroups(), + 'links' => $this->getLinks() ]; if ($this->lightJson) { @@ -194,7 +192,6 @@ private static function getMemberFromArray($arr, $key, $type = DeprecatedMember: } return null; - } @@ -292,7 +289,7 @@ public static function typeLongString($type) { * @return int */ public static function convertTypeToConfig(int $type): int { - switch($type) { + switch ($type) { case DeprecatedCircle::CIRCLES_PERSONAL: return 2; case DeprecatedCircle::CIRCLES_SECRET: @@ -305,8 +302,4 @@ public static function convertTypeToConfig(int $type): int { return 0; } - - } - - diff --git a/lib/Model/DeprecatedMember.php b/lib/Model/DeprecatedMember.php index 7965e9cd8..a79146d71 100644 --- a/lib/Model/DeprecatedMember.php +++ b/lib/Model/DeprecatedMember.php @@ -31,18 +31,13 @@ use OCA\Circles\Exceptions\MemberCantJoinCircleException; use OCA\Circles\Exceptions\MemberDoesNotExistException; use OCA\Circles\Exceptions\MemberIsBlockedException; -use OCA\Circles\Exceptions\MemberIsNotAdminException; use OCA\Circles\Exceptions\MemberIsNotModeratorException; -use OCA\Circles\Exceptions\MemberIsNotOwnerException; use OCA\Circles\Exceptions\MemberIsOwnerException; use OCA\Circles\Exceptions\MemberTypeCantEditLevelException; use OCA\Circles\Exceptions\ModeratorIsNotHighEnoughException; class DeprecatedMember extends BaseMember { - - public function inviteToCircle($circleType) { - if ($circleType === 0) { throw new CircleTypeNotValidException('Invalid circle type'); } @@ -61,7 +56,6 @@ public function inviteToCircle($circleType) { * @throws MemberCantJoinCircleException */ public function joinCircle($circleType) { - switch ($circleType) { case DeprecatedCircle::CIRCLES_SECRET: case DeprecatedCircle::CIRCLES_PUBLIC: @@ -79,7 +73,6 @@ public function joinCircle($circleType) { * Update status of member like he joined a public circle. */ public function addMemberToCircle() { - if ($this->getStatus() === DeprecatedMember::STATUS_NONMEMBER || $this->getStatus() === DeprecatedMember::STATUS_KICKED ) { @@ -93,7 +86,6 @@ public function addMemberToCircle() { * (invite/request) */ private function joinClosedCircle() { - switch ($this->getStatus()) { case DeprecatedMember::STATUS_NONMEMBER: case DeprecatedMember::STATUS_KICKED: @@ -229,7 +221,6 @@ public function levelHasToBeEditable() { * @throws MemberIsBlockedException */ public function hasToBeAbleToJoinTheCircle() { - if ($this->getLevel() > 0) { throw new MemberAlreadyExistsException( $this->l10n->t("You are already a member of this circle") @@ -248,7 +239,6 @@ public function hasToBeAbleToJoinTheCircle() { * @throws MemberAlreadyExistsException */ public function hasToBeInviteAble() { - if ($this->getLevel() > 0) { throw new MemberAlreadyExistsException( $this->l10n->t("The user is already a member of this circle") @@ -261,7 +251,4 @@ public function hasToBeInviteAble() { ); } } - } - - diff --git a/lib/Model/Federated/EventWrapper.php b/lib/Model/Federated/EventWrapper.php index c6f73fb15..798ceb755 100644 --- a/lib/Model/Federated/EventWrapper.php +++ b/lib/Model/Federated/EventWrapper.php @@ -31,29 +31,25 @@ namespace OCA\Circles\Model\Federated; - use ArtificialOwl\MySmallPhpTools\Db\Nextcloud\nc22\INC22QueryRow; use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use JsonSerializable; - /** * Class EventWrapper * * @package OCA\Circles\Model\Remote */ class EventWrapper implements INC22QueryRow, JsonSerializable { - - use TArrayTools; - const STATUS_INIT = 0; - const STATUS_FAILED = 1; - const STATUS_DONE = 8; - const STATUS_OVER = 9; + public const STATUS_INIT = 0; + public const STATUS_FAILED = 1; + public const STATUS_DONE = 8; + public const STATUS_OVER = 9; /** @var string */ @@ -84,7 +80,7 @@ class EventWrapper implements INC22QueryRow, JsonSerializable { private $creation; - function __construct() { + public function __construct() { $this->result = new SimpleDataStore(); } @@ -293,15 +289,15 @@ public function import(array $data): self { /** * @return array */ - function jsonSerialize(): array { + public function jsonSerialize(): array { return [ - 'token' => $this->getToken(), - 'instance' => $this->getInstance(), + 'token' => $this->getToken(), + 'instance' => $this->getInstance(), 'interface' => $this->getInterface(), - 'event' => $this->getEvent(), - 'result' => $this->getResult(), - 'severity' => $this->getSeverity(), - 'status' => $this->getStatus() + 'event' => $this->getEvent(), + 'result' => $this->getResult(), + 'severity' => $this->getSeverity(), + 'status' => $this->getStatus() // 'creation' => $this->getCreation() ]; } @@ -328,6 +324,4 @@ public function importFromDatabase(array $data): INC22QueryRow { return $this; } - } - diff --git a/lib/Model/Federated/FederatedEvent.php b/lib/Model/Federated/FederatedEvent.php index 441b7bc5a..5dcaf6c53 100644 --- a/lib/Model/Federated/FederatedEvent.php +++ b/lib/Model/Federated/FederatedEvent.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Model\Federated; - use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; @@ -39,23 +38,20 @@ use OCA\Circles\Model\Circle; use OCA\Circles\Model\Member; - /** * Class FederatedEvent * * @package OCA\Circles\Model\Federated */ class FederatedEvent implements JsonSerializable { + public const SEVERITY_LOW = 1; + public const SEVERITY_HIGH = 3; - - const SEVERITY_LOW = 1; - const SEVERITY_HIGH = 3; - - const BYPASS_CIRCLE = 1; - const BYPASS_LOCALCIRCLECHECK = 2; - const BYPASS_LOCALMEMBERCHECK = 4; - const BYPASS_INITIATORCHECK = 8; - const BYPASS_INITIATORMEMBERSHIP = 16; + public const BYPASS_CIRCLE = 1; + public const BYPASS_LOCALCIRCLECHECK = 2; + public const BYPASS_LOCALMEMBERCHECK = 4; + public const BYPASS_INITIATORCHECK = 8; + public const BYPASS_INITIATORMEMBERSHIP = 16; use TArrayTools; @@ -121,7 +117,7 @@ class FederatedEvent implements JsonSerializable { * * @param string $class */ - function __construct(string $class = '') { + public function __construct(string $class = '') { $this->class = $class; $this->params = new SimpleDataStore(); $this->data = new SimpleDataStore(); @@ -586,18 +582,18 @@ public function import(array $data): self { /** * @return array */ - function jsonSerialize(): array { + public function jsonSerialize(): array { $arr = [ - 'class' => $this->getClass(), + 'class' => $this->getClass(), 'severity' => $this->getSeverity(), - 'params' => $this->getParams(), - 'data' => $this->getData(), - 'result' => $this->getResult(), - 'origin' => $this->getOrigin(), - 'sender' => $this->getSender(), - 'itemId' => $this->getItemId(), - 'outcome' => $this->getOutcome(), - 'members' => $this->getMembers() + 'params' => $this->getParams(), + 'data' => $this->getData(), + 'result' => $this->getResult(), + 'origin' => $this->getOrigin(), + 'sender' => $this->getSender(), + 'itemId' => $this->getItemId(), + 'outcome' => $this->getOutcome(), + 'members' => $this->getMembers() ]; if ($this->hasCircle()) { @@ -609,6 +605,4 @@ function jsonSerialize(): array { return $arr; } - } - diff --git a/lib/Model/Federated/FederatedShare.php b/lib/Model/Federated/FederatedShare.php index aebbf5cf0..44b52caa7 100644 --- a/lib/Model/Federated/FederatedShare.php +++ b/lib/Model/Federated/FederatedShare.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Model\Federated; - use ArtificialOwl\MySmallPhpTools\Db\Nextcloud\nc22\INC22QueryRow; use ArtificialOwl\MySmallPhpTools\IDeserializable; use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; @@ -40,15 +39,12 @@ use OCA\Circles\IFederatedModel; use OCA\Circles\Model\ManagedModel; - /** * Class FederatedShare * * @package OCA\Circles\Model\Federated */ class FederatedShare extends ManagedModel implements IFederatedModel, JsonSerializable, INC22QueryRow, IDeserializable { - - use TArrayTools; @@ -74,7 +70,7 @@ class FederatedShare extends ManagedModel implements IFederatedModel, JsonSerial /** * FederatedShare constructor. */ - function __construct() { + public function __construct() { } @@ -220,12 +216,10 @@ public function importFromDatabase(array $data): INC22QueryRow { */ public function jsonSerialize(): array { return [ - 'id' => $this->getId(), - 'itemId' => $this->getItemId(), + 'id' => $this->getId(), + 'itemId' => $this->getItemId(), 'circleId' => $this->getCircleId(), 'instance' => $this->getInstance() ]; } - } - diff --git a/lib/Model/Federated/RemoteInstance.php b/lib/Model/Federated/RemoteInstance.php index 95dd01420..f214b4302 100644 --- a/lib/Model/Federated/RemoteInstance.php +++ b/lib/Model/Federated/RemoteInstance.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Model\Federated; - use ArtificialOwl\MySmallPhpTools\Db\Nextcloud\nc22\INC22QueryRow; use ArtificialOwl\MySmallPhpTools\Model\Nextcloud\nc22\NC22Signatory; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; @@ -39,22 +38,19 @@ use OCA\Circles\Exceptions\RemoteNotFoundException; use OCA\Circles\Exceptions\RemoteUidException; - /** * Class AppService * * @package OCA\Circles\Model */ class RemoteInstance extends NC22Signatory implements INC22QueryRow, JsonSerializable { - - use TArrayTools; - const TYPE_UNKNOWN = 'Unknown'; // not trusted - const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. - const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. - const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. - const TYPE_GLOBALSCALE = 'GlobalScale'; // every Circle is broadcasted, + public const TYPE_UNKNOWN = 'Unknown'; // not trusted + public const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. + public const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. + public const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. + public const TYPE_GLOBALSCALE = 'GlobalScale'; // every Circle is broadcasted, public static $LIST_TYPE = [ self::TYPE_UNKNOWN, @@ -64,13 +60,13 @@ class RemoteInstance extends NC22Signatory implements INC22QueryRow, JsonSeriali self::TYPE_GLOBALSCALE ]; - const TEST = 'test'; - const INCOMING = 'incoming'; - const EVENT = 'event'; - const CIRCLES = 'circles'; - const CIRCLE = 'circle'; - const MEMBERS = 'members'; - const MEMBER = 'member'; + public const TEST = 'test'; + public const INCOMING = 'incoming'; + public const EVENT = 'event'; + public const CIRCLES = 'circles'; + public const CIRCLE = 'circle'; + public const MEMBERS = 'members'; + public const MEMBER = 'member'; /** @var int */ @@ -450,7 +446,7 @@ public function import(array $data): NC22Signatory { $algo = ''; $authSigned = trim($this->get('auth-signed', $data), ':'); if (strpos($authSigned, ':') > 0) { - list($algo, $authSigned) = explode(':', $authSigned); + [$algo, $authSigned] = explode(':', $authSigned); } $this->setAuthSigned($authSigned) @@ -465,15 +461,15 @@ public function import(array $data): NC22Signatory { */ public function jsonSerialize(): array { $data = [ - 'uid' => $this->getUid(true), - 'root' => $this->getRoot(), - 'event' => $this->getEvent(), + 'uid' => $this->getUid(true), + 'root' => $this->getRoot(), + 'event' => $this->getEvent(), 'incoming' => $this->getIncoming(), - 'test' => $this->getTest(), - 'circles' => $this->getCircles(), - 'circle' => $this->getCircle(), - 'members' => $this->getMembers(), - 'member' => $this->getMember(), + 'test' => $this->getTest(), + 'circles' => $this->getCircles(), + 'circle' => $this->getCircle(), + 'members' => $this->getMembers(), + 'member' => $this->getMember(), ]; if ($this->getAuthSigned() !== '') { @@ -510,6 +506,4 @@ public function importFromDatabase(array $data, string $prefix = ''): INC22Query return $this; } - } - diff --git a/lib/Model/FederatedLink.php b/lib/Model/FederatedLink.php index 20812e830..da00ce89c 100644 --- a/lib/Model/FederatedLink.php +++ b/lib/Model/FederatedLink.php @@ -29,18 +29,16 @@ use OCA\Circles\Exceptions\FederatedCircleStatusUpdateException; class FederatedLink implements \JsonSerializable { + public const STATUS_ERROR = -1; + public const STATUS_LINK_REMOVE = 0; + public const STATUS_LINK_DOWN = 1; + public const STATUS_LINK_SETUP = 2; + public const STATUS_REQUEST_DECLINED = 4; + public const STATUS_REQUEST_SENT = 5; + public const STATUS_LINK_REQUESTED = 6; + public const STATUS_LINK_UP = 9; - - const STATUS_ERROR = -1; - const STATUS_LINK_REMOVE = 0; - const STATUS_LINK_DOWN = 1; - const STATUS_LINK_SETUP = 2; - const STATUS_REQUEST_DECLINED = 4; - const STATUS_REQUEST_SENT = 5; - const STATUS_LINK_REQUESTED = 6; - const STATUS_LINK_UP = 9; - - const SHORT_UNIQUE_ID_LENGTH = 12; + public const SHORT_UNIQUE_ID_LENGTH = 12; /** @var int */ private $id; @@ -194,7 +192,6 @@ public function getCircleId($full = false) { } return substr($this->circleUniqueId, 0, DeprecatedCircle::SHORT_UNIQUE_ID_LENGTH); - } @@ -309,7 +306,6 @@ public function hasToBeValidStatusUpdate($status) { $this->hasToBeValidStatusUpdateWhileRequestDeclined($status); $this->hasToBeValidStatusUpdateWhileLinkRequested($status); $this->hasToBeValidStatusUpdateWhileRequestSent($status); - } catch (FederatedCircleStatusUpdateException $e) { throw new FederatedCircleStatusUpdateException('The status could not be updated'); } @@ -322,7 +318,6 @@ public function hasToBeValidStatusUpdate($status) { * @throws FederatedCircleStatusUpdateException */ private function hasToBeValidStatusUpdateWhileLinkDown($status) { - if ($this->getStatus() === self::STATUS_LINK_DOWN) { return; } @@ -385,15 +380,15 @@ private function hasToBeValidStatusUpdateWhileRequestSent($status) { public function jsonSerialize() { - return array( - 'id' => $this->getId(), - 'token' => $this->getToken($this->fullJson), - 'address' => $this->getAddress(), - 'status' => $this->getStatus(), + return [ + 'id' => $this->getId(), + 'token' => $this->getToken($this->fullJson), + 'address' => $this->getAddress(), + 'status' => $this->getStatus(), 'circle_id' => $this->getCircleId(), 'unique_id' => $this->getUniqueId($this->fullJson), - 'creation' => $this->getCreation() - ); + 'creation' => $this->getCreation() + ]; } @@ -428,5 +423,4 @@ public static function fromArray($arr) { public static function fromJSON($json) { return self::fromArray(json_decode($json, true)); } - } diff --git a/lib/Model/FederatedUser.php b/lib/Model/FederatedUser.php index 1fa08a065..5b85945ff 100644 --- a/lib/Model/FederatedUser.php +++ b/lib/Model/FederatedUser.php @@ -43,7 +43,6 @@ use OCA\Circles\IFederatedUser; use OCA\Circles\IMemberships; - /** * Class FederatedUser * @@ -55,8 +54,6 @@ class FederatedUser extends ManagedModel implements IDeserializable, INC22QueryRow, JsonSerializable { - - use TArrayTools; use TNC22Deserialize; @@ -421,11 +418,11 @@ public function importFromDatabase(array $data, string $prefix = ''): INC22Query */ public function jsonSerialize(): array { $arr = [ - 'id' => $this->getSingleId(), - 'userId' => $this->getUserId(), - 'userType' => $this->getUserType(), + 'id' => $this->getSingleId(), + 'userId' => $this->getUserId(), + 'userType' => $this->getUserType(), 'displayName' => $this->getDisplayName(), - 'instance' => $this->getManager()->fixInstance($this->getInstance()) + 'instance' => $this->getManager()->fixInstance($this->getInstance()) ]; if ($this->hasBasedOn()) { @@ -458,6 +455,4 @@ public function compareWith(IFederatedUser $member): bool { || $this->getUserType() <> $member->getUserType() || (!$local && $this->getInstance() !== $member->getInstance())); } - } - diff --git a/lib/Model/FileCacheWrapper.php b/lib/Model/FileCacheWrapper.php index 3e67833eb..535d83eec 100644 --- a/lib/Model/FileCacheWrapper.php +++ b/lib/Model/FileCacheWrapper.php @@ -39,15 +39,12 @@ use OCA\Circles\Db\CoreQueryBuilder; use OCA\Circles\Exceptions\FileCacheNotFoundException; - /** * Class FileCacheWrapper * * @package OCA\Circles\Model */ class FileCacheWrapper extends ManagedModel implements INC22QueryRow, IDeserializable, JsonSerializable { - - use TArrayTools; @@ -427,22 +424,22 @@ public function getParent(): int { */ public function toCache(): array { return [ - 'fileid' => $this->getId(), - 'path' => $this->getPath(), - 'permissions' => $this->getPermissions(), - 'storage' => $this->getStorageId(), // strange, it is not !? - 'path_hash' => $this->getPathHash(), - 'parent' => $this->getParent(), - 'name' => $this->getName(), - 'mimetype' => $this->getMimeType(), - 'mimepart' => $this->getMimePart(), - 'size' => $this->getSize(), - 'mtime' => $this->getMTime(), - 'storage_mtime' => $this->getStorageMTime(), - 'encrypted' => $this->isEncrypted(), + 'fileid' => $this->getId(), + 'path' => $this->getPath(), + 'permissions' => $this->getPermissions(), + 'storage' => $this->getStorageId(), // strange, it is not !? + 'path_hash' => $this->getPathHash(), + 'parent' => $this->getParent(), + 'name' => $this->getName(), + 'mimetype' => $this->getMimeType(), + 'mimepart' => $this->getMimePart(), + 'size' => $this->getSize(), + 'mtime' => $this->getMTime(), + 'storage_mtime' => $this->getStorageMTime(), + 'encrypted' => $this->isEncrypted(), 'unencrypted_size' => $this->getUnencryptedSize(), - 'etag' => $this->getEtag(), - 'checksum' => $this->getChecksum() + 'etag' => $this->getEtag(), + 'checksum' => $this->getChecksum() ]; } @@ -537,25 +534,23 @@ public function importFromDatabase(array $data, string $prefix = ''): INC22Query */ public function jsonSerialize(): array { return [ - 'id' => $this->getId(), - 'path' => $this->getPath(), - 'permissions' => $this->getPermissions(), - 'storage' => $this->getStorage(), - 'storageId' => $this->getStorageId(), - 'pathHash' => $this->getPathHash(), - 'parent' => $this->getParent(), - 'name' => $this->getName(), - 'mimeType' => $this->getMimeType(), - 'mimePart' => $this->getMimePart(), - 'size' => $this->getSize(), - 'mTime' => $this->getMTime(), - 'storageMTime' => $this->getStorageMTime(), - 'encrypted' => $this->isEncrypted(), + 'id' => $this->getId(), + 'path' => $this->getPath(), + 'permissions' => $this->getPermissions(), + 'storage' => $this->getStorage(), + 'storageId' => $this->getStorageId(), + 'pathHash' => $this->getPathHash(), + 'parent' => $this->getParent(), + 'name' => $this->getName(), + 'mimeType' => $this->getMimeType(), + 'mimePart' => $this->getMimePart(), + 'size' => $this->getSize(), + 'mTime' => $this->getMTime(), + 'storageMTime' => $this->getStorageMTime(), + 'encrypted' => $this->isEncrypted(), 'unencryptedSize' => $this->getUnencryptedSize(), - 'etag' => $this->getEtag(), - 'checksum' => $this->getChecksum() + 'etag' => $this->getEtag(), + 'checksum' => $this->getChecksum() ]; } - } - diff --git a/lib/Model/GlobalScale/GSEvent.php b/lib/Model/GlobalScale/GSEvent.php index 6190d441d..39a0fce09 100644 --- a/lib/Model/GlobalScale/GSEvent.php +++ b/lib/Model/GlobalScale/GSEvent.php @@ -1,4 +1,6 @@ -type = $type; $this->local = $local; $this->force = $force; @@ -451,16 +449,16 @@ public function import(array $data): self { /** * @return array */ - function jsonSerialize(): array { + public function jsonSerialize(): array { $arr = [ - 'type' => $this->getType(), + 'type' => $this->getType(), 'severity' => $this->getSeverity(), - 'data' => $this->getData(), - 'result' => $this->getResult(), - 'key' => $this->getKey(), - 'source' => $this->getSource(), - 'force' => $this->isForced(), - 'async' => $this->isAsync() + 'data' => $this->getData(), + 'result' => $this->getResult(), + 'key' => $this->getKey(), + 'source' => $this->getSource(), + 'force' => $this->isForced(), + 'async' => $this->isAsync() ]; if ($this->hasCircle()) { @@ -474,7 +472,4 @@ function jsonSerialize(): array { return $arr; } - - } - diff --git a/lib/Model/GlobalScale/GSShare.php b/lib/Model/GlobalScale/GSShare.php index 1ab6bb36c..8c2b3da27 100644 --- a/lib/Model/GlobalScale/GSShare.php +++ b/lib/Model/GlobalScale/GSShare.php @@ -1,4 +1,6 @@ - $this->getOwner(), - 'remote' => $protocol . '://' . $this->getInstance(), - 'token' => $this->getToken(), + 'owner' => $this->getOwner(), + 'remote' => $protocol . '://' . $this->getInstance(), + 'token' => $this->getToken(), 'share_token' => $this->getToken(), - 'password' => $this->getPassword(), - 'mountpoint' => $this->getMountPoint($userId) + 'password' => $this->getPassword(), + 'mountpoint' => $this->getMountPoint($userId) ]; } @@ -305,18 +303,16 @@ public function toMount(string $userId, string $protocol = 'https'): array { /** * @return array */ - function jsonSerialize(): array { + public function jsonSerialize(): array { return [ - 'id' => $this->getId(), + 'id' => $this->getId(), 'defaultMountPoint' => $this->getDefaultMountPoint(), - 'mountPoint' => $this->getMountPoint(), - 'parent' => $this->getParent(), - 'owner' => $this->getOwner(), - 'instance' => $this->getInstance(), - 'token' => $this->getToken(), - 'password' => $this->getPassword() + 'mountPoint' => $this->getMountPoint(), + 'parent' => $this->getParent(), + 'owner' => $this->getOwner(), + 'instance' => $this->getInstance(), + 'token' => $this->getToken(), + 'password' => $this->getPassword() ]; } - } - diff --git a/lib/Model/GlobalScale/GSShareMountpoint.php b/lib/Model/GlobalScale/GSShareMountpoint.php index 8776f6747..2cb146e80 100644 --- a/lib/Model/GlobalScale/GSShareMountpoint.php +++ b/lib/Model/GlobalScale/GSShareMountpoint.php @@ -1,4 +1,6 @@ - $this->getUserId(), - 'shareId' => $this->getShareId(), + 'userId' => $this->getUserId(), + 'shareId' => $this->getShareId(), 'mountPoint' => $this->getMountPoint(), ]; } - } - diff --git a/lib/Model/GlobalScale/GSWrapper.php b/lib/Model/GlobalScale/GSWrapper.php index 65ad5e7a9..235b4aa92 100644 --- a/lib/Model/GlobalScale/GSWrapper.php +++ b/lib/Model/GlobalScale/GSWrapper.php @@ -1,4 +1,6 @@ - $this->getToken(), - 'event' => $this->getEvent(), + 'id' => $this->getToken(), + 'event' => $this->getEvent(), 'severity' => $this->getSeverity(), - 'status' => $this->getStatus(), + 'status' => $this->getStatus(), 'creation' => $this->getCreation() ]; @@ -237,6 +235,4 @@ function jsonSerialize(): array { return $arr; } - } - diff --git a/lib/Model/Helpers/MemberHelper.php b/lib/Model/Helpers/MemberHelper.php index 6a001228e..0ae5fb7b4 100644 --- a/lib/Model/Helpers/MemberHelper.php +++ b/lib/Model/Helpers/MemberHelper.php @@ -37,7 +37,6 @@ use OCA\Circles\Exceptions\ParseMemberLevelException; use OCA\Circles\Model\Member; - /** * Class MemberHelper * @@ -53,8 +52,6 @@ * @package OCA\Circles\Model\Helpers */ class MemberHelper { - - use TArrayTools; @@ -186,7 +183,4 @@ public function mustBeHigherLevelThan(Member $compare) { public function mustBeHigherOrSameLevelThan(Member $compare) { $this->mustHaveLevelEqualOrAbove($compare->getLevel()); } - - } - diff --git a/lib/Model/ManagedModel.php b/lib/Model/ManagedModel.php index 2be98215d..b2686cc5f 100644 --- a/lib/Model/ManagedModel.php +++ b/lib/Model/ManagedModel.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Model; - use OC; use OCA\Circles\IFederatedUser; @@ -41,9 +40,7 @@ * @package OCA\Circles\Model */ class ManagedModel { - - - const ID_LENGTH = 31; + public const ID_LENGTH = 31; /** @var ModelManager */ @@ -80,6 +77,4 @@ public function importFromIFederatedUser(IFederatedUser $orig): void { $this->setInstance($orig->getInstance()); } - } - diff --git a/lib/Model/Member.php b/lib/Model/Member.php index 92f4287a3..7f3961903 100644 --- a/lib/Model/Member.php +++ b/lib/Model/Member.php @@ -48,7 +48,6 @@ use OCA\Circles\IMemberships; use OCA\Circles\Model\Federated\RemoteInstance; - /** * Class Member * @@ -60,37 +59,35 @@ class Member extends ManagedModel implements IDeserializable, INC22QueryRow, JsonSerializable { - - use TArrayTools; use TNC22Deserialize; - const LEVEL_NONE = 0; - const LEVEL_MEMBER = 1; - const LEVEL_MODERATOR = 4; - const LEVEL_ADMIN = 8; - const LEVEL_OWNER = 9; + public const LEVEL_NONE = 0; + public const LEVEL_MEMBER = 1; + public const LEVEL_MODERATOR = 4; + public const LEVEL_ADMIN = 8; + public const LEVEL_OWNER = 9; - const TYPE_SINGLE = 0; - const TYPE_USER = 1; - const TYPE_GROUP = 2; - const TYPE_MAIL = 4; - const TYPE_CONTACT = 8; - const TYPE_CIRCLE = 16; - const TYPE_APP = 10000; + public const TYPE_SINGLE = 0; + public const TYPE_USER = 1; + public const TYPE_GROUP = 2; + public const TYPE_MAIL = 4; + public const TYPE_CONTACT = 8; + public const TYPE_CIRCLE = 16; + public const TYPE_APP = 10000; - const APP_CIRCLES = 10001; - const APP_OCC = 10002; + public const APP_CIRCLES = 10001; + public const APP_OCC = 10002; public static $TYPE = [ - 0 => 'single', - 1 => 'user', - 2 => 'group', - 4 => 'mail', - 8 => 'contact', - 16 => 'circle', + 0 => 'single', + 1 => 'user', + 2 => 'group', + 4 => 'mail', + 8 => 'contact', + 16 => 'circle', 10000 => 'app' ]; @@ -99,10 +96,10 @@ class Member extends ManagedModel implements * * @see Capabilities::generateConstantsMember() */ - const STATUS_INVITED = 'Invited'; - const STATUS_REQUEST = 'Requesting'; - const STATUS_MEMBER = 'Member'; - const STATUS_BLOCKED = 'Blocked'; + public const STATUS_INVITED = 'Invited'; + public const STATUS_REQUEST = 'Requesting'; + public const STATUS_MEMBER = 'Member'; + public const STATUS_BLOCKED = 'Blocked'; /** @@ -891,21 +888,21 @@ public function importFromDatabase(array $data, string $prefix = ''): INC22Query */ public function jsonSerialize(): array { $arr = [ - 'id' => $this->getId(), - 'circleId' => $this->getCircleId(), - 'singleId' => $this->getSingleId(), - 'userId' => $this->getUserId(), - 'userType' => $this->getUserType(), - 'instance' => $this->getManager()->fixInstance($this->getInstance()), - 'local' => $this->isLocal(), - 'level' => $this->getLevel(), - 'status' => $this->getStatus(), - 'displayName' => $this->getDisplayName(), + 'id' => $this->getId(), + 'circleId' => $this->getCircleId(), + 'singleId' => $this->getSingleId(), + 'userId' => $this->getUserId(), + 'userType' => $this->getUserType(), + 'instance' => $this->getManager()->fixInstance($this->getInstance()), + 'local' => $this->isLocal(), + 'level' => $this->getLevel(), + 'status' => $this->getStatus(), + 'displayName' => $this->getDisplayName(), 'displayUpdate' => $this->getDisplayUpdate(), - 'notes' => $this->getNotes(), - 'contactId' => $this->getContactId(), - 'contactMeta' => $this->getContactMeta(), - 'joined' => $this->getJoined() + 'notes' => $this->getNotes(), + 'contactId' => $this->getContactId(), + 'contactMeta' => $this->getContactMeta(), + 'joined' => $this->getJoined() ]; if ($this->hasInvitedBy()) { @@ -994,6 +991,4 @@ public static function parseTypeString(string $typeString): int { return (int)$type; } - } - diff --git a/lib/Model/Membership.php b/lib/Model/Membership.php index d866470bd..77e7c12f0 100644 --- a/lib/Model/Membership.php +++ b/lib/Model/Membership.php @@ -38,15 +38,12 @@ use JsonSerializable; use OCA\Circles\Exceptions\MembershipNotFoundException; - /** * Class Membership * * @package OCA\Circles\Model */ class Membership extends ManagedModel implements IDeserializable, INC22QueryRow, JsonSerializable { - - use TArrayTools; @@ -327,13 +324,13 @@ public function importFromDatabase(array $data, string $prefix = ''): INC22Query */ public function jsonSerialize(): array { $result = [ - 'singleId' => $this->getSingleId(), - 'circleId' => $this->getCircleId(), - 'circleConfig' => $this->getCircleConfig(), - 'level' => $this->getLevel(), + 'singleId' => $this->getSingleId(), + 'circleId' => $this->getCircleId(), + 'circleConfig' => $this->getCircleConfig(), + 'level' => $this->getLevel(), 'inheritanceFirst' => $this->getInheritanceFirst(), - 'inheritanceLast' => $this->getInheritanceLast(), - 'inheritancePath' => $this->getInheritancePath(), + 'inheritanceLast' => $this->getInheritanceLast(), + 'inheritancePath' => $this->getInheritancePath(), 'inheritanceDepth' => $this->getInheritanceDepth() ]; @@ -343,6 +340,4 @@ public function jsonSerialize(): array { return $result; } - } - diff --git a/lib/Model/ModelManager.php b/lib/Model/ModelManager.php index 8cff0f4f1..9a36771ed 100644 --- a/lib/Model/ModelManager.php +++ b/lib/Model/ModelManager.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Model; - use OCA\Circles\Db\CoreQueryBuilder; use OCA\Circles\Db\MemberRequest; use OCA\Circles\Db\MembershipRequest; @@ -220,7 +219,7 @@ private function importBasedOnPath(ManagedModel $model, array $data, string $pat */ private function importIntoCircle(Circle $circle, array $data, string $path, string $prefix): void { switch ($path) { - case CoreQueryBuilder::OWNER; + case CoreQueryBuilder::OWNER: try { $owner = new Member(); $owner->importFromDatabase($data, $prefix); @@ -229,7 +228,7 @@ private function importIntoCircle(Circle $circle, array $data, string $path, str } break; - case CoreQueryBuilder::INITIATOR; + case CoreQueryBuilder::INITIATOR: try { $initiator = new Member(); $initiator->importFromDatabase($data, $prefix); @@ -238,7 +237,7 @@ private function importIntoCircle(Circle $circle, array $data, string $path, str } break; - case CoreQueryBuilder::DIRECT_INITIATOR; + case CoreQueryBuilder::DIRECT_INITIATOR: try { $directInitiator = new Member(); $directInitiator->importFromDatabase($data, $prefix); @@ -258,7 +257,7 @@ private function importIntoCircle(Circle $circle, array $data, string $path, str */ private function importIntoMember(Member $member, array $data, string $path, string $prefix): void { switch ($path) { - case CoreQueryBuilder::CIRCLE; + case CoreQueryBuilder::CIRCLE: try { $circle = new Circle(); $circle->importFromDatabase($data, $prefix); @@ -267,7 +266,7 @@ private function importIntoMember(Member $member, array $data, string $path, str } break; - case CoreQueryBuilder::BASED_ON; + case CoreQueryBuilder::BASED_ON: try { $circle = new Circle(); $circle->importFromDatabase($data, $prefix); @@ -276,7 +275,7 @@ private function importIntoMember(Member $member, array $data, string $path, str } break; - case CoreQueryBuilder::INHERITED_BY; + case CoreQueryBuilder::INHERITED_BY: try { $inheritedBy = new FederatedUser(); $inheritedBy->importFromDatabase($data, $prefix); @@ -285,7 +284,7 @@ private function importIntoMember(Member $member, array $data, string $path, str } break; - case CoreQueryBuilder::INVITED_BY; + case CoreQueryBuilder::INVITED_BY: try { $invitedByCircle = new Circle(); $invitedByCircle->importFromDatabase($data, $prefix); @@ -296,7 +295,7 @@ private function importIntoMember(Member $member, array $data, string $path, str } break; - case CoreQueryBuilder::INHERITANCE_FROM; + case CoreQueryBuilder::INHERITANCE_FROM: try { $inheritanceFrom = new Member(); $inheritanceFrom->importFromDatabase($data, $prefix); @@ -305,7 +304,7 @@ private function importIntoMember(Member $member, array $data, string $path, str } break; - case CoreQueryBuilder::REMOTE; + case CoreQueryBuilder::REMOTE: try { $remoteInstance = new RemoteInstance(); $remoteInstance->importFromDatabase($data, $prefix); @@ -330,7 +329,7 @@ private function importIntoFederatedUser( string $prefix ): void { switch ($path) { - case CoreQueryBuilder::MEMBERSHIPS; + case CoreQueryBuilder::MEMBERSHIPS: try { $membership = new Membership(); $membership->importFromDatabase($data, $prefix); @@ -355,7 +354,7 @@ private function importIntoShareWrapper( string $prefix ): void { switch ($path) { - case CoreQueryBuilder::CIRCLE; + case CoreQueryBuilder::CIRCLE: try { $circle = new Circle(); $circle->importFromDatabase($data, $prefix); @@ -364,7 +363,7 @@ private function importIntoShareWrapper( } break; - case CoreQueryBuilder::INITIATOR; + case CoreQueryBuilder::INITIATOR: try { $initiator = new Member(); $initiator->importFromDatabase($data, $prefix); @@ -373,7 +372,7 @@ private function importIntoShareWrapper( } break; - case CoreQueryBuilder::INHERITED_BY; + case CoreQueryBuilder::INHERITED_BY: try { $inheritedBy = new Member(); $inheritedBy->importFromDatabase($data, $prefix); @@ -382,7 +381,7 @@ private function importIntoShareWrapper( } break; - case CoreQueryBuilder::FILE_CACHE; + case CoreQueryBuilder::FILE_CACHE: try { $fileCache = new FileCacheWrapper(); $fileCache->importFromDatabase($data, $prefix); @@ -407,7 +406,7 @@ private function importIntoMount( string $prefix ): void { switch ($path) { - case CoreQueryBuilder::MEMBER; + case CoreQueryBuilder::MEMBER: try { $member = new Member(); $member->importFromDatabase($data, $prefix); @@ -416,7 +415,7 @@ private function importIntoMount( } break; - case CoreQueryBuilder::INITIATOR; + case CoreQueryBuilder::INITIATOR: try { $initiator = new Member(); $initiator->importFromDatabase($data, $prefix); @@ -492,6 +491,4 @@ public function setFullDetails(bool $full): void { public function isFullDetails(): bool { return $this->fullDetails; } - } - diff --git a/lib/Model/Mount.php b/lib/Model/Mount.php index 7ca8518f4..c32d9a7fc 100644 --- a/lib/Model/Mount.php +++ b/lib/Model/Mount.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Model; - use ArtificialOwl\MySmallPhpTools\Db\Nextcloud\nc22\INC22QueryRow; use ArtificialOwl\MySmallPhpTools\IDeserializable; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; @@ -41,15 +40,12 @@ use OCP\Federation\ICloudIdManager; use OCP\Http\Client\IClientService; - /** * Class Mount * * @package OCA\Circles\Model */ class Mount extends ManagedModel implements IDeserializable, INC22QueryRow, JsonSerializable { - - use TArrayTools; @@ -410,15 +406,15 @@ public function toMount(): array { $member = $this->getOwner(); return [ - 'owner' => $member->getUserId(), - 'remote' => $member->getRemoteInstance()->getRoot(), - 'token' => $this->getToken(), - 'password' => $this->getPassword(), - 'mountpoint' => $this->getMountPoint(false), + 'owner' => $member->getUserId(), + 'remote' => $member->getRemoteInstance()->getRoot(), + 'token' => $this->getToken(), + 'password' => $this->getPassword(), + 'mountpoint' => $this->getMountPoint(false), // 'manager' => $this->getMountManager(), 'HttpClientService' => $this->getHttpClientService(), - 'manager' => $this->getMountManager(), - 'cloudId' => $this->getCloudIdManager()->getCloudId( + 'manager' => $this->getMountManager(), + 'cloudId' => $this->getCloudIdManager()->getCloudId( $member->getUserId(), $member->getRemoteInstance()->getRoot() ) @@ -481,16 +477,16 @@ public function importFromDatabase(array $data, string $prefix = ''): INC22Query /** * @return array */ - function jsonSerialize(): array { + public function jsonSerialize(): array { $arr = [ - 'id' => $this->getId(), - 'circleId' => $this->getCircleId(), - 'mountId' => $this->getMountId(), - 'parent' => $this->getParent(), - 'owner' => $this->getOwner(), - 'token' => $this->getToken(), - 'password' => $this->getPassword(), - 'mountPoint' => $this->getMountPoint(), + 'id' => $this->getId(), + 'circleId' => $this->getCircleId(), + 'mountId' => $this->getMountId(), + 'parent' => $this->getParent(), + 'owner' => $this->getOwner(), + 'token' => $this->getToken(), + 'password' => $this->getPassword(), + 'mountPoint' => $this->getMountPoint(), 'mountPointHash' => $this->getMountPointHash(), ]; @@ -501,6 +497,4 @@ function jsonSerialize(): array { return $arr; } - } - diff --git a/lib/Model/Mountpoint.php b/lib/Model/Mountpoint.php index 0737be6ed..aaee68174 100644 --- a/lib/Model/Mountpoint.php +++ b/lib/Model/Mountpoint.php @@ -1,4 +1,6 @@ - $this->getUserId(), - 'shareId' => $this->getShareId(), + 'userId' => $this->getUserId(), + 'shareId' => $this->getShareId(), 'mountPoint' => $this->getMountPoint(), ]; } - } - diff --git a/lib/Model/Report.php b/lib/Model/Report.php index 8f2b62037..1400dd7df 100644 --- a/lib/Model/Report.php +++ b/lib/Model/Report.php @@ -31,20 +31,16 @@ namespace OCA\Circles\Model; - use ArtificialOwl\MySmallPhpTools\IDeserializable; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use JsonSerializable; - /** * Class Report * * @package OCA\Circles\Model */ class Report implements IDeserializable, JsonSerializable { - - use TArrayTools; /** @var string */ @@ -138,13 +134,11 @@ public function import(array $data): IDeserializable { /** * @return array */ - function jsonSerialize(): array { + public function jsonSerialize(): array { return [ - 'source' => $this->getSource(), - 'circles' => $this->getCircles(), + 'source' => $this->getSource(), + 'circles' => $this->getCircles(), 'obfuscated' => $this->getObfuscated() ]; } - } - diff --git a/lib/Model/SearchResult.php b/lib/Model/SearchResult.php index 334e9efbc..54fe0ad1f 100644 --- a/lib/Model/SearchResult.php +++ b/lib/Model/SearchResult.php @@ -26,7 +26,6 @@ namespace OCA\Circles\Model; - class SearchResult implements \JsonSerializable { /** @var string */ @@ -50,7 +49,7 @@ class SearchResult implements \JsonSerializable { * @param string $instance * @param array $data */ - function __construct($ident = '', $type = 0, $instance = '', $data = []) { + public function __construct($ident = '', $type = 0, $instance = '', $data = []) { $this->setIdent($ident); $this->setType($type); $this->setInstance($instance); @@ -130,14 +129,12 @@ public function getData() { * which is a value of any type other than a resource. * @since 5.4.0 */ - function jsonSerialize() { - + public function jsonSerialize() { return [ - 'ident' => $this->getIdent(), + 'ident' => $this->getIdent(), 'instance' => $this->getInstance(), - 'type' => $this->getType(), - 'data' => $this->getData() + 'type' => $this->getType(), + 'data' => $this->getData() ]; - } } diff --git a/lib/Model/ShareToken.php b/lib/Model/ShareToken.php index 47af80517..b532ed11e 100644 --- a/lib/Model/ShareToken.php +++ b/lib/Model/ShareToken.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Model; - use ArtificialOwl\MySmallPhpTools\Db\Nextcloud\nc22\INC22QueryRow; use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\IDeserializable; @@ -39,10 +38,7 @@ use JsonSerializable; use OCP\Share\IShare; - class ShareToken implements IDeserializable, INC22QueryRow, JsonSerializable { - - use TArrayTools; @@ -77,7 +73,7 @@ class ShareToken implements IDeserializable, INC22QueryRow, JsonSerializable { /** * ShareToken constructor. */ - function __construct() { + public function __construct() { } @@ -297,18 +293,16 @@ public function importFromDatabase(array $data, string $prefix = ''): INC22Query /** * @return array */ - function jsonSerialize(): array { + public function jsonSerialize(): array { return [ - 'shareId' => $this->getShareId(), + 'shareId' => $this->getShareId(), 'circleId' => $this->getCircleId(), 'singleId' => $this->getSingleId(), 'memberId' => $this->getMemberId(), - 'token' => $this->getToken(), + 'token' => $this->getToken(), 'password' => $this->getPassword(), 'accepted' => $this->getAccepted(), - 'link' => $this->getLink() + 'link' => $this->getLink() ]; } - } - diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index 2ffb1728f..8fd8d3f91 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -49,15 +49,12 @@ use OCP\Share\Exceptions\IllegalIDChangeException; use OCP\Share\IShare; - /** * Class ShareWrapper * * @package OCA\Circles\Model */ class ShareWrapper extends ManagedModel implements IDeserializable, INC22QueryRow, JsonSerializable { - - use TArrayTools; use TNC22Deserialize; @@ -649,7 +646,7 @@ public function getShare( $share->setNodeCacheEntry( Cache::cacheEntryFromData($this->getFileCache()->toCache(), OC::$server->getMimeTypeLoader()) ); - } else if ($nullOnMissingFileCache) { + } elseif ($nullOnMissingFileCache) { return null; } @@ -824,23 +821,23 @@ public function importFromDatabase(array $data, string $prefix = ''): INC22Query */ public function jsonSerialize(): array { $arr = [ - 'id' => $this->getId(), - 'shareType' => $this->getShareType(), - 'providerId' => $this->getProviderId(), - 'permissions' => $this->getPermissions(), - 'itemType' => $this->getItemType(), - 'itemSource' => $this->getItemSource(), - 'itemTarget' => $this->getItemTarget(), - 'fileSource' => $this->getFileSource(), - 'fileTarget' => $this->getFileTarget(), - 'status' => $this->getStatus(), - 'shareTime' => $this->getShareTime()->getTimestamp(), - 'sharedWith' => $this->getSharedWith(), - 'sharedBy' => $this->getSharedBy(), - 'shareOwner' => $this->getShareOwner(), - 'token' => $this->getToken(), - 'childId' => $this->getChildId(), - 'childFileTarget' => $this->getChildFileTarget(), + 'id' => $this->getId(), + 'shareType' => $this->getShareType(), + 'providerId' => $this->getProviderId(), + 'permissions' => $this->getPermissions(), + 'itemType' => $this->getItemType(), + 'itemSource' => $this->getItemSource(), + 'itemTarget' => $this->getItemTarget(), + 'fileSource' => $this->getFileSource(), + 'fileTarget' => $this->getFileTarget(), + 'status' => $this->getStatus(), + 'shareTime' => $this->getShareTime()->getTimestamp(), + 'sharedWith' => $this->getSharedWith(), + 'sharedBy' => $this->getSharedBy(), + 'shareOwner' => $this->getShareOwner(), + 'token' => $this->getToken(), + 'childId' => $this->getChildId(), + 'childFileTarget' => $this->getChildFileTarget(), 'childPermissions' => $this->getChildPermissions() ]; @@ -866,6 +863,4 @@ public function jsonSerialize(): array { return $arr; } - } - diff --git a/lib/Model/SharesToken.php b/lib/Model/SharesToken.php index 82193fc4c..cd9eb19c9 100644 --- a/lib/Model/SharesToken.php +++ b/lib/Model/SharesToken.php @@ -26,20 +26,16 @@ namespace OCA\Circles\Model; - use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use JsonSerializable; use OCP\Share\IShare; - /** * Class SharesToken * @deprecated * @package OCA\Circles\Model */ class SharesToken implements JsonSerializable { - - use TArrayTools; @@ -65,7 +61,7 @@ class SharesToken implements JsonSerializable { /** * SharesToken constructor. */ - function __construct() { + public function __construct() { } @@ -186,7 +182,7 @@ public function setAccepted(int $accepted): self { /** * @param array $data */ - function import(array $data) { + public function import(array $data) { $this->setCircleId($this->get('circle_id', $data, '')); $this->setMemberId($this->get('member_id', $data, '')); $this->setAccepted($this->getInt('accepted', $data, IShare::STATUS_PENDING)); @@ -199,16 +195,14 @@ function import(array $data) { /** * @return array */ - function jsonSerialize(): array { + public function jsonSerialize(): array { return [ 'circleId' => $this->getCircleId(), 'memberId' => $this->getMemberId(), - 'userId' => $this->getUserId(), - 'shareId' => $this->getShareId(), - 'token' => $this->getToken(), + 'userId' => $this->getUserId(), + 'shareId' => $this->getShareId(), + 'token' => $this->getToken(), 'accepted' => $this->getAccepted() ]; } - } - diff --git a/lib/Model/SharingFrame.php b/lib/Model/SharingFrame.php index 4d9f2d122..be21cc453 100644 --- a/lib/Model/SharingFrame.php +++ b/lib/Model/SharingFrame.php @@ -272,22 +272,21 @@ public function cannotBeFromCircles() { public function jsonSerialize() { - return array( + return [ 'unique_id' => $this->getUniqueId(), - 'circle' => $this->getCircle() + 'circle' => $this->getCircle() ->getArray(false, true), - 'source' => $this->getSource(), - 'type' => $this->getType(), - 'author' => $this->getAuthor(), - 'cloud_id' => $this->getCloudId(), - 'headers' => $this->getHeaders(), - 'payload' => $this->getPayload(), - 'creation' => $this->getCreation(), - ); + 'source' => $this->getSource(), + 'type' => $this->getType(), + 'author' => $this->getAuthor(), + 'cloud_id' => $this->getCloudId(), + 'headers' => $this->getHeaders(), + 'payload' => $this->getPayload(), + 'creation' => $this->getCreation(), + ]; } public static function fromJSON($json) { - $arr = json_decode($json, true); return self::fromArray($arr); @@ -321,7 +320,6 @@ public static function fromArray($arr) { * @return array */ private static function getHeadersFromArray($arr) { - $headers = []; if (key_exists('headers', $arr)) { $headers = $arr['headers']; @@ -340,4 +338,3 @@ private static function getCircleFromArray($arr) { return DeprecatedCircle::fromArray(MiscService::get($arr, 'circle', null)); } } - diff --git a/lib/MountManager/CircleMount.php b/lib/MountManager/CircleMount.php index c68a1c5e7..29ac827dc 100644 --- a/lib/MountManager/CircleMount.php +++ b/lib/MountManager/CircleMount.php @@ -31,7 +31,6 @@ namespace OCA\Circles\MountManager; - use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use Exception; use JsonSerializable; @@ -41,15 +40,12 @@ use OCA\Circles\Model\Mount; use OCP\Files\Storage\IStorageFactory; - /** * Class CircleMount * * @package OCA\Circles\MountManager */ class CircleMount extends MountPoint implements MoveableMount, JsonSerializable { - - use TArrayTools; @@ -134,10 +130,8 @@ public function getInitiator() { */ public function jsonSerialize(): array { return [ - 'mount' => $this->mount, + 'mount' => $this->mount, 'storage' => $this->storageClass ]; } - } - diff --git a/lib/MountManager/CircleMountManager.php b/lib/MountManager/CircleMountManager.php index 5d9998a12..fd6915aa9 100644 --- a/lib/MountManager/CircleMountManager.php +++ b/lib/MountManager/CircleMountManager.php @@ -1,4 +1,6 @@ -prepareActions($notification); return $notification; - } @@ -216,7 +211,6 @@ private function prepareMemberNotification(INotification $notification) { } $notification->setParsedSubject($subject); - } @@ -243,6 +237,4 @@ private function prepareActions(INotification $notification): void { $notification->addParsedAction($action); } } - } - diff --git a/lib/Search/Contacts.php b/lib/Search/Contacts.php index c08fa8dcc..8ef53bfd3 100644 --- a/lib/Search/Contacts.php +++ b/lib/Search/Contacts.php @@ -37,7 +37,6 @@ class Contacts implements ISearch { * {@inheritdoc} */ public function search($search) { - $result = []; $contactManager = \OC::$server->getContactsManager(); @@ -63,8 +62,8 @@ public function search($search) { */ private function generateDataArray($contact) { $data = [ - 'display' => '', - 'email' => '', + 'display' => '', + 'email' => '', 'organization' => '' ]; @@ -75,4 +74,3 @@ private function generateDataArray($contact) { return $data; } } - diff --git a/lib/Search/FederatedUsers.php b/lib/Search/FederatedUsers.php index 787aa02f5..56cec685c 100644 --- a/lib/Search/FederatedUsers.php +++ b/lib/Search/FederatedUsers.php @@ -31,11 +31,9 @@ namespace OCA\Circles\Search; - use OCA\Circles\Db\MemberRequest; use OCA\Circles\ISearch; - /** * Class FederatedUsers * @@ -66,6 +64,4 @@ public function __construct(MemberRequest $memberRequest) { public function search(string $needle): array { return $this->memberRequest->searchFederatedUsers($needle); } - } - diff --git a/lib/Search/GlobalScaleUsers.php b/lib/Search/GlobalScaleUsers.php index e751c7013..9b59e6f32 100644 --- a/lib/Search/GlobalScaleUsers.php +++ b/lib/Search/GlobalScaleUsers.php @@ -39,15 +39,12 @@ use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\MiscService; - /** * Class GlobalScaleUsers * * @package OCA\Circles\Search */ class GlobalScaleUsers implements ISearch { - - use TNC22Request; use TArrayTools; @@ -102,7 +99,7 @@ public function search(string $search): array { $result = []; foreach ($users as $user) { - list(, $instance) = explode('@', $this->get('federationId', $user), 2); + [, $instance] = explode('@', $this->get('federationId', $user), 2); if ($this->configService->isLocalInstance($instance)) { continue; } @@ -117,5 +114,3 @@ public function search(string $search): array { return $result; } } - - diff --git a/lib/Search/LocalGroups.php b/lib/Search/LocalGroups.php index 54d17c623..8fdac50a3 100644 --- a/lib/Search/LocalGroups.php +++ b/lib/Search/LocalGroups.php @@ -46,5 +46,4 @@ public function search($search) { return $result; } - } diff --git a/lib/Search/LocalUsers.php b/lib/Search/LocalUsers.php index c2736bc7d..44dc2685b 100644 --- a/lib/Search/LocalUsers.php +++ b/lib/Search/LocalUsers.php @@ -35,8 +35,6 @@ use OCP\Share\IShare; class LocalUsers implements ISearch { - - use TArrayTools; @@ -88,7 +86,7 @@ public function search($search) { * @return array */ private function searchFromCollaborator($search): array { - list($temp, $hasMore) = $this->search->search($search, [IShare::TYPE_USER, IShare::TYPE_EMAIL], false, 50, 0); + [$temp, $hasMore] = $this->search->search($search, [IShare::TYPE_USER, IShare::TYPE_EMAIL], false, 50, 0); $result = array_merge($temp['exact']['users'], $temp['users']); $parsed = []; @@ -104,7 +102,4 @@ private function searchFromCollaborator($search): array { return $parsed; } - } - - diff --git a/lib/Service/CircleService.php b/lib/Service/CircleService.php index 7ec36bdb3..6801ee80d 100644 --- a/lib/Service/CircleService.php +++ b/lib/Service/CircleService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; @@ -66,15 +65,12 @@ use OCA\Circles\Model\Member; use OCA\Circles\StatusCode; - /** * Class CircleService * * @package OCA\Circles\Service */ class CircleService { - - use TArrayTools; use TStringTools; use TNC22Logger; @@ -159,7 +155,6 @@ public function create( bool $personal = false, bool $local = false ): array { - $this->federatedUserService->mustHaveCurrentUser(); if (is_null($owner)) { $owner = $this->federatedUserService->getCurrentUser(); @@ -465,12 +460,12 @@ public function getCircles( } $params->default( [ - 'limit' => -1, - 'offset' => 0, - 'mustBeMember' => false, - 'includeHiddenCircles' => false, - 'includeBackendCircles' => false, - 'includeSystemCircles' => false, + 'limit' => -1, + 'offset' => 0, + 'mustBeMember' => false, + 'includeHiddenCircles' => false, + 'includeBackendCircles' => false, + 'includeSystemCircles' => false, 'includePersonalCircles' => false ] ); @@ -628,6 +623,4 @@ public function cleanCircleName(string $name): string { return trim($name); } - } - diff --git a/lib/Service/CirclesService.php b/lib/Service/CirclesService.php index 84ff133b2..af5cd8d3f 100644 --- a/lib/Service/CirclesService.php +++ b/lib/Service/CirclesService.php @@ -29,7 +29,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use Exception; use OC; @@ -55,7 +54,6 @@ use OCP\IL10N; use OCP\IUserSession; - /** * Class CirclesService * @@ -63,8 +61,6 @@ * @package OCA\Circles\Service */ class CirclesService { - - use TArrayTools; @@ -147,7 +143,6 @@ public function __construct( CircleProviderRequest $circleProviderRequest, MiscService $miscService ) { - if ($userId === null) { $user = $userSession->getUser(); if ($user !== null) { @@ -278,7 +273,6 @@ public function listCircles($userId, $type, $name = '', $level = 0, $forceAll = * @throws Exception */ public function detailsCircle($circleUniqueId, $forceAll = false) { - try { if (!$forceAll) { $circle = $this->circlesRequest->getCircle( @@ -542,10 +536,10 @@ public function infoCircleByName($circleName) { public function convertTypeStringToBitValue($type) { $strings = [ 'personal' => DeprecatedCircle::CIRCLES_PERSONAL, - 'secret' => DeprecatedCircle::CIRCLES_SECRET, - 'closed' => DeprecatedCircle::CIRCLES_CLOSED, - 'public' => DeprecatedCircle::CIRCLES_PUBLIC, - 'all' => DeprecatedCircle::CIRCLES_ALL + 'secret' => DeprecatedCircle::CIRCLES_SECRET, + 'closed' => DeprecatedCircle::CIRCLES_CLOSED, + 'public' => DeprecatedCircle::CIRCLES_PUBLIC, + 'all' => DeprecatedCircle::CIRCLES_ALL ]; if (!key_exists(strtolower($type), $strings)) { @@ -567,7 +561,6 @@ public function convertTypeStringToBitValue($type) { * @return string */ public static function getCircleIcon($type, $png = false) { - $ext = '.svg'; if ($png === true) { $ext = '.png'; @@ -642,7 +635,6 @@ public function checkThatCircleIsNotFull(DeprecatedCircle $circle) { 'This circle already reach its limit on the number of members' ); } - } /** @@ -689,5 +681,4 @@ public function hasToBeAdmin(DeprecatedMember $member) { ); } } - } diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index c14ad31fc..8628292f3 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Model\Nextcloud\nc22\NC22Request; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; @@ -44,124 +43,121 @@ use OCP\IConfig; use OCP\IURLGenerator; - /** * Class ConfigService * * @package OCA\Circles\Service */ class ConfigService { - - use TStringTools; use TArrayTools; - const FRONTAL_CLOUD_ID = 'frontal_cloud_id'; - const FRONTAL_CLOUD_SCHEME = 'frontal_cloud_scheme'; - const INTERNAL_CLOUD_ID = 'internal_cloud_id'; - const INTERNAL_CLOUD_SCHEME = 'internal_cloud_scheme'; - const LOOPBACK_CLOUD_ID = 'loopback_cloud_id'; - const LOOPBACK_CLOUD_SCHEME = 'loopback_cloud_scheme'; - const IFACE0_CLOUD_ID = 'iface0_cloud_id'; - const IFACE0_CLOUD_SCHEME = 'iface0_cloud_scheme'; - const IFACE0_INTERNAL = 'iface0_internal'; - const IFACE1_CLOUD_ID = 'iface1_cloud_id'; - const IFACE1_CLOUD_SCHEME = 'iface1_cloud_scheme'; - const IFACE1_INTERNAL = 'iface1_internal'; - const IFACE2_CLOUD_ID = 'iface2_cloud_id'; - const IFACE2_CLOUD_SCHEME = 'iface2_cloud_scheme'; - const IFACE2_INTERNAL = 'iface2_internal'; - const IFACE3_CLOUD_ID = 'iface3_cloud_id'; - const IFACE3_CLOUD_SCHEME = 'iface3_cloud_scheme'; - const IFACE3_INTERNAL = 'iface3_internal'; - const IFACE4_CLOUD_ID = 'iface4_cloud_id'; - const IFACE4_CLOUD_SCHEME = 'iface4_cloud_scheme'; - const IFACE4_INTERNAL = 'iface4_internal'; - const IFACE_TEST_ID = 'iface_test_id'; - const IFACE_TEST_SCHEME = 'iface_test_scheme'; - const IFACE_TEST_TOKEN = 'iface_test_token'; - - const HARD_MODERATION = 'hard_moderation'; - const FRONTEND_ENABLED = 'frontend_enabled'; - const ROUTE_TO_CIRCLE = 'route_to_circle'; - const EVENT_EXAMPLES = 'event_examples'; - - const SELF_SIGNED_CERT = 'self_signed_cert'; - const MEMBERS_LIMIT = 'members_limit'; - const ACTIVITY_ON_NEW_CIRCLE = 'creation_activity'; - - const MIGRATION_BYPASS = 'migration_bypass'; - const MIGRATION_22 = 'migration_22'; - const MIGRATION_RUN = 'migration_run'; - const MAINTENANCE_UPDATE = 'maintenance_update'; - const MAINTENANCE_RUN = 'maintenance_run'; - - const LOOPBACK_TMP_ID = 'loopback_tmp_id'; - const LOOPBACK_TMP_SCHEME = 'loopback_tmp_scheme'; - - const GS_MODE = 'mode'; - const GS_KEY = 'key'; - - const GS_LOOKUP_INSTANCES = '/instances'; - const GS_LOOKUP_USERS = '/users'; + public const FRONTAL_CLOUD_ID = 'frontal_cloud_id'; + public const FRONTAL_CLOUD_SCHEME = 'frontal_cloud_scheme'; + public const INTERNAL_CLOUD_ID = 'internal_cloud_id'; + public const INTERNAL_CLOUD_SCHEME = 'internal_cloud_scheme'; + public const LOOPBACK_CLOUD_ID = 'loopback_cloud_id'; + public const LOOPBACK_CLOUD_SCHEME = 'loopback_cloud_scheme'; + public const IFACE0_CLOUD_ID = 'iface0_cloud_id'; + public const IFACE0_CLOUD_SCHEME = 'iface0_cloud_scheme'; + public const IFACE0_INTERNAL = 'iface0_internal'; + public const IFACE1_CLOUD_ID = 'iface1_cloud_id'; + public const IFACE1_CLOUD_SCHEME = 'iface1_cloud_scheme'; + public const IFACE1_INTERNAL = 'iface1_internal'; + public const IFACE2_CLOUD_ID = 'iface2_cloud_id'; + public const IFACE2_CLOUD_SCHEME = 'iface2_cloud_scheme'; + public const IFACE2_INTERNAL = 'iface2_internal'; + public const IFACE3_CLOUD_ID = 'iface3_cloud_id'; + public const IFACE3_CLOUD_SCHEME = 'iface3_cloud_scheme'; + public const IFACE3_INTERNAL = 'iface3_internal'; + public const IFACE4_CLOUD_ID = 'iface4_cloud_id'; + public const IFACE4_CLOUD_SCHEME = 'iface4_cloud_scheme'; + public const IFACE4_INTERNAL = 'iface4_internal'; + public const IFACE_TEST_ID = 'iface_test_id'; + public const IFACE_TEST_SCHEME = 'iface_test_scheme'; + public const IFACE_TEST_TOKEN = 'iface_test_token'; + + public const HARD_MODERATION = 'hard_moderation'; + public const FRONTEND_ENABLED = 'frontend_enabled'; + public const ROUTE_TO_CIRCLE = 'route_to_circle'; + public const EVENT_EXAMPLES = 'event_examples'; + + public const SELF_SIGNED_CERT = 'self_signed_cert'; + public const MEMBERS_LIMIT = 'members_limit'; + public const ACTIVITY_ON_NEW_CIRCLE = 'creation_activity'; + + public const MIGRATION_BYPASS = 'migration_bypass'; + public const MIGRATION_22 = 'migration_22'; + public const MIGRATION_RUN = 'migration_run'; + public const MAINTENANCE_UPDATE = 'maintenance_update'; + public const MAINTENANCE_RUN = 'maintenance_run'; + + public const LOOPBACK_TMP_ID = 'loopback_tmp_id'; + public const LOOPBACK_TMP_SCHEME = 'loopback_tmp_scheme'; + + public const GS_MODE = 'mode'; + public const GS_KEY = 'key'; + + public const GS_LOOKUP_INSTANCES = '/instances'; + public const GS_LOOKUP_USERS = '/users'; // deprecated -- removing in NC25 - const CIRCLES_CONTACT_BACKEND = 'contact_backend'; - const CIRCLES_ACCOUNTS_ONLY = 'accounts_only'; // only UserType=1 - const CIRCLES_SEARCH_FROM_COLLABORATOR = 'search_from_collaborator'; + public const CIRCLES_CONTACT_BACKEND = 'contact_backend'; + public const CIRCLES_ACCOUNTS_ONLY = 'accounts_only'; // only UserType=1 + public const CIRCLES_SEARCH_FROM_COLLABORATOR = 'search_from_collaborator'; - const FORCE_NC_BASE = 'force_nc_base'; - const TEST_NC_BASE = 'test_nc_base'; + public const FORCE_NC_BASE = 'force_nc_base'; + public const TEST_NC_BASE = 'test_nc_base'; private $defaults = [ - self::FRONTAL_CLOUD_ID => '', - self::FRONTAL_CLOUD_SCHEME => 'https', - self::INTERNAL_CLOUD_ID => '', + self::FRONTAL_CLOUD_ID => '', + self::FRONTAL_CLOUD_SCHEME => 'https', + self::INTERNAL_CLOUD_ID => '', self::INTERNAL_CLOUD_SCHEME => 'https', - self::LOOPBACK_CLOUD_ID => '', + self::LOOPBACK_CLOUD_ID => '', self::LOOPBACK_CLOUD_SCHEME => 'https', - self::LOOPBACK_TMP_ID => '', - self::LOOPBACK_TMP_SCHEME => '', - self::IFACE0_CLOUD_ID => '', - self::IFACE0_CLOUD_SCHEME => 'https', - self::IFACE0_INTERNAL => '0', - self::IFACE1_CLOUD_ID => '', - self::IFACE1_CLOUD_SCHEME => 'https', - self::IFACE1_INTERNAL => '0', - self::IFACE2_CLOUD_ID => '', - self::IFACE2_CLOUD_SCHEME => 'https', - self::IFACE2_INTERNAL => '0', - self::IFACE3_CLOUD_ID => '', - self::IFACE3_CLOUD_SCHEME => 'https', - self::IFACE3_INTERNAL => '0', - self::IFACE4_CLOUD_ID => '', - self::IFACE4_CLOUD_SCHEME => 'https', - self::IFACE4_INTERNAL => '0', - self::IFACE_TEST_ID => '', - self::IFACE_TEST_SCHEME => 'https', - self::IFACE_TEST_TOKEN => '', + self::LOOPBACK_TMP_ID => '', + self::LOOPBACK_TMP_SCHEME => '', + self::IFACE0_CLOUD_ID => '', + self::IFACE0_CLOUD_SCHEME => 'https', + self::IFACE0_INTERNAL => '0', + self::IFACE1_CLOUD_ID => '', + self::IFACE1_CLOUD_SCHEME => 'https', + self::IFACE1_INTERNAL => '0', + self::IFACE2_CLOUD_ID => '', + self::IFACE2_CLOUD_SCHEME => 'https', + self::IFACE2_INTERNAL => '0', + self::IFACE3_CLOUD_ID => '', + self::IFACE3_CLOUD_SCHEME => 'https', + self::IFACE3_INTERNAL => '0', + self::IFACE4_CLOUD_ID => '', + self::IFACE4_CLOUD_SCHEME => 'https', + self::IFACE4_INTERNAL => '0', + self::IFACE_TEST_ID => '', + self::IFACE_TEST_SCHEME => 'https', + self::IFACE_TEST_TOKEN => '', self::FRONTEND_ENABLED => '1', - self::HARD_MODERATION => '0', - self::ROUTE_TO_CIRCLE => 'contacts.contacts.directcircle', - self::EVENT_EXAMPLES => '0', + self::HARD_MODERATION => '0', + self::ROUTE_TO_CIRCLE => 'contacts.contacts.directcircle', + self::EVENT_EXAMPLES => '0', - self::SELF_SIGNED_CERT => '0', - self::MEMBERS_LIMIT => '-1', + self::SELF_SIGNED_CERT => '0', + self::MEMBERS_LIMIT => '-1', self::ACTIVITY_ON_NEW_CIRCLE => '1', - self::MIGRATION_BYPASS => '0', - self::MIGRATION_22 => '0', - self::MIGRATION_RUN => '0', - self::MAINTENANCE_UPDATE => '[]', - self::MAINTENANCE_RUN => '0', - - self::FORCE_NC_BASE => '', - self::TEST_NC_BASE => '', - self::CIRCLES_CONTACT_BACKEND => '0', - self::CIRCLES_ACCOUNTS_ONLY => '0', + self::MIGRATION_BYPASS => '0', + self::MIGRATION_22 => '0', + self::MIGRATION_RUN => '0', + self::MAINTENANCE_UPDATE => '[]', + self::MAINTENANCE_RUN => '0', + + self::FORCE_NC_BASE => '', + self::TEST_NC_BASE => '', + self::CIRCLES_CONTACT_BACKEND => '0', + self::CIRCLES_ACCOUNTS_ONLY => '0', self::CIRCLES_SEARCH_FROM_COLLABORATOR => '0', ]; @@ -331,10 +327,10 @@ public function enforcePasswordProtection(DeprecatedCircle $circle) { */ public function getSettings(): array { return [ - 'frontendEnabled' => $this->getAppValueBool(self::FRONTEND_ENABLED), - 'allowedCircles' => Circle::$DEF_CFG_MAX, + 'frontendEnabled' => $this->getAppValueBool(self::FRONTEND_ENABLED), + 'allowedCircles' => Circle::$DEF_CFG_MAX, 'allowedUserTypes' => Member::$DEF_TYPE_MAX, - 'membersLimit' => $this->getAppValueInt(self::MEMBERS_LIMIT) + 'membersLimit' => $this->getAppValueInt(self::MEMBERS_LIMIT) ]; } @@ -402,11 +398,11 @@ public function getGSInfo(string $type): string { */ public function getGSData(): array { return [ - 'enabled' => $this->isGSAvailable(), - 'lookup' => $this->getGSLookup(), - 'mockup' => $this->getGSSMockup(), + 'enabled' => $this->isGSAvailable(), + 'lookup' => $this->getGSLookup(), + 'mockup' => $this->getGSSMockup(), self::GS_MODE => $this->config->getSystemValue('gss.mode', ''), - self::GS_KEY => $this->config->getSystemValue('gss.jwt.key', ''), + self::GS_KEY => $this->config->getSystemValue('gss.jwt.key', ''), ]; } @@ -416,7 +412,7 @@ public function getGSData(): array { */ public function getTrustedDomains(): array { return array_map( - function(string $address) { + function (string $address) { return strtolower($address); }, $this->config->getSystemValue('trusted_domains', []) ); @@ -634,6 +630,4 @@ public function configureRequest(NC22Request $request): void { $request->setFollowLocation(true); $request->setTimeout(5); } - } - diff --git a/lib/Service/ContactService.php b/lib/Service/ContactService.php index 2ee75496a..110c47e6f 100644 --- a/lib/Service/ContactService.php +++ b/lib/Service/ContactService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; @@ -44,15 +43,12 @@ use OCP\IAddressBook; use OCP\IURLGenerator; - /** * Class ContactService * * @package OCA\Circles\Service */ class ContactService { - - use TArrayTools; use TStringTools; use TNC22Logger; @@ -144,7 +140,7 @@ private function getContact(string $contactPath): array { $contacts = $addressBook->search( $contactId, ['UID'], [ - 'types' => false, + 'types' => false, 'escape_like_param' => false ] ); @@ -191,6 +187,4 @@ public function getAddressBoxById(IManager $cm, string $addressBookKey): IAddres throw new ContactAddressBookNotFoundException(); } - } - diff --git a/lib/Service/DavService.php b/lib/Service/DavService.php index 88a9fd740..570e69df0 100644 --- a/lib/Service/DavService.php +++ b/lib/Service/DavService.php @@ -29,7 +29,6 @@ namespace OCA\Circles\Service; - use Exception; use OCA\Circles\Circles\FileSharingBroadcaster; use OCA\Circles\Db\DeprecatedCirclesRequest; @@ -48,7 +47,6 @@ use OCP\IUserManager; use Symfony\Component\EventDispatcher\GenericEvent; - /** * Class DavService * @deprecated @@ -236,7 +234,6 @@ private function manageDavCard(DavCard $davCard) { * @param DavCard $davCard */ private function manageContact(DavCard $davCard) { - $this->manageDeprecatedMembers($davCard); switch ($this->getMemberType($davCard)) { @@ -264,7 +261,7 @@ private function manageDeprecatedMembers(DavCard $davCard) { ); $circles = array_map( - function(DeprecatedCircle $circle) { + function (DeprecatedCircle $circle) { return $circle->getUniqueId(); }, $davCard->getCircles() ); @@ -378,7 +375,7 @@ private function isLocalMember(string $address): string { throw new NotLocalMemberException(); } - list ($username, $domain) = explode('@', $address); + [$username, $domain] = explode('@', $address); if (in_array($domain, $this->configService->getAvailableHosts())) { $user = $this->userManager->get($username); if ($user !== null) { @@ -396,7 +393,7 @@ private function isLocalMember(string $address): string { private function manageCircles(DavCard $davCard) { $fromCard = $davCard->getGroups(); $current = array_map( - function(DeprecatedCircle $circle) { + function (DeprecatedCircle $circle) { return $circle->getContactGroupName(); }, $this->getCirclesFromBook($davCard->getAddressBookId()) ); @@ -584,7 +581,7 @@ private function manageDeprecatedCircles(int $bookId = 0) { $this->miscService->log(sizeof($contacts) . ' known members as contacts in Circles DB', 0); foreach ($contacts as $contact) { - list($bookId,) = explode('/', $contact->getContactId(), 2); + [$bookId,] = explode('/', $contact->getContactId(), 2); if (in_array($bookId, $knownBooks)) { continue; } @@ -645,7 +642,7 @@ private function getExistingCirclesFromBook(int $bookId): array { $this->miscService->log('Found ' . sizeof($circles) . ' Circles from book=' . $bookId, 0); $existing = array_unique( array_map( - function(DeprecatedCircle $circle) { + function (DeprecatedCircle $circle) { return $circle->getContactGroupName(); }, $circles ) @@ -666,7 +663,7 @@ function(DeprecatedCircle $circle) { * @throws MemberDoesNotExistException */ public function getDavCardFromMember(DeprecatedMember $contact): DavCard { - list($bookId, $cardUri) = explode('/', $contact->getContactId(), 2); + [$bookId, $cardUri] = explode('/', $contact->getContactId(), 2); $this->miscService->log('Retrieving DavCard from book:' . $bookId . ', uri:' . $cardUri, 0); $cards = $this->cardDavBackend->getCards($bookId); @@ -710,8 +707,4 @@ private function migrateBook(int $bookId) { $this->migratedBooks[] = $bookId; } - - } - - diff --git a/lib/Service/EventService.php b/lib/Service/EventService.php index fa6a73db2..d63ab0a00 100644 --- a/lib/Service/EventService.php +++ b/lib/Service/EventService.php @@ -34,7 +34,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use OCA\Circles\AppInfo\Application; @@ -61,15 +60,12 @@ use OCA\Circles\Model\ShareWrapper; use OCP\EventDispatcher\IEventDispatcher; - /** * Class EventService * * @package OCA\Circles\Service */ class EventService { - - use TNC22Logger; @@ -365,6 +361,4 @@ public function federatedShareDeleted(ShareWrapper $wrappedShare): void { // $event = new SharedItemsSyncRequestedEvent($federatedEvent); // $this->eventDispatcher->dispatchTyped($event); // } - } - diff --git a/lib/Service/EventWrapperService.php b/lib/Service/EventWrapperService.php index 287f097c9..fbc718798 100644 --- a/lib/Service/EventWrapperService.php +++ b/lib/Service/EventWrapperService.php @@ -30,7 +30,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\ActivityPub\Nextcloud\nc22\NC22Signature; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Request; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; @@ -39,27 +38,24 @@ use OCA\Circles\Model\Federated\EventWrapper; use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class EventWrapperService * * @package OCA\Circles\Service */ class EventWrapperService extends NC22Signature { - - use TNC22Request; use TStringTools; - const RETRY_ASAP = 'asap'; - const RETRY_HOURLY = 'hourly'; - const RETRY_DAILY = 'daily'; - const RETRY_ERROR = 100; - static $RETRIES = [ - 'asap' => [0, 5], + public const RETRY_ASAP = 'asap'; + public const RETRY_HOURLY = 'hourly'; + public const RETRY_DAILY = 'daily'; + public const RETRY_ERROR = 100; + public static $RETRIES = [ + 'asap' => [0, 5], 'hourly' => [5, 150], - 'daily' => [150, 300] + 'daily' => [150, 300] ]; @@ -178,13 +174,11 @@ public function retry(string $retry) { */ private function getFailedEvents(array $retryRange): array { $token = array_map( - function(EventWrapper $event): string { + function (EventWrapper $event): string { return $event->getToken(); }, $this->eventWrapperRequest->getFailedEvents($retryRange) ); return array_values(array_unique($token)); } - } - diff --git a/lib/Service/EventsService.php b/lib/Service/EventsService.php index e752d4316..f4af04d99 100644 --- a/lib/Service/EventsService.php +++ b/lib/Service/EventsService.php @@ -44,7 +44,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\GenericEvent; - /** * @deprecated * @@ -144,7 +143,7 @@ public function onCircleCreation(DeprecatedCircle $circle) { $event->setSubject('circle_create', ['circle' => json_encode($circle)]); $this->userManager->callForSeenUsers( - function($user) use ($event) { + function ($user) use ($event) { /** @var IUser $user */ $this->publishEvent($event, [$user]); } @@ -237,7 +236,6 @@ public function onMemberNew(DeprecatedCircle $circle, DeprecatedMember $member) * @param DeprecatedMember $member */ private function onMemberAlmost(DeprecatedCircle $circle, DeprecatedMember $member) { - switch ($member->getStatus()) { case DeprecatedMember::STATUS_INVITED: $this->onMemberInvited($circle, $member); @@ -781,7 +779,7 @@ private function publishEvent(IEvent $event, array $users) { foreach ($users as $user) { if ($user instanceof IUser) { $userId = $user->getUID(); - } else if ($user instanceof DeprecatedMember) { + } elseif ($user instanceof DeprecatedMember) { $userId = $user->getUserId(); } else { continue; @@ -947,5 +945,4 @@ private function createNotification( private function dispatch(string $context, $arguments) { $this->eventDispatcher->dispatch($context, new GenericEvent(null, $arguments)); } - } diff --git a/lib/Service/FederatedEventService.php b/lib/Service/FederatedEventService.php index ee1d3685a..f94983ab1 100644 --- a/lib/Service/FederatedEventService.php +++ b/lib/Service/FederatedEventService.php @@ -30,7 +30,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\ActivityPub\Nextcloud\nc22\NC22Signature; use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; use ArtificialOwl\MySmallPhpTools\Model\Nextcloud\nc22\NC22Request; @@ -76,15 +75,12 @@ use ReflectionClass; use ReflectionException; - /** * Class FederatedEventService * * @package OCA\Circles\Service */ class FederatedEventService extends NC22Signature { - - use TNC22Request; use TStringTools; @@ -321,7 +317,7 @@ private function confirmRequiredCondition( // TODO: enforce IFederatedItemMemberEmpty if no member if ($item instanceof IFederatedItemMemberEmpty) { $event->setMember(null); - } else if ($item instanceof IFederatedItemMemberRequired && !$event->hasMember()) { + } elseif ($item instanceof IFederatedItemMemberRequired && !$event->hasMember()) { throw new FederatedEventException('FederatedEvent has no Member linked'); } @@ -454,7 +450,7 @@ public function getInstances(FederatedEvent $event): array { $knownInstances = $this->memberRequest->getMemberInstances($circle->getSingleId()); $instances = array_filter( array_map( - function(RemoteInstance $instance) use ($knownInstances) { + function (RemoteInstance $instance) use ($knownInstances) { if (!in_array($instance->getInstance(), $knownInstances)) { return null; } @@ -469,7 +465,7 @@ function(RemoteInstance $instance) use ($knownInstances) { if ($event->hasMember() && !$this->configService->isLocalInstance($event->getMember()->getInstance())) { $currentInstances = array_map( - function(RemoteInstance $instance): string { + function (RemoteInstance $instance): string { return $instance->getInstance(); }, $instances ); @@ -518,6 +514,4 @@ public function manageResults(string $token): void { } catch (FederatedEventException $e) { } } - } - diff --git a/lib/Service/FederatedShareService.php b/lib/Service/FederatedShareService.php index bf87a3031..f55f6b866 100644 --- a/lib/Service/FederatedShareService.php +++ b/lib/Service/FederatedShareService.php @@ -30,7 +30,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\ActivityPub\Nextcloud\nc22\NC22Signature; use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; @@ -51,7 +50,6 @@ use OCA\Circles\Model\Federated\FederatedEvent; use OCA\Circles\Model\Federated\FederatedShare; - /** * Class FederatedShareService * @@ -115,6 +113,4 @@ public function lockItem(string $circleId, string $itemId): FederatedShare { return $share; } - } - diff --git a/lib/Service/FederatedUserService.php b/lib/Service/FederatedUserService.php index 7206fcd8d..a90d3d4d2 100644 --- a/lib/Service/FederatedUserService.php +++ b/lib/Service/FederatedUserService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; @@ -74,25 +73,22 @@ use OCP\IUserManager; use OCP\IUserSession; - /** * Class FederatedUserService * * @package OCA\Circles\Service */ class FederatedUserService { - - use TArrayTools; use TStringTools; use TNC22Logger; - const CONFLICT_001 = 1; - const CONFLICT_002 = 2; - const CONFLICT_003 = 3; - const CONFLICT_004 = 4; - const CONFLICT_005 = 5; + public const CONFLICT_001 = 1; + public const CONFLICT_002 = 2; + public const CONFLICT_003 = 3; + public const CONFLICT_004 = 4; + public const CONFLICT_005 = 5; /** @var IUserSession */ @@ -389,7 +385,7 @@ public function setCurrentPatron(string $userId): void { public function setMemberPatron(Member $member): void { if ($this->isInitiatedByOcc()) { $member->setInvitedBy($this->getAppInitiator('occ', Member::APP_OCC)); - } else if ($this->isInitiatedByAdmin()) { + } elseif ($this->isInitiatedByAdmin()) { $member->setInvitedBy($this->getInitiatedByAdmin()); } else { $member->setInvitedBy($this->getCurrentUser()); @@ -594,7 +590,7 @@ public function commandLineInitiator( public function getFederatedMember(string $userId, int $level = Member::LEVEL_MEMBER): Member { $userId = trim($userId, ','); if (strpos($userId, ',') !== false) { - list($userId, $level) = explode(',', $userId); + [$userId, $level] = explode(',', $userId); } $federatedUser = $this->getFederatedUser($userId, Member::TYPE_USER); @@ -639,7 +635,7 @@ public function getFederatedUser(string $federatedId, int $type = Member::TYPE_S } } - list($singleId, $instance) = $this->extractIdAndInstance($federatedId); + [$singleId, $instance] = $this->extractIdAndInstance($federatedId); switch ($type) { case Member::TYPE_SINGLE: @@ -679,7 +675,7 @@ public function generateFederatedUser(string $federatedId, int $type = 0): Feder } catch (Exception $e) { } - list($userId, $instance) = $this->extractIdAndInstance($federatedId); + [$userId, $instance] = $this->extractIdAndInstance($federatedId); $federatedUser = new FederatedUser(); $federatedUser->set($userId, $instance, $type); @@ -856,7 +852,7 @@ public function extractIdAndInstance(string $federatedId): array { $userId = $federatedId; $instance = $this->interfaceService->getLocalInstance(); } else { - list($userId, $instance) = explode('@', $federatedId); + [$userId, $instance] = explode('@', $federatedId); } return [$userId, $instance]; @@ -1092,7 +1088,7 @@ private function markConflict(IFederatedUser $federatedUser, Member $knownMember 3, $message, false, [ 'federatedUser' => $federatedUser, - 'knownMember' => $knownMember + 'knownMember' => $knownMember ] ); @@ -1154,6 +1150,4 @@ public function getGroupCircle(string $groupId): Circle { return $circle; } - } - diff --git a/lib/Service/GSDownstreamService.php b/lib/Service/GSDownstreamService.php index 8b79df97c..b69462fe1 100644 --- a/lib/Service/GSDownstreamService.php +++ b/lib/Service/GSDownstreamService.php @@ -1,4 +1,6 @@ -miscService->log('issue onNewEvent: ' . json_encode($event) . ' - ' . $e->getMessage()); } } - } - diff --git a/lib/Service/GSUpstreamService.php b/lib/Service/GSUpstreamService.php index 5df613978..ac7f12fff 100644 --- a/lib/Service/GSUpstreamService.php +++ b/lib/Service/GSUpstreamService.php @@ -1,4 +1,6 @@ -deprecatedEvents(); - } - - } - diff --git a/lib/Service/GlobalScaleService.php b/lib/Service/GlobalScaleService.php index 3241d141d..1735562e7 100644 --- a/lib/Service/GlobalScaleService.php +++ b/lib/Service/GlobalScaleService.php @@ -1,4 +1,6 @@ -circlesRequest->getCircle($circleUniqueId, $this->userId); $this->circlesService->hasToBeAdmin($circle->getHigherViewer()); @@ -178,7 +176,6 @@ public function linkGroup($circleUniqueId, $groupId) { * @throws GroupDoesNotExistException */ private function getFreshNewMember($circleId, $groupId) { - if (!$this->groupManager->groupExists($groupId)) { throw new GroupDoesNotExistException($this->l10n->t("This group does not exist")); } @@ -211,7 +208,6 @@ private function getFreshNewMember($circleId, $groupId) { * @throws \Exception */ public function levelGroup($circleUniqueId, $groupId, $level) { - $level = (int)$level; try { $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); @@ -241,7 +237,6 @@ public function levelGroup($circleUniqueId, $groupId, $level) { } catch (\Exception $e) { throw $e; } - } @@ -264,7 +259,6 @@ private function editGroupLevel(DeprecatedCircle $circle, DeprecatedMember $grou $group->setLevel($level); $this->membersRequest->updateGroup($group); - } catch (\Exception $e) { throw $e; } @@ -307,6 +301,4 @@ public function unlinkGroup($circleUniqueId, $groupId) { public function onGroupRemoved($groupId) { $this->membersRequest->unlinkAllFromGroup($groupId); } - - } diff --git a/lib/Service/InterfaceService.php b/lib/Service/InterfaceService.php index a645bf7a0..1cdab371e 100644 --- a/lib/Service/InterfaceService.php +++ b/lib/Service/InterfaceService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\Db\RemoteRequest; @@ -40,31 +39,29 @@ use OCP\IRequest; use OCP\IURLGenerator; - /** * Class InterfaceService * * @package OCA\Circles\Service */ class InterfaceService { - - const IFACE0 = 1; - const IFACE1 = 2; - const IFACE2 = 3; - const IFACE3 = 4; - const IFACE4 = 5; - const IFACE_INTERNAL = 6; - const IFACE_FRONTAL = 7; - const IFACE_TEST = 99; + public const IFACE0 = 1; + public const IFACE1 = 2; + public const IFACE2 = 3; + public const IFACE3 = 4; + public const IFACE4 = 5; + public const IFACE_INTERNAL = 6; + public const IFACE_FRONTAL = 7; + public const IFACE_TEST = 99; public static $LIST_IFACE = [ self::IFACE_INTERNAL => 'internal', - self::IFACE_FRONTAL => 'frontal', - self::IFACE0 => 'iface0', - self::IFACE1 => 'iface1', - self::IFACE2 => 'iface2', - self::IFACE3 => 'iface3', - self::IFACE4 => 'iface4', + self::IFACE_FRONTAL => 'frontal', + self::IFACE0 => 'iface0', + self::IFACE1 => 'iface1', + self::IFACE2 => 'iface2', + self::IFACE3 => 'iface3', + self::IFACE4 => 'iface4', ]; @@ -176,12 +173,12 @@ public function isInterfaceInternal(int $interface): bool { public function setCurrentInterfaceFromRequest(IRequest $request, string $testToken = ''): void { $testing = [ self::IFACE_INTERNAL => $this->configService->getInternalInstance(), - self::IFACE_FRONTAL => $this->configService->getFrontalInstance(), - self::IFACE0 => $this->configService->getIfaceInstance(self::IFACE0), - self::IFACE1 => $this->configService->getIfaceInstance(self::IFACE1), - self::IFACE2 => $this->configService->getIfaceInstance(self::IFACE2), - self::IFACE3 => $this->configService->getIfaceInstance(self::IFACE3), - self::IFACE4 => $this->configService->getIfaceInstance(self::IFACE4), + self::IFACE_FRONTAL => $this->configService->getFrontalInstance(), + self::IFACE0 => $this->configService->getIfaceInstance(self::IFACE0), + self::IFACE1 => $this->configService->getIfaceInstance(self::IFACE1), + self::IFACE2 => $this->configService->getIfaceInstance(self::IFACE2), + self::IFACE3 => $this->configService->getIfaceInstance(self::IFACE3), + self::IFACE4 => $this->configService->getIfaceInstance(self::IFACE4), ]; if ($testToken !== '' @@ -235,12 +232,12 @@ public function setCurrentInterfaceFromInstance(string $instance): void { public function getInterfaces(bool $useString = false): array { $interfaces = [ self::IFACE_INTERNAL => $this->configService->getInternalInstance(), - self::IFACE_FRONTAL => $this->configService->getFrontalInstance(), - self::IFACE0 => $this->configService->getIfaceInstance(InterfaceService::IFACE0), - self::IFACE1 => $this->configService->getIfaceInstance(InterfaceService::IFACE1), - self::IFACE2 => $this->configService->getIfaceInstance(InterfaceService::IFACE2), - self::IFACE3 => $this->configService->getIfaceInstance(InterfaceService::IFACE3), - self::IFACE4 => $this->configService->getIfaceInstance(InterfaceService::IFACE4) + self::IFACE_FRONTAL => $this->configService->getFrontalInstance(), + self::IFACE0 => $this->configService->getIfaceInstance(InterfaceService::IFACE0), + self::IFACE1 => $this->configService->getIfaceInstance(InterfaceService::IFACE1), + self::IFACE2 => $this->configService->getIfaceInstance(InterfaceService::IFACE2), + self::IFACE3 => $this->configService->getIfaceInstance(InterfaceService::IFACE3), + self::IFACE4 => $this->configService->getIfaceInstance(InterfaceService::IFACE4) ]; if (!$useString) { @@ -380,6 +377,4 @@ public function getLocalInstance(): string { private function getTestingInstance(): string { return $this->configService->getAppValue(ConfigService::IFACE_TEST_ID); } - } - diff --git a/lib/Service/MaintenanceService.php b/lib/Service/MaintenanceService.php index 464917917..f56bb3209 100644 --- a/lib/Service/MaintenanceService.php +++ b/lib/Service/MaintenanceService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use Exception; @@ -45,19 +44,16 @@ use OCP\IUserManager; use Symfony\Component\Console\Output\OutputInterface; - /** * Class MaintenanceService * * @package OCA\Circles\Service */ class MaintenanceService { - - use TNC22Logger; - const TIMEOUT = 18000; + public const TIMEOUT = 18000; /** @var IUserManager */ @@ -258,7 +254,6 @@ private function runMaintenance5(): void { // $this->refreshDisplayName(); // } catch (Exception $e) { // } - } @@ -343,6 +338,4 @@ private function output(string $message): void { $this->output->writeln('- ' . $message); } } - } - diff --git a/lib/Service/MemberService.php b/lib/Service/MemberService.php index 5de602c04..c6bf0996c 100644 --- a/lib/Service/MemberService.php +++ b/lib/Service/MemberService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; @@ -65,15 +64,12 @@ use OCA\Circles\Model\FederatedUser; use OCA\Circles\Model\Member; - /** * Class MemberService * * @package OCA\Circles\Service */ class MemberService { - - use TArrayTools; use TStringTools; use TNC22Logger; @@ -255,7 +251,7 @@ public function addMembers(string $circleId, array $federatedUsers): array { } $members = array_map( - function(FederatedUser $federatedUser) use ($patron) { + function (FederatedUser $federatedUser) use ($patron) { $member = new Member(); $member->importFromIFederatedUser($federatedUser); $member->setInvitedBy($patron); @@ -361,6 +357,4 @@ public function insertOrUpdate(Member $member): bool { return true; } - } - diff --git a/lib/Service/MembersService.php b/lib/Service/MembersService.php index d479d6142..11288df0b 100644 --- a/lib/Service/MembersService.php +++ b/lib/Service/MembersService.php @@ -26,7 +26,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; use ArtificialOwl\MySmallPhpTools\Exceptions\RequestResultNotJsonException; use ArtificialOwl\MySmallPhpTools\Model\Nextcloud\nc22\NC22Request; @@ -58,7 +57,6 @@ use OCP\IL10N; use OCP\IUserManager; - /** * Class MembersService * @@ -66,8 +64,6 @@ * @package OCA\Circles\Service */ class MembersService { - - use TNC22Request; use TArrayTools; @@ -283,7 +279,6 @@ public function addMemberBasedOnItsType(DeprecatedCircle $circle, DeprecatedMemb * @throws MemberCantJoinCircleException */ private function addLocalMember(DeprecatedCircle $circle, DeprecatedMember $member) { - if ($member->getType() !== DeprecatedMember::TYPE_USER) { return; } @@ -303,7 +298,6 @@ private function addLocalMember(DeprecatedCircle $circle, DeprecatedMember $memb * @param DeprecatedMember $member */ private function addEmailAddress(DeprecatedMember $member) { - if ($member->getType() !== DeprecatedMember::TYPE_MAIL) { return; } @@ -319,7 +313,6 @@ private function addEmailAddress(DeprecatedMember $member) { * @param DeprecatedMember $member */ private function addContact(DeprecatedMember $member) { - if ($member->getType() !== DeprecatedMember::TYPE_CONTACT) { return; } @@ -457,7 +450,6 @@ private function addGroupMembers(DeprecatedCircle $circle, $groupId): array { * @return DeprecatedMember[] */ private function addMassiveMails(DeprecatedCircle $circle, $mails): array { - $mails = trim($mails); if (substr($mails, 0, 6) !== 'mails:') { return []; @@ -584,7 +576,6 @@ public function levelMember( } else { return $this->membersRequest->forceGetMembers($circle->getUniqueId()); } - } @@ -605,7 +596,6 @@ public function levelMember( public function removeMember( string $circleUniqueId, string $name, int $type, string $instance, bool $force = false ): array { - if ($force === false) { $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); $circle->getHigherViewer() @@ -782,7 +772,4 @@ private function filterDuplicate(array $curr, array $new): array { return array_merge($base, $new); } - - } - diff --git a/lib/Service/MembershipService.php b/lib/Service/MembershipService.php index 69650f6f3..dbb07e1aa 100644 --- a/lib/Service/MembershipService.php +++ b/lib/Service/MembershipService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Exceptions\ItemNotFoundException; use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; @@ -46,15 +45,12 @@ use OCA\Circles\Model\Member; use OCA\Circles\Model\Membership; - /** * Class MembershipService * * @package OCA\Circles\Service */ class MembershipService { - - use TNC22Logger; @@ -280,7 +276,7 @@ private function updateMembershipsDatabase(string $singleId, array $memberships) */ private function getChildrenMembers(string $id, array &$knownIds = []): array { $singleIds = array_map( - function(Member $item): string { + function (Member $item): string { return $item->getSingleId(); }, $this->memberRequest->getMembers($id) ); @@ -304,7 +300,7 @@ function(Member $item): string { */ private function getChildrenMemberships(string $id, array &$knownIds = []): array { $singleIds = array_map( - function(Membership $item): string { + function (Membership $item): string { return $item->getSingleId(); }, $this->membershipRequest->getInherited($id) ); @@ -350,7 +346,7 @@ private function fillMemberships(Membership $membership, array &$memberships) { */ private function removeDeprecatedMemberships(array $memberships, array $known): array { $circleIds = array_map( - function(Membership $membership): string { + function (Membership $membership): string { return $membership->getCircleId(); }, $memberships ); @@ -408,6 +404,4 @@ private function getMembershipsFromList(array $list, string $circleId): Membersh throw new ItemNotFoundException(); } - } - diff --git a/lib/Service/MigrationService.php b/lib/Service/MigrationService.php index e18f82a0d..4b71984a0 100644 --- a/lib/Service/MigrationService.php +++ b/lib/Service/MigrationService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; @@ -70,15 +69,12 @@ use OCP\IURLGenerator; use OCP\Share\IShare; - /** * Class MigrationService * * @package OCA\Circles\Service */ class MigrationService { - - use TStringTools; use TNC22Logger; @@ -446,7 +442,7 @@ private function convertMemberUserTypeFrom21(Member $member, int $userType): voi * @throws ContactAddressBookNotFoundException */ private function fixContactId(Member $member) { - list($userId, $contactId) = explode(':', $member->getUserId()); + [$userId, $contactId] = explode(':', $member->getUserId()); $contactsManager = OC::$server->get(ContactsManager::class); @@ -552,6 +548,4 @@ private function saveGeneratedShareToken(ShareToken $shareToken): void { } catch (RequestBuilderException $e) { } } - } - diff --git a/lib/Service/MiscService.php b/lib/Service/MiscService.php index 6317bb5e9..03d17197f 100644 --- a/lib/Service/MiscService.php +++ b/lib/Service/MiscService.php @@ -40,8 +40,6 @@ use OCP\IUserManager; class MiscService { - - use TArrayTools; @@ -67,10 +65,10 @@ public function __construct( } public function log($message, $level = 4) { - $data = array( - 'app' => $this->appName, + $data = [ + 'app' => $this->appName, 'level' => $level - ); + ]; $this->logger->log($level, $message, $data); } @@ -123,7 +121,7 @@ public function fail($data) { $this->log(json_encode($data)); return new DataResponse( - array_merge($data, array('status' => 0)), + array_merge($data, ['status' => 0]), Http::STATUS_NON_AUTHORATIVE_INFORMATION ); } @@ -136,7 +134,7 @@ public function fail($data) { */ public function success($data) { return new DataResponse( - array_merge($data, array('status' => 1)), + array_merge($data, ['status' => 1]), Http::STATUS_CREATED ); } @@ -177,7 +175,7 @@ public function getContactDisplayName(string $ident): string { return ''; } - list($userId, $contactId) = explode(':', $ident); + [$userId, $contactId] = explode(':', $ident); $entries = []; try { /** @var \OCA\DAV\CardDAV\ContactsManager $cManager */ @@ -268,7 +266,7 @@ public static function getContactData($ident) { return []; } - list($userId, $contactId) = explode(':', $ident); + [$userId, $contactId] = explode(':', $ident); try { /** @var \OCA\DAV\CardDAV\ContactsManager $cManager */ @@ -345,8 +343,8 @@ public function getDisplayName($userId, $noException = false) { */ public static function generateClientBodyData($options = []) { return [ - 'body' => ['data' => $options], - 'timeout' => Application::CLIENT_TIMEOUT, + 'body' => ['data' => $options], + 'timeout' => Application::CLIENT_TIMEOUT, 'connect_timeout' => Application::CLIENT_TIMEOUT ]; } @@ -406,11 +404,8 @@ public function getInfosFromContact(DeprecatedMember $member) { return [ 'memberId' => $member->getMemberId(), - 'emails' => $this->getArray('EMAIL', $contact), + 'emails' => $this->getArray('EMAIL', $contact), 'cloudIds' => $this->getArray('CLOUD', $contact) ]; - } - } - diff --git a/lib/Service/NotificationService.php b/lib/Service/NotificationService.php index fc9500430..5f14f76cf 100644 --- a/lib/Service/NotificationService.php +++ b/lib/Service/NotificationService.php @@ -34,7 +34,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use OCA\Circles\AppInfo\Application; use OCA\Circles\Db\MemberRequest; @@ -44,15 +43,12 @@ use OCP\Notification\IManager as INotificationManager; use OCP\Notification\INotification; - /** * Class NotificationService * * @package OCA\Circles\Service */ class NotificationService { - - use TNC22Logger; @@ -178,7 +174,6 @@ public function notificationRequested(Member $member): void { $this->notificationManager->notify($notification); } - } @@ -233,6 +228,4 @@ private function linkToOCS(string $route, array $params = []): string { return parse_url($absolute, PHP_URL_PATH); } - } - diff --git a/lib/Service/OutputService.php b/lib/Service/OutputService.php index 7a9b7fa3e..cb6f628e3 100644 --- a/lib/Service/OutputService.php +++ b/lib/Service/OutputService.php @@ -31,21 +31,17 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCP\Migration\IOutput; use Symfony\Component\Console\Output\OutputInterface; - /** * Class OutputService * * @package OCA\Circles\Service */ class OutputService { - - use TStringTools; use TNC22Logger; @@ -117,6 +113,4 @@ public function finishMigrationProgress(): void { $this->migrationOutput->finishProgress(); } - } - diff --git a/lib/Service/RemoteDownstreamService.php b/lib/Service/RemoteDownstreamService.php index 339f1e452..b4a9cc551 100644 --- a/lib/Service/RemoteDownstreamService.php +++ b/lib/Service/RemoteDownstreamService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; use ArtificialOwl\MySmallPhpTools\Exceptions\SignatoryException; @@ -55,15 +54,12 @@ use OCA\Circles\Exceptions\UnknownRemoteException; use OCA\Circles\Model\Federated\FederatedEvent; - /** * Class RemoteDownstreamService * * @package OCA\Circles\Service */ class RemoteDownstreamService { - - use TNC22Logger; use TAsync; @@ -334,6 +330,4 @@ private function confirmOriginEvent(FederatedEvent $event): void { throw new FederatedEventException('invalid origin'); } } - } - diff --git a/lib/Service/RemoteService.php b/lib/Service/RemoteService.php index 3a23dc3f9..e372e66c3 100644 --- a/lib/Service/RemoteService.php +++ b/lib/Service/RemoteService.php @@ -30,7 +30,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\ActivityPub\Nextcloud\nc22\NC22Signature; use ArtificialOwl\MySmallPhpTools\Exceptions\InvalidItemException; use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; @@ -54,7 +53,6 @@ use OCA\Circles\Model\FederatedUser; use OCA\Circles\Model\Member; - /** * Class RemoteService * @@ -233,7 +231,6 @@ public function syncCircle(Circle $circle): void { * @param Circle $circle */ private function syncLocalCircle(Circle $circle): void { - } @@ -325,7 +322,6 @@ public function getFederatedUserFromInstance( string $instance, int $type = Member::TYPE_USER ): FederatedUser { - $result = $this->remoteStreamService->resultRequestRemoteInstance( $instance, RemoteInstance::MEMBER, @@ -350,6 +346,4 @@ public function getFederatedUserFromInstance( return $federatedUser; } - } - diff --git a/lib/Service/RemoteStreamService.php b/lib/Service/RemoteStreamService.php index 8a9c748ba..aea86357d 100644 --- a/lib/Service/RemoteStreamService.php +++ b/lib/Service/RemoteStreamService.php @@ -30,7 +30,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\ActivityPub\Nextcloud\nc22\NC22Signature; use ArtificialOwl\MySmallPhpTools\Exceptions\RequestNetworkException; use ArtificialOwl\MySmallPhpTools\Exceptions\SignatoryException; @@ -63,26 +62,23 @@ use ReflectionClass; use ReflectionException; - /** * Class RemoteStreamService * * @package OCA\Circles\Service */ class RemoteStreamService extends NC22Signature { - - use TNC22Deserialize; use TNC22LocalSignatory; use TStringTools; use TNC22WellKnown; - const UPDATE_DATA = 'data'; - const UPDATE_ITEM = 'item'; - const UPDATE_TYPE = 'type'; - const UPDATE_INSTANCE = 'instance'; - const UPDATE_HREF = 'href'; + public const UPDATE_DATA = 'data'; + public const UPDATE_ITEM = 'item'; + public const UPDATE_TYPE = 'type'; + public const UPDATE_INSTANCE = 'instance'; + public const UPDATE_HREF = 'href'; /** @var IURLGenerator */ @@ -436,7 +432,7 @@ public function addRemoteInstance( * @throws SignatureException */ private function confirmAuth(RemoteInstance $remote, string $auth): void { - list($algo, $signed) = explode(':', $this->get('auth-signed', $remote->getOrigData())); + [$algo, $signed] = explode(':', $this->get('auth-signed', $remote->getOrigData())); try { if ($signed === null) { throw new SignatureException('invalid auth-signed'); @@ -575,6 +571,4 @@ public function update(RemoteInstance $remote, string $update = self::UPDATE_DAT break; } } - } - diff --git a/lib/Service/RemoteUpstreamService.php b/lib/Service/RemoteUpstreamService.php index 3e0754883..e510d8a2c 100644 --- a/lib/Service/RemoteUpstreamService.php +++ b/lib/Service/RemoteUpstreamService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Model\Request; use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Request; @@ -46,15 +45,12 @@ use OCA\Circles\Model\Federated\FederatedEvent; use OCA\Circles\Model\Federated\RemoteInstance; - /** * Class RemoteUpstreamService * * @package OCA\Circles\Service */ class RemoteUpstreamService { - - use TNC22Request; @@ -314,6 +310,4 @@ public function confirmEvent(FederatedEvent $event): void { //// $this->deprecatedEvents(); // // } - } - diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php index a1c018ac8..aaddf5992 100644 --- a/lib/Service/SearchService.php +++ b/lib/Service/SearchService.php @@ -31,22 +31,18 @@ namespace OCA\Circles\Service; - use OC; use OCA\Circles\ISearch; use OCA\Circles\Model\FederatedUser; use OCA\Circles\Search\FederatedUsers; - /** * Class SearchService * * @package OCA\Circles\Service */ class SearchService { - - - static $SERVICES = [ + public static $SERVICES = [ FederatedUsers::class ]; @@ -76,6 +72,4 @@ public function search(string $needle): array { return $result; } - } - diff --git a/lib/Service/ShareService.php b/lib/Service/ShareService.php index d1776e13b..1235fd62c 100644 --- a/lib/Service/ShareService.php +++ b/lib/Service/ShareService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use OCA\Circles\Model\Circle; use OCA\Circles\Model\Federated\FederatedEvent; @@ -70,5 +69,4 @@ public function syncRemoteShares(Circle $circle) { // $event->setCircle($circle); // $this->federatedEventService->newEvent($event); } - } diff --git a/lib/Service/ShareTokenService.php b/lib/Service/ShareTokenService.php index c5e61e622..98edee6bc 100644 --- a/lib/Service/ShareTokenService.php +++ b/lib/Service/ShareTokenService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\Db\ShareTokenRequest; use OCA\Circles\Exceptions\ShareTokenAlreadyExistException; @@ -42,15 +41,12 @@ use OCP\IURLGenerator; use OCP\Share\IShare; - /** * Class ShareTokenService * * @package OCA\Circles\Service */ class ShareTokenService { - - use TStringTools; @@ -133,6 +129,4 @@ public function setShareTokenLink(ShareToken $shareToken): void { public function removeTokens(string $singleId, string $circleId) { $this->shareTokenRequest->removeTokens($singleId, $circleId); } - } - diff --git a/lib/Service/ShareWrapperService.php b/lib/Service/ShareWrapperService.php index a9540d20f..b52df30f5 100644 --- a/lib/Service/ShareWrapperService.php +++ b/lib/Service/ShareWrapperService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use OCA\Circles\Db\ShareWrapperRequest; use OCA\Circles\Exceptions\RequestBuilderException; @@ -41,15 +40,12 @@ use OCP\Files\NotFoundException; use OCP\Share\IShare; - /** * Class ShareWrapperService * * @package OCA\Circles\Service */ class ShareWrapperService { - - use TStringTools; @@ -262,6 +258,4 @@ private function createChild(IShare $share, FederatedUser $federatedUser): Share return $this->getShareById($childId, $federatedUser); } - } - diff --git a/lib/Service/SyncService.php b/lib/Service/SyncService.php index f242de505..cc8d2659f 100644 --- a/lib/Service/SyncService.php +++ b/lib/Service/SyncService.php @@ -31,7 +31,6 @@ namespace OCA\Circles\Service; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; use Exception; @@ -65,26 +64,23 @@ use OCP\IGroupManager; use OCP\IUserManager; - /** * Class SyncService * * @package OCA\Circles\Service */ class SyncService { - - use TStringTools; use TNC22Logger; - const SYNC_APPS = 1; - const SYNC_USERS = 2; - const SYNC_GROUPS = 4; - const SYNC_GLOBALSCALE = 8; - const SYNC_REMOTES = 16; - const SYNC_CONTACTS = 32; - const SYNC_ALL = 63; + public const SYNC_APPS = 1; + public const SYNC_USERS = 2; + public const SYNC_GROUPS = 4; + public const SYNC_GLOBALSCALE = 8; + public const SYNC_REMOTES = 16; + public const SYNC_CONTACTS = 32; + public const SYNC_ALL = 63; /** @var IUserManager */ @@ -518,6 +514,4 @@ public function syncRemote(): void { */ public function syncRemoteCircle(string $circleId): void { } - } - diff --git a/lib/Service/TimezoneService.php b/lib/Service/TimezoneService.php index e57760061..cadae2dc7 100644 --- a/lib/Service/TimezoneService.php +++ b/lib/Service/TimezoneService.php @@ -26,7 +26,6 @@ namespace OCA\Circles\Service; - use DateTime; use OC\AppFramework\Utility\TimeFactory; @@ -117,5 +116,3 @@ public function getUTCDate(): string { return $format; } } - - diff --git a/lib/ShareByCircleProvider.php b/lib/ShareByCircleProvider.php index c6f5520df..11216f976 100644 --- a/lib/ShareByCircleProvider.php +++ b/lib/ShareByCircleProvider.php @@ -34,7 +34,6 @@ namespace OCA\Circles; - use ArtificialOwl\MySmallPhpTools\Traits\Nextcloud\nc22\TNC22Logger; use ArtificialOwl\MySmallPhpTools\Traits\TArrayTools; use ArtificialOwl\MySmallPhpTools\Traits\TStringTools; @@ -85,21 +84,18 @@ use OCP\Share\IShare; use OCP\Share\IShareProvider; - /** * Class ShareByCircleProvider * * @package OCA\Circles */ class ShareByCircleProvider implements IShareProvider { - - use TArrayTools; use TStringTools; use TNC22Logger; - const IDENTIFIER = 'ocCircleShare'; + public const IDENTIFIER = 'ocCircleShare'; /** @var IUserManager */ @@ -463,7 +459,7 @@ public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offs return array_filter( array_map( - function(ShareWrapper $wrapper) { + function (ShareWrapper $wrapper) { return $wrapper->getShare($this->rootFolder, $this->userManager, $this->urlGenerator); }, $wrappedShares ) @@ -515,7 +511,7 @@ public function getSharesByPath(Node $path): array { return array_filter( array_map( - function(ShareWrapper $wrapper) { + function (ShareWrapper $wrapper) { return $wrapper->getShare($this->rootFolder, $this->userManager, $this->urlGenerator); }, $wrappedShares ) @@ -559,7 +555,7 @@ public function getSharedWith($userId, $shareType, $node, $limit, $offset): arra return array_filter( array_map( - function(ShareWrapper $wrapper) { + function (ShareWrapper $wrapper) { return $wrapper->getShare( $this->rootFolder, $this->userManager, $this->urlGenerator, true ); @@ -661,6 +657,4 @@ public function getAllShares(): iterable { // } // $cursor->closeCursor(); } - } - diff --git a/lib/ShareByCircleProviderDeprecated.php b/lib/ShareByCircleProviderDeprecated.php index ae611a0ed..b1ad60739 100644 --- a/lib/ShareByCircleProviderDeprecated.php +++ b/lib/ShareByCircleProviderDeprecated.php @@ -30,7 +30,6 @@ namespace OCA\Circles; - use ArtificialOwl\MySmallPhpTools\Model\SimpleDataStore; use Exception; use OC; @@ -72,7 +71,6 @@ use OCP\Share\IShare; use OCP\Share\IShareProvider; - /** * Class ShareByCircleProvider * @@ -215,7 +213,6 @@ public function create(IShare $share) { * @return IShare The share object */ public function update(IShare $share) { - $qb = $this->getBaseUpdateSql(); $this->limitToShare($qb, $share->getId()); $qb->set('permissions', $qb->createNamedParameter($share->getPermissions())) @@ -247,8 +244,8 @@ public function delete(IShare $share) { $store = new SimpleDataStore(); $store->sArray( 'share', [ - 'id' => $share->getId() - ] + 'id' => $share->getId() + ] ); $event->setData($store); @@ -288,7 +285,6 @@ public function deleteFromSelf(IShare $share, $userId) { * */ public function move(IShare $share, $userId) { - $childId = $this->getShareChildId($share, $userId); $qb = $this->getBaseUpdateSql(); @@ -496,7 +492,7 @@ public function getShareById($shareId, $recipientId = null) { /** * Get shares for a given path - + * * @param Node $path * * @return IShare[]|null @@ -554,7 +550,6 @@ public function getSharedWith($userId, $shareType, $node, $limit, $offset) { * @throws NotFoundException */ private function getSharedWithCircleMembers($userId, $shareType, $node, $limit, $offset) { - $qb = $this->getCompleteSelectSql(); $this->linkToFileCache($qb, $userId); $this->limitToPage($qb, $limit, $offset); @@ -753,7 +748,7 @@ private function createShareObject($data) { if (($password = $this->get('personal_password', $data, '')) !== '') { $share->setPassword($this->get('personal_password', $data, '')); - } else if (($password = $this->get('password', $data, '')) !== '') { + } elseif (($password = $this->get('password', $data, '')) !== '') { $share->setPassword($this->get('password', $data, '')); } @@ -835,7 +830,7 @@ private function errorShareAlreadyExist($share) { ->getName(); $message = 'Sharing %s failed, this item is already shared with this circle'; - $message_t = $this->l10n->t($message, array($share_src)); + $message_t = $this->l10n->t($message, [$share_src]); $this->logger->debug( sprintf($message, $share_src, $share->getSharedWith()), ['app' => 'circles'] ); @@ -901,7 +896,6 @@ public function restore(IShare $share, string $recipient): IShare { * @return array */ private function parseAccessListResult(IQueryBuilder $qb) { - $cursor = $qb->execute(); $users = []; @@ -910,7 +904,7 @@ private function parseAccessListResult(IQueryBuilder $qb) { if (!key_exists($userId, $users)) { $users[$userId] = [ - 'node_id' => $row['file_source'], + 'node_id' => $row['file_source'], 'node_path' => $row['file_target'] ]; } @@ -929,14 +923,14 @@ private function parseAccessListResult(IQueryBuilder $qb) { */ private function shareObjectToArray(IShare $share) { return [ - 'id' => $share->getId(), - 'sharedWith' => $share->getSharedWith(), - 'sharedBy' => $share->getSharedBy(), - 'nodeId' => $share->getNodeId(), - 'shareOwner' => $share->getShareOwner(), + 'id' => $share->getId(), + 'sharedWith' => $share->getSharedWith(), + 'sharedBy' => $share->getSharedBy(), + 'nodeId' => $share->getNodeId(), + 'shareOwner' => $share->getShareOwner(), 'permissions' => $share->getPermissions(), - 'token' => $share->getToken(), - 'password' => ($share->getPassword() === null) ? '' : $share->getPassword() + 'token' => $share->getToken(), + 'password' => ($share->getPassword() === null) ? '' : $share->getPassword() ]; } @@ -1025,6 +1019,4 @@ protected function token(int $length = 15): string { return $str; } - - } diff --git a/lib/StatusCode.php b/lib/StatusCode.php index e115e3583..aca51529e 100644 --- a/lib/StatusCode.php +++ b/lib/StatusCode.php @@ -31,35 +31,32 @@ namespace OCA\Circles; - /** * Class StatusCode * * @package OCA\Circles */ class StatusCode { - - - static $CIRCLE_CREATE = [ + public static $CIRCLE_CREATE = [ 120 => 'Duplicate name' ]; - static $CIRCLE_CONFIG = [ + public static $CIRCLE_CONFIG = [ 120 => 'Invalid configuration' ]; - static $CIRCLE_JOIN = [ + public static $CIRCLE_JOIN = [ 121 => 'Circle is full', 122 => 'You are already a member', 123 => 'Already requesting to join the circle', 124 => 'Circle is closed' ]; - static $CIRCLE_LEAVE = [ + public static $CIRCLE_LEAVE = [ 120 => 'You are not a member' ]; - static $MEMBER_ADD = [ + public static $MEMBER_ADD = [ 120 => 'Unknown entity', 121 => 'Circle is full', 122 => 'Already member of the circle', @@ -73,17 +70,16 @@ class StatusCode { 130 => 'Member is invited by an entity that does not belongs to the instance at the origin of the request' ]; - static $MEMBER_LEVEL = [ + public static $MEMBER_LEVEL = [ 120 => 'The designed member\'s level is too high', 121 => 'Incorrect Level' ]; - static $MEMBER_DISPLAY_NAME = [ + public static $MEMBER_DISPLAY_NAME = [ 120 => 'DisplayName cannot be empty' ]; - static $MEMBER_REMOVE = [ + public static $MEMBER_REMOVE = [ 120 => 'The designed member\'s level is too high', ]; - } diff --git a/templates/files/list.php b/templates/files/list.php index 841ce7b5b..b2929034b 100644 --- a/templates/files/list.php +++ b/templates/files/list.php @@ -18,14 +18,14 @@ t('Size')); ?> - t( 'Modified' )); ?> + t('Modified')); ?> diff --git a/tests/TestSuiteListener.php b/tests/TestSuiteListener.php index 12fbfea8d..01bab5445 100644 --- a/tests/TestSuiteListener.php +++ b/tests/TestSuiteListener.php @@ -27,31 +27,28 @@ namespace OCA\Circles\Tests; - use OCA\Circles\Model\DeprecatedCircle; class Env implements \PHPUnit_Framework_TestListener { + public const ENV_TEST_OWNER1 = '_test_circles_owner1'; + public const ENV_TEST_OWNER2 = '_test_circles_owner2'; + public const ENV_TEST_OWNER3 = '_test_circles_owner3'; + public const ENV_TEST_ADMIN1 = '_test_circles_admin1'; + public const ENV_TEST_ADMIN2 = '_test_circles_admin2'; + public const ENV_TEST_ADMIN3 = '_test_circles_admin3'; - const ENV_TEST_OWNER1 = '_test_circles_owner1'; - const ENV_TEST_OWNER2 = '_test_circles_owner2'; - const ENV_TEST_OWNER3 = '_test_circles_owner3'; - - const ENV_TEST_ADMIN1 = '_test_circles_admin1'; - const ENV_TEST_ADMIN2 = '_test_circles_admin2'; - const ENV_TEST_ADMIN3 = '_test_circles_admin3'; - - const ENV_TEST_MODERATOR1 = '_test_circles_mod1'; - const ENV_TEST_MODERATOR2 = '_test_circles_mod2'; - const ENV_TEST_MODERATOR3 = '_test_circles_mod3'; + public const ENV_TEST_MODERATOR1 = '_test_circles_mod1'; + public const ENV_TEST_MODERATOR2 = '_test_circles_mod2'; + public const ENV_TEST_MODERATOR3 = '_test_circles_mod3'; - const ENV_TEST_MEMBER1 = '_test_circles_member1'; - const ENV_TEST_MEMBER2 = '_test_circles_member2'; - const ENV_TEST_MEMBER3 = '_test_circles_member3'; + public const ENV_TEST_MEMBER1 = '_test_circles_member1'; + public const ENV_TEST_MEMBER2 = '_test_circles_member2'; + public const ENV_TEST_MEMBER3 = '_test_circles_member3'; - const ENV_TEST_USER1 = '_test_circles_user1'; - const ENV_TEST_USER2 = '_test_circles_user2'; - const ENV_TEST_USER3 = '_test_circles_user3'; + public const ENV_TEST_USER1 = '_test_circles_user1'; + public const ENV_TEST_USER2 = '_test_circles_user2'; + public const ENV_TEST_USER3 = '_test_circles_user3'; /** @var array */ @@ -88,7 +85,7 @@ public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) { $userManager = \OC::$server->getUserManager(); $this->users = self::listUsers(); - foreach ($this->users AS $UID) { + foreach ($this->users as $UID) { if ($userManager->userExists($UID) === false) { $userManager->createUser($UID, $UID); } @@ -100,7 +97,7 @@ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) { return; } - foreach ($this->users AS $UID) { + foreach ($this->users as $UID) { $user = \OC::$server->getUserManager() ->get($UID); if ($user !== null) { @@ -114,7 +111,6 @@ public function addWarning(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_War } public static function setUser($which) { - $userSession = \OC::$server->getUserSession(); $userSession->setUser( \OC::$server->getUserManager() @@ -165,5 +161,3 @@ public static function listCircleTypes() { ]; } } - - diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c6a208fe7..4d16b4deb 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,6 +1,5 @@ circles = array(); + $this->circles = []; try { $this->circles = [ - 'Public' => + 'Public' => Circles::createCircle(DeprecatedCircle::CIRCLES_PUBLIC, self::NAME_PUBLIC_CIRCLE1), - 'Secret' => + 'Secret' => Circles::createCircle(DeprecatedCircle::CIRCLES_SECRET, self::NAME_SECRET_CIRCLE1), - 'Closed' => + 'Closed' => Circles::createCircle(DeprecatedCircle::CIRCLES_CLOSED, self::NAME_CLOSED_CIRCLE1), 'Personal' => Circles::createCircle(DeprecatedCircle::CIRCLES_PERSONAL, self::NAME_PERSONAL_CIRCLE1) ]; - } catch (Exception $e) { throw $e; } @@ -186,7 +183,6 @@ public function testLevelMemberInCircles() { Env::setUser(Env::ENV_TEST_ADMIN1); foreach ($circles as $circle) { - try { Circles::levelMember( $circle->getId(), Env::ENV_TEST_ADMIN3, DeprecatedMember::TYPE_USER, @@ -348,7 +344,6 @@ public function testLevelMemberInCircles() { 'should have returned a MemberIsNotModeratorException - ' . $e->getMessage() ); } - } Env::logout(); @@ -398,7 +393,6 @@ public function testCreateCircleWithDuplicate() { true, false, 'should have returned a CircleAlreadyExistsException' ); } - } else { for ($j = 0; $j < sizeof($circleNames); $j++) { try { @@ -481,7 +475,6 @@ public function testAddAndRemoveUser() { for ($i = 0; $i < 3; $i++) { foreach ($this->circles as $circle) { - try { $member = Circles::getMember( $circle->getId(), Env::ENV_TEST_MEMBER2, DeprecatedMember::TYPE_USER @@ -562,11 +555,9 @@ public function testAddAndRemoveUser() { ); } catch (MemberDoesNotExistException $e) { } - } catch (Exception $e) { throw $e; } - } } @@ -584,7 +575,6 @@ public function testJoinCircleAndLeave() { for ($i = 0; $i < 3; $i++) { foreach ($this->circles as $circle) { - try { $member = Circles::getMember( $circle->getId(), Env::ENV_TEST_MEMBER3, DeprecatedMember::TYPE_USER @@ -666,7 +656,6 @@ public function testJoinCircleAndLeave() { $member->getCircleId() ] ); - } catch (Exception $e) { throw $e; } @@ -709,7 +698,6 @@ public function testJoinCircleAndLeave() { throw $e; } Env::setUser(Env::ENV_TEST_MEMBER3); - } } } @@ -760,11 +748,11 @@ public function testListCircles() { $this->assertEquals( $result, [ - self::NAME_PUBLIC_CIRCLE1, - self::NAME_SECRET_CIRCLE1, - self::NAME_CLOSED_CIRCLE1, - self::NAME_PERSONAL_CIRCLE1 - ] + self::NAME_PUBLIC_CIRCLE1, + self::NAME_SECRET_CIRCLE1, + self::NAME_CLOSED_CIRCLE1, + self::NAME_PERSONAL_CIRCLE1 + ] ); @@ -781,10 +769,10 @@ public function testListCircles() { $this->assertEquals( $result, [ - self::NAME_PUBLIC_CIRCLE1, - self::NAME_SECRET_CIRCLE1, - self::NAME_CLOSED_CIRCLE1 - ] + self::NAME_PUBLIC_CIRCLE1, + self::NAME_SECRET_CIRCLE1, + self::NAME_CLOSED_CIRCLE1 + ] ); @@ -867,7 +855,6 @@ public function testDetailsCircle() { * @throws QueryException */ protected function generateSimpleCircleWithAllLevel($circleId, $isClosed = false) { - $curr = Env::currentUser(); Circles::addMember($circleId, Env::ENV_TEST_ADMIN1, DeprecatedMember::TYPE_USER); @@ -901,5 +888,4 @@ protected function generateSimpleCircleWithAllLevel($circleId, $isClosed = false $circleId, Env::ENV_TEST_MEMBER1, DeprecatedMember::TYPE_USER, DeprecatedMember::LEVEL_MEMBER ); } - }