From d86f23f5d579d962ab56c9284a81dc935a2fd30d Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Thu, 19 Sep 2024 11:43:02 +0200 Subject: [PATCH] chore: Bump php-cs-fixer config and apply Signed-off-by: Julius Knorr --- composer.lock | 136 ++++++++++++------ lib/Backgroundjobs/Cleanup.php | 6 +- lib/Capabilities.php | 2 +- lib/Command/ConvertToBigInt.php | 4 +- lib/Command/InstallDefaultFonts.php | 4 +- lib/Command/UpdateEmptyTemplates.php | 4 +- lib/Controller/AssetsController.php | 6 +- lib/Controller/DirectViewController.php | 2 +- lib/Controller/DocumentAPIController.php | 11 +- lib/Controller/DocumentController.php | 4 +- lib/Controller/FederationController.php | 2 +- lib/Controller/OCSController.php | 9 +- lib/Controller/SettingsController.php | 7 +- lib/Controller/TemplatesController.php | 5 +- lib/Controller/WopiController.php | 2 +- lib/Db/AssetMapper.php | 6 +- lib/Db/DirectMapper.php | 6 +- lib/Db/WopiMapper.php | 10 +- lib/Events/BeforeFederationRedirectEvent.php | 6 +- lib/Events/DocumentOpenedEvent.php | 5 +- lib/Helper.php | 4 +- lib/Listener/BeforeFetchPreviewListener.php | 7 +- lib/Listener/BeforeGetTemplatesListener.php | 4 +- .../BeforeTemplateRenderedListener.php | 4 +- lib/Listener/LoadViewerListener.php | 6 +- lib/Listener/ShareLinkListener.php | 5 +- lib/Middleware/WOPIMiddleware.php | 2 +- lib/Migration/InstallDefaultFonts.php | 5 +- lib/PermissionManager.php | 2 +- lib/Service/DemoService.php | 5 +- lib/Service/FederationService.php | 10 +- lib/Service/FontService.php | 6 +- lib/Service/PdfService.php | 2 +- lib/Service/RemoteService.php | 4 +- lib/Service/UserScopeService.php | 2 +- lib/Settings/Admin.php | 2 +- lib/Settings/Personal.php | 2 +- lib/Settings/Section.php | 6 +- lib/Template/CollaboraTemplateProvider.php | 2 +- lib/TemplateManager.php | 2 +- lib/WOPI/Parser.php | 2 +- tests/bootstrap.php | 2 +- tests/features/bootstrap/ApiContext.php | 2 +- tests/features/bootstrap/DirectContext.php | 4 +- .../bootstrap/RichDocumentsContext.php | 10 +- 45 files changed, 234 insertions(+), 105 deletions(-) diff --git a/composer.lock b/composer.lock index ac6ca7287c..b44a3079b6 100644 --- a/composer.lock +++ b/composer.lock @@ -187,6 +187,52 @@ "abandoned": "php-parallel-lint/php-parallel-lint", "time": "2018-02-24T15:31:20+00:00" }, + { + "name": "kubawerlos/php-cs-fixer-custom-fixers", + "version": "v3.22.0", + "source": { + "type": "git", + "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.61.1", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.4 || ^10.5.29" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpCsFixerCustomFixers\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kuba Werłos", + "email": "werlos@gmail.com" + } + ], + "description": "A set of custom fixers for PHP CS Fixer", + "support": { + "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" + }, + "time": "2024-08-16T20:44:35+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.12.0", @@ -249,19 +295,20 @@ }, { "name": "nextcloud/coding-standard", - "version": "v1.2.3", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da" + "reference": "e88acb0df6217b808d1632286ddfec9267a102e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/bc9c53a5306114b60c4363057aff9c2ed10a54da", - "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/e88acb0df6217b808d1632286ddfec9267a102e4", + "reference": "e88acb0df6217b808d1632286ddfec9267a102e4", "shasum": "" }, "require": { + "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", "php": "^7.3|^8.0", "php-cs-fixer/shim": "^3.17" }, @@ -284,9 +331,9 @@ "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/v1.2.3" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.1" }, - "time": "2024-08-23T14:32:32+00:00" + "time": "2024-09-19T09:07:10+00:00" }, { "name": "nextcloud/ocp", @@ -294,12 +341,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "56dae49d60120c34b5651d37da7668c971424665" + "reference": "e3a87a417a6d51eda630e1bd56f0a42c9d277ec8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/56dae49d60120c34b5651d37da7668c971424665", - "reference": "56dae49d60120c34b5651d37da7668c971424665", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/e3a87a417a6d51eda630e1bd56f0a42c9d277ec8", + "reference": "e3a87a417a6d51eda630e1bd56f0a42c9d277ec8", "shasum": "" }, "require": { @@ -331,20 +378,20 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2024-09-14T00:40:10+00:00" + "time": "2024-09-19T08:25:34+00:00" }, { "name": "nikic/php-parser", - "version": "v5.1.0", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" + "reference": "23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", - "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb", + "reference": "23c79fbbfb725fb92af9bcf41065c8e9a0d49ddb", "shasum": "" }, "require": { @@ -387,9 +434,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.2.0" }, - "time": "2024-07-01T20:03:41+00:00" + "time": "2024-09-15T16:40:33+00:00" }, { "name": "phar-io/manifest", @@ -511,16 +558,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.63.1", + "version": "v3.64.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "27db669308f957ad1909e8c4aa4b957e4cfbc6c9" + "reference": "81ccfd24baf3a10810dab1152c403981a790b837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/27db669308f957ad1909e8c4aa4b957e4cfbc6c9", - "reference": "27db669308f957ad1909e8c4aa4b957e4cfbc6c9", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/81ccfd24baf3a10810dab1152c403981a790b837", + "reference": "81ccfd24baf3a10810dab1152c403981a790b837", "shasum": "" }, "require": { @@ -557,9 +604,9 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.63.1" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.64.0" }, - "time": "2024-08-26T14:03:48+00:00" + "time": "2024-08-30T23:10:11+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1225,12 +1272,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "f6f9a938afd75c2344952b0566983700829c7440" + "reference": "22aca9a3467be44288882a3bcf7f2865abe08ca3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f6f9a938afd75c2344952b0566983700829c7440", - "reference": "f6f9a938afd75c2344952b0566983700829c7440", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/22aca9a3467be44288882a3bcf7f2865abe08ca3", + "reference": "22aca9a3467be44288882a3bcf7f2865abe08ca3", "shasum": "" }, "conflict": { @@ -1327,21 +1374,23 @@ "codeigniter4/shield": "<1.0.0.0-beta8", "codiad/codiad": "<=2.8.4", "composer/composer": "<1.10.27|>=2,<2.2.24|>=2.3,<2.7.7", - "concrete5/concrete5": "<9.3.3", + "concrete5/concrete5": "<9.3.4", "concrete5/core": "<8.5.8|>=9,<9.1", "contao-components/mediaelement": ">=2.14.2,<2.21.1", "contao/comments-bundle": ">=2,<4.13.40|>=5.0.0.0-RC1-dev,<5.3.4", "contao/contao": ">=3,<3.5.37|>=4,<4.4.56|>=4.5,<4.9.40|>=4.10,<4.11.7|>=4.13,<4.13.21|>=5.1,<5.1.4", "contao/core": "<3.5.39", - "contao/core-bundle": "<4.13.40|>=5,<5.3.4", + "contao/core-bundle": "<4.13.49|>=5,<5.3.15|>=5.4,<5.4.3", "contao/listing-bundle": ">=3,<=3.5.30|>=4,<4.4.8", "contao/managed-edition": "<=1.5", "corveda/phpsandbox": "<1.3.5", "cosenary/instagram": "<=2.3", - "craftcms/cms": "<4.6.2|>=5.0.0.0-beta1,<=5.2.2", + "craftcms/cms": "<4.6.2|>=5,<=5.2.2", "croogo/croogo": "<4", "cuyz/valinor": "<0.12", + "czim/file-handling": "<1.5|>=2,<2.3", "czproject/git-php": "<4.0.3", + "damienharper/auditor-bundle": "<5.2.6", "dapphp/securimage": "<3.6.6", "darylldoyle/safe-svg": "<1.9.10", "datadog/dd-trace": ">=0.30,<0.30.2", @@ -1366,8 +1415,9 @@ "dolibarr/dolibarr": "<19.0.2", "dompdf/dompdf": "<2.0.4", "doublethreedigital/guest-entries": "<3.1.2", - "drupal/core": ">=6,<6.38|>=7,<7.96|>=8,<10.1.8|>=10.2,<10.2.2", - "drupal/drupal": ">=5,<5.11|>=6,<6.38|>=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4", + "drupal/core": ">=6,<6.38|>=7,<7.96|>=8,<10.1.8|>=10.2,<10.2.2|==11.9999999.9999999.9999999-dev", + "drupal/core-recommended": "==11.9999999.9999999.9999999-dev", + "drupal/drupal": ">=5,<5.11|>=6,<6.38|>=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4|==11.9999999.9999999.9999999-dev", "duncanmcclean/guest-entries": "<3.1.2", "dweeves/magmi": "<=0.7.24", "ec-cube/ec-cube": "<2.4.4|>=2.11,<=2.17.1|>=3,<=3.0.18.0-patch4|>=4,<=4.1.2", @@ -1449,7 +1499,7 @@ "genix/cms": "<=1.1.11", "getformwork/formwork": "<1.13.1|==2.0.0.0-beta1", "getgrav/grav": "<1.7.46", - "getkirby/cms": "<4.1.1", + "getkirby/cms": "<=3.6.6.5|>=3.7,<=3.7.5.4|>=3.8,<=3.8.4.3|>=3.9,<=3.9.8.1|>=3.10,<=3.10.1|>=4,<=4.3", "getkirby/kirby": "<=2.5.12", "getkirby/panel": "<2.5.14", "getkirby/starterkit": "<=3.7.0.2", @@ -1496,7 +1546,7 @@ "in2code/femanager": "<5.5.3|>=6,<6.3.4|>=7,<7.2.3", "in2code/ipandlanguageredirect": "<5.1.2", "in2code/lux": "<17.6.1|>=18,<24.0.2", - "in2code/powermail": "<7.5|>=8,<8.5|>=9,<10.9|>=12,<12.4", + "in2code/powermail": "<7.5.1|>=8,<8.5.1|>=9,<10.9.1|>=11,<12.4.1", "innologi/typo3-appointments": "<2.0.6", "intelliants/subrion": "<4.2.2", "inter-mediator/inter-mediator": "==5.5", @@ -1526,7 +1576,7 @@ "kelvinmo/simplexrd": "<3.1.1", "kevinpapst/kimai2": "<1.16.7", "khodakhah/nodcms": "<=3", - "kimai/kimai": "<2.16", + "kimai/kimai": "<=2.20.1", "kitodo/presentation": "<3.2.3|>=3.3,<3.3.4", "klaviyo/magento2-extension": ">=1,<3", "knplabs/knp-snappy": "<=1.4.2", @@ -1559,7 +1609,7 @@ "lms/routes": "<2.1.1", "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", "luyadev/yii-helpers": "<1.2.1", - "magento/community-edition": "<2.4.5|==2.4.5|>=2.4.5.0-patch1,<2.4.5.0-patch8|==2.4.6|>=2.4.6.0-patch1,<2.4.6.0-patch6|==2.4.7", + "magento/community-edition": "<2.4.5|==2.4.5|>=2.4.5.0-patch1,<2.4.5.0-patch9|==2.4.6|>=2.4.6.0-patch1,<2.4.6.0-patch7|==2.4.7|>=2.4.7.0-patch1,<2.4.7.0-patch2", "magento/core": "<=1.9.4.5", "magento/magento1ce": "<1.9.4.3-dev", "magento/magento1ee": ">=1,<1.14.4.3-dev", @@ -1570,7 +1620,8 @@ "mantisbt/mantisbt": "<2.26.2", "marcwillmann/turn": "<0.3.3", "matyhtf/framework": "<3.0.6", - "mautic/core": "<4.4.12|>=5.0.0.0-alpha,<5.0.4", + "mautic/core": "<4.4.13|>=5.0.0.0-alpha,<5.1.1", + "mautic/core-lib": ">=1.0.0.0-beta,<4.4.13|>=5.0.0.0-alpha,<5.1.1", "mdanter/ecc": "<2", "mediawiki/core": "<1.36.2", "mediawiki/matomo": "<2.4.3", @@ -1605,6 +1656,7 @@ "munkireport/softwareupdate": "<1.6", "mustache/mustache": ">=2,<2.14.1", "namshi/jose": "<2.2", + "nategood/httpful": "<1", "neoan3-apps/template": "<1.1.1", "neorazorx/facturascripts": "<2022.04", "neos/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", @@ -1679,7 +1731,7 @@ "phpmyfaq/phpmyfaq": "<3.2.5|==3.2.5", "phpoffice/common": "<0.2.9", "phpoffice/phpexcel": "<1.8", - "phpoffice/phpspreadsheet": "<1.16", + "phpoffice/phpspreadsheet": "<1.29.1|>=2,<2.1.1|>=2.2,<2.2.1", "phpseclib/phpseclib": "<2.0.47|>=3,<3.0.36", "phpservermon/phpservermon": "<3.6", "phpsysinfo/phpsysinfo": "<3.4.3", @@ -1688,9 +1740,10 @@ "phpxmlrpc/extras": "<0.6.1", "phpxmlrpc/phpxmlrpc": "<4.9.2", "pi/pi": "<=2.5", - "pimcore/admin-ui-classic-bundle": "<=1.5.1", + "pimcore/admin-ui-classic-bundle": "<1.5.4", "pimcore/customer-management-framework-bundle": "<4.0.6", "pimcore/data-hub": "<1.2.4", + "pimcore/data-importer": "<1.8.9|>=1.9,<1.9.3", "pimcore/demo": "<10.3", "pimcore/ecommerce-framework-bundle": "<1.0.10", "pimcore/perspective-editor": "<1.5.1", @@ -1721,7 +1774,7 @@ "pubnub/pubnub": "<6.1", "pusher/pusher-php-server": "<2.2.1", "pwweb/laravel-core": "<=0.3.6.0-beta", - "pxlrbt/filament-excel": "<2.3.3", + "pxlrbt/filament-excel": "<1.1.14|>=2.0.0.0-alpha,<2.3.3", "pyrocms/pyrocms": "<=3.9.1", "qcubed/qcubed": "<=3.1.1", "quickapps/cms": "<=2.0.0.0-beta2", @@ -1872,7 +1925,7 @@ "tinymighty/wiki-seo": "<1.2.2", "titon/framework": "<9.9.99", "tobiasbg/tablepress": "<=2.0.0.0-RC1", - "topthink/framework": "<6.0.17|>=6.1,<6.1.5|>=8,<8.0.4", + "topthink/framework": "<6.0.17|>=6.1,<=8.0.4", "topthink/think": "<=6.1.1", "topthink/thinkphp": "<=3.2.3", "torrentpier/torrentpier": "<=2.4.3", @@ -1881,7 +1934,7 @@ "truckersmp/phpwhois": "<=4.3.1", "ttskch/pagination-service-provider": "<1", "twbs/bootstrap": "<=3.4.1|>=4,<=4.6.2", - "twig/twig": "<1.44.7|>=2,<2.15.3|>=3,<3.4.3", + "twig/twig": "<1.44.8|>=2,<2.16.1|>=3,<3.11.1|>=3.12,<3.14", "typo3/cms": "<9.5.29|>=10,<10.4.35|>=11,<11.5.23|>=12,<12.2", "typo3/cms-backend": "<4.1.14|>=4.2,<4.2.15|>=4.3,<4.3.7|>=4.4,<4.4.4|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", "typo3/cms-core": "<=8.7.56|>=9,<=9.5.47|>=10,<=10.4.44|>=11,<=11.5.36|>=12,<=12.4.14|>=13,<=13.1", @@ -1933,6 +1986,7 @@ "winter/wn-dusk-plugin": "<2.1", "winter/wn-system-module": "<1.2.4", "wintercms/winter": "<=1.2.3", + "wireui/wireui": "<1.19.3|>=2,<2.1.3", "woocommerce/woocommerce": "<6.6|>=8.8,<8.8.5|>=8.9,<8.9.3", "wp-cli/wp-cli": ">=0.12,<2.5", "wp-graphql/wp-graphql": "<=1.14.5", @@ -2034,7 +2088,7 @@ "type": "tidelift" } ], - "time": "2024-08-28T08:05:44+00:00" + "time": "2024-09-18T23:05:04+00:00" }, { "name": "sebastian/cli-parser", diff --git a/lib/Backgroundjobs/Cleanup.php b/lib/Backgroundjobs/Cleanup.php index b20abd3d74..a77fb59892 100644 --- a/lib/Backgroundjobs/Cleanup.php +++ b/lib/Backgroundjobs/Cleanup.php @@ -13,7 +13,11 @@ use OCP\IDBConnection; class Cleanup extends TimedJob { - public function __construct(ITimeFactory $time, private IDBConnection $db, private WopiMapper $wopiMapper) { + public function __construct( + ITimeFactory $time, + private IDBConnection $db, + private WopiMapper $wopiMapper, + ) { parent::__construct($time); $this->setInterval(60 * 60); diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 65f57da796..52ba4ab79c 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -90,7 +90,7 @@ public function __construct( private PermissionManager $permissionManager, private IAppManager $appManager, private ?string $userId, - private IURLGenerator $urlGenerator + private IURLGenerator $urlGenerator, ) { } diff --git a/lib/Command/ConvertToBigInt.php b/lib/Command/ConvertToBigInt.php index b7dec782ce..a66cffe441 100644 --- a/lib/Command/ConvertToBigInt.php +++ b/lib/Command/ConvertToBigInt.php @@ -18,7 +18,9 @@ use Symfony\Component\Console\Question\ConfirmationQuestion; class ConvertToBigInt extends Command { - public function __construct(private Connection $connection) { + public function __construct( + private Connection $connection, + ) { parent::__construct(); } diff --git a/lib/Command/InstallDefaultFonts.php b/lib/Command/InstallDefaultFonts.php index b050799488..25b0c9527b 100644 --- a/lib/Command/InstallDefaultFonts.php +++ b/lib/Command/InstallDefaultFonts.php @@ -11,7 +11,9 @@ use Symfony\Component\Console\Output\OutputInterface; class InstallDefaultFonts extends Command { - public function __construct(private FontService $fontService) { + public function __construct( + private FontService $fontService, + ) { parent::__construct(); } diff --git a/lib/Command/UpdateEmptyTemplates.php b/lib/Command/UpdateEmptyTemplates.php index 41996375d9..406891d283 100644 --- a/lib/Command/UpdateEmptyTemplates.php +++ b/lib/Command/UpdateEmptyTemplates.php @@ -13,7 +13,9 @@ use Symfony\Component\Console\Output\OutputInterface; class UpdateEmptyTemplates extends Command { - public function __construct(private TemplateManager $templateManager) { + public function __construct( + private TemplateManager $templateManager, + ) { parent::__construct(); } diff --git a/lib/Controller/AssetsController.php b/lib/Controller/AssetsController.php index 1d8ae346c4..dac0f5e903 100644 --- a/lib/Controller/AssetsController.php +++ b/lib/Controller/AssetsController.php @@ -22,13 +22,15 @@ use OCP\IURLGenerator; class AssetsController extends Controller { - public function __construct($appName, + public function __construct( + $appName, IRequest $request, private AssetMapper $assetMapper, private IRootFolder $rootFolder, private ?string $userId, private UserScopeService $userScopeService, - private IURLGenerator $urlGenerator) { + private IURLGenerator $urlGenerator, + ) { parent::__construct($appName, $request); } diff --git a/lib/Controller/DirectViewController.php b/lib/Controller/DirectViewController.php index fc0c941a82..ccb8e80ca3 100644 --- a/lib/Controller/DirectViewController.php +++ b/lib/Controller/DirectViewController.php @@ -42,7 +42,7 @@ public function __construct( private AppConfig $appConfig, private TemplateManager $templateManager, private FederationService $federationService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct($appName, $request); } diff --git a/lib/Controller/DocumentAPIController.php b/lib/Controller/DocumentAPIController.php index b5143c6409..f2c6495f61 100644 --- a/lib/Controller/DocumentAPIController.php +++ b/lib/Controller/DocumentAPIController.php @@ -29,7 +29,16 @@ use Throwable; class DocumentAPIController extends \OCP\AppFramework\OCSController { - public function __construct(IRequest $request, private IRootFolder $rootFolder, private IManager $shareManager, private TemplateManager $templateManager, private IL10N $l10n, private LoggerInterface $logger, private ILockManager $lockManager, private $userId) { + public function __construct( + IRequest $request, + private IRootFolder $rootFolder, + private IManager $shareManager, + private TemplateManager $templateManager, + private IL10N $l10n, + private LoggerInterface $logger, + private ILockManager $lockManager, + private $userId, + ) { parent::__construct(Application::APPNAME, $request); } diff --git a/lib/Controller/DocumentController.php b/lib/Controller/DocumentController.php index dd2bd77c9e..488d337f18 100644 --- a/lib/Controller/DocumentController.php +++ b/lib/Controller/DocumentController.php @@ -58,7 +58,7 @@ public function __construct( private TemplateManager $templateManager, private FederationService $federationService, private InitialStateService $initialState, - private IURLGenerator $urlGenerator + private IURLGenerator $urlGenerator, ) { parent::__construct($appName, $request); } @@ -144,7 +144,7 @@ public function index($fileId, ?string $path = null): RedirectResponse|TemplateR if ($encryptionManager->isEnabled()) { // Update the current file to be accessible with system public shared key $owner = $file->getOwner()->getUID(); - $absPath = '/' . $owner . '/' . $file->getInternalPath(); + $absPath = '/' . $owner . '/' . $file->getInternalPath(); $accessList = OC::$server->getEncryptionFilesHelper()->getAccessList($absPath); $accessList['public'] = true; $encryptionManager->getEncryptionModule()->update($absPath, $owner, $accessList); diff --git a/lib/Controller/FederationController.php b/lib/Controller/FederationController.php index 646c5204da..7397af88c3 100644 --- a/lib/Controller/FederationController.php +++ b/lib/Controller/FederationController.php @@ -26,7 +26,7 @@ public function __construct( private LoggerInterface $logger, private WopiMapper $wopiMapper, private IUserManager $userManager, - private IURLGenerator $urlGenerator + private IURLGenerator $urlGenerator, ) { parent::__construct($appName, $request); } diff --git a/lib/Controller/OCSController.php b/lib/Controller/OCSController.php index 6329f87a59..edbbfd7820 100644 --- a/lib/Controller/OCSController.php +++ b/lib/Controller/OCSController.php @@ -33,7 +33,8 @@ class OCSController extends \OCP\AppFramework\OCSController { /** * @param string $userId */ - public function __construct(string $appName, + public function __construct( + string $appName, IRequest $request, private IRootFolder $rootFolder, private $userId, @@ -43,7 +44,7 @@ public function __construct(string $appName, private TokenManager $tokenManager, private IManager $shareManager, private FederationService $federationService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct($appName, $request); } @@ -94,7 +95,7 @@ public function createPublic( string $shareToken, ?string $host = null, string $path = '', - ?string $password = null + ?string $password = null, ): DataResponse { if ($host) { $remoteCollabora = $this->federationService->getRemoteCollaboraURL($host); @@ -182,7 +183,7 @@ public function createPublicFromInitiator( string $initiatorToken, string $shareToken, string $path = '', - ?string $password = null + ?string $password = null, ): DataResponse { try { $share = $this->shareManager->getShareByToken($shareToken); diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 2c40b60131..e2134b47b4 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -43,7 +43,8 @@ class SettingsController extends Controller { 'application/vnd.ms-opentype', ]; - public function __construct($appName, + public function __construct( + $appName, IRequest $request, private IL10N $l10n, private AppConfig $appConfig, @@ -54,7 +55,7 @@ public function __construct($appName, private DemoService $demoService, private FontService $fontService, private LoggerInterface $logger, - private ?string $userId + private ?string $userId, ) { parent::__construct($appName, $request); } @@ -120,7 +121,7 @@ public function setSettings( ?string $use_groups, ?string $doc_format, ?string $external_apps, - ?string $canonical_webroot + ?string $canonical_webroot, ): JSONResponse { if ($wopi_url !== null) { $this->appConfig->setAppValue('wopi_url', $wopi_url); diff --git a/lib/Controller/TemplatesController.php b/lib/Controller/TemplatesController.php index 78415e0a3f..6d90f489f2 100644 --- a/lib/Controller/TemplatesController.php +++ b/lib/Controller/TemplatesController.php @@ -38,13 +38,14 @@ class TemplatesController extends Controller { * @param TemplateManager $manager * @param IPreview $preview */ - public function __construct($appName, + public function __construct( + $appName, IRequest $request, private IL10N $l10n, private TemplateManager $manager, private IPreview $preview, private IMimeTypeDetector $mimeTypeDetector, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct($appName, $request); diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index f7441a96b2..25e0f71046 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -82,7 +82,7 @@ public function __construct( private IEncryptionManager $encryptionManager, private IGroupManager $groupManager, private ILockManager $lockManager, - private IEventDispatcher $eventDispatcher + private IEventDispatcher $eventDispatcher, ) { parent::__construct($appName, $request); } diff --git a/lib/Db/AssetMapper.php b/lib/Db/AssetMapper.php index 147bb8a73b..e755577f57 100644 --- a/lib/Db/AssetMapper.php +++ b/lib/Db/AssetMapper.php @@ -17,7 +17,11 @@ class AssetMapper extends QBMapper { /** @var int Lifetime of a token is 10 minutes */ public const TOKEN_TTL = 600; - public function __construct(IDBConnection $db, private ISecureRandom $random, private ITimeFactory $time) { + public function __construct( + IDBConnection $db, + private ISecureRandom $random, + private ITimeFactory $time, + ) { parent::__construct($db, 'richdocuments_assets', Asset::class); } diff --git a/lib/Db/DirectMapper.php b/lib/Db/DirectMapper.php index 471c9724d3..aba0ff5406 100644 --- a/lib/Db/DirectMapper.php +++ b/lib/Db/DirectMapper.php @@ -17,9 +17,11 @@ class DirectMapper extends QBMapper { /** @var int Lifetime of a token is 10 minutes */ public const TOKEN_TTL = 600; - public function __construct(IDBConnection $db, + public function __construct( + IDBConnection $db, protected ISecureRandom $random, - protected ITimeFactory $timeFactory) { + protected ITimeFactory $timeFactory, + ) { parent::__construct($db, 'richdocuments_direct', Direct::class); } diff --git a/lib/Db/WopiMapper.php b/lib/Db/WopiMapper.php index 89bf3d1d41..ebb472206c 100644 --- a/lib/Db/WopiMapper.php +++ b/lib/Db/WopiMapper.php @@ -17,11 +17,13 @@ /** @template-extends QBMapper */ class WopiMapper extends QBMapper { - public function __construct(IDBConnection $db, + public function __construct( + IDBConnection $db, private ISecureRandom $random, private LoggerInterface $logger, private ITimeFactory $timeFactory, - private AppConfig $appConfig) { + private AppConfig $appConfig, + ) { parent::__construct($db, 'richdocuments_wopi', Wopi::class); } @@ -89,7 +91,7 @@ public function generateInitiatorToken($uid, $remoteServer) { */ public function getPathForToken( #[\SensitiveParameter] - $token + $token, ): Wopi { return $this->getWopiForToken($token); } @@ -106,7 +108,7 @@ public function getPathForToken( */ public function getWopiForToken( #[\SensitiveParameter] - string $token + string $token, ): Wopi { $qb = $this->db->getQueryBuilder(); $qb->select('*') diff --git a/lib/Events/BeforeFederationRedirectEvent.php b/lib/Events/BeforeFederationRedirectEvent.php index 11a548b8a3..3cb4bb08a4 100644 --- a/lib/Events/BeforeFederationRedirectEvent.php +++ b/lib/Events/BeforeFederationRedirectEvent.php @@ -17,7 +17,11 @@ class BeforeFederationRedirectEvent extends Event { * @param string $relativePath * @param string $remote */ - public function __construct(private $node, private $relativePath, private $remote) { + public function __construct( + private $node, + private $relativePath, + private $remote, + ) { parent::__construct(); } diff --git a/lib/Events/DocumentOpenedEvent.php b/lib/Events/DocumentOpenedEvent.php index df72b99c7a..9e758f5469 100644 --- a/lib/Events/DocumentOpenedEvent.php +++ b/lib/Events/DocumentOpenedEvent.php @@ -11,7 +11,10 @@ use OCP\Files\Node; class DocumentOpenedEvent extends \OCP\EventDispatcher\Event { - public function __construct(private ?string $userId, private Node $node) { + public function __construct( + private ?string $userId, + private Node $node, + ) { } public function getUserId(): ?string { diff --git a/lib/Helper.php b/lib/Helper.php index 45fd144784..76272faa86 100644 --- a/lib/Helper.php +++ b/lib/Helper.php @@ -13,7 +13,9 @@ class Helper { /** * @param string|null $userId */ - public function __construct(private $userId) { + public function __construct( + private $userId, + ) { } /** diff --git a/lib/Listener/BeforeFetchPreviewListener.php b/lib/Listener/BeforeFetchPreviewListener.php index ac63e89e15..e0a6924460 100644 --- a/lib/Listener/BeforeFetchPreviewListener.php +++ b/lib/Listener/BeforeFetchPreviewListener.php @@ -24,7 +24,12 @@ /** @template-implements IEventListener */ class BeforeFetchPreviewListener implements IEventListener { - public function __construct(private PermissionManager $permissionManager, private IUserSession $userSession, private IRequest $request, private IManager $shareManager) { + public function __construct( + private PermissionManager $permissionManager, + private IUserSession $userSession, + private IRequest $request, + private IManager $shareManager, + ) { } public function handle(Event $event): void { diff --git a/lib/Listener/BeforeGetTemplatesListener.php b/lib/Listener/BeforeGetTemplatesListener.php index 359687a374..6d9e5d4d4d 100644 --- a/lib/Listener/BeforeGetTemplatesListener.php +++ b/lib/Listener/BeforeGetTemplatesListener.php @@ -15,7 +15,7 @@ /** @template-implements IEventListener */ class BeforeGetTemplatesListener implements IEventListener { public function __construct( - private TemplateFieldService $templateFieldService + private TemplateFieldService $templateFieldService, ) { } @@ -24,7 +24,7 @@ public function handle(Event $event): void { return; } - foreach($event->getTemplates() as $template) { + foreach ($event->getTemplates() as $template) { $templateFileId = $template->jsonSerialize()['fileid']; $fields = $this->templateFieldService->extractFields($templateFileId); diff --git a/lib/Listener/BeforeTemplateRenderedListener.php b/lib/Listener/BeforeTemplateRenderedListener.php index c00bb9ad5f..ca20eb9d7a 100644 --- a/lib/Listener/BeforeTemplateRenderedListener.php +++ b/lib/Listener/BeforeTemplateRenderedListener.php @@ -14,7 +14,9 @@ /** @template-implements IEventListener */ class BeforeTemplateRenderedListener implements IEventListener { - public function __construct(private CapabilitiesService $capabilitiesService) { + public function __construct( + private CapabilitiesService $capabilitiesService, + ) { } public function handle(Event $event): void { diff --git a/lib/Listener/LoadViewerListener.php b/lib/Listener/LoadViewerListener.php index 2d9de9335e..aec47c6fde 100644 --- a/lib/Listener/LoadViewerListener.php +++ b/lib/Listener/LoadViewerListener.php @@ -20,7 +20,11 @@ /** @template-implements IEventListener */ class LoadViewerListener implements IEventListener { - public function __construct(private PermissionManager $permissionManager, private InitialStateService $initialStateService, private ?string $userId) { + public function __construct( + private PermissionManager $permissionManager, + private InitialStateService $initialStateService, + private ?string $userId, + ) { } public function handle(Event $event): void { diff --git a/lib/Listener/ShareLinkListener.php b/lib/Listener/ShareLinkListener.php index 7fb71a1020..b4346c923f 100644 --- a/lib/Listener/ShareLinkListener.php +++ b/lib/Listener/ShareLinkListener.php @@ -21,7 +21,10 @@ /** @template-implements IEventListener */ class ShareLinkListener implements \OCP\EventDispatcher\IEventListener { - public function __construct(private PermissionManager $permissionManager, private InitialStateService $initialStateService) { + public function __construct( + private PermissionManager $permissionManager, + private InitialStateService $initialStateService, + ) { } public function handle(Event $event): void { diff --git a/lib/Middleware/WOPIMiddleware.php b/lib/Middleware/WOPIMiddleware.php index 81b00688e4..de5aa2322f 100644 --- a/lib/Middleware/WOPIMiddleware.php +++ b/lib/Middleware/WOPIMiddleware.php @@ -32,7 +32,7 @@ public function __construct( private IConfig $config, private IRequest $request, private WopiMapper $wopiMapper, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/Migration/InstallDefaultFonts.php b/lib/Migration/InstallDefaultFonts.php index 4bcb477759..602859cc8c 100644 --- a/lib/Migration/InstallDefaultFonts.php +++ b/lib/Migration/InstallDefaultFonts.php @@ -11,7 +11,10 @@ use OCP\Migration\IRepairStep; class InstallDefaultFonts implements IRepairStep { - public function __construct(private IConfig $config, private FontService $fontService) { + public function __construct( + private IConfig $config, + private FontService $fontService, + ) { } public function getName(): string { diff --git a/lib/PermissionManager.php b/lib/PermissionManager.php index a1fe764eed..49f0a79eaa 100644 --- a/lib/PermissionManager.php +++ b/lib/PermissionManager.php @@ -25,7 +25,7 @@ public function __construct( private IGroupManager $groupManager, private IUserManager $userManager, private IUserSession $userSession, - private ISystemTagObjectMapper $systemTagObjectMapper + private ISystemTagObjectMapper $systemTagObjectMapper, ) { } diff --git a/lib/Service/DemoService.php b/lib/Service/DemoService.php index 5606956fc8..ffad1225fa 100644 --- a/lib/Service/DemoService.php +++ b/lib/Service/DemoService.php @@ -10,7 +10,10 @@ use OCP\ICache; class DemoService { - public function __construct(private ICache $cache, private IClientService $clientService) { + public function __construct( + private ICache $cache, + private IClientService $clientService, + ) { } public function fetchDemoServers($refresh = false) { diff --git a/lib/Service/FederationService.php b/lib/Service/FederationService.php index bc7af4c2a3..1ef612bde3 100644 --- a/lib/Service/FederationService.php +++ b/lib/Service/FederationService.php @@ -35,7 +35,15 @@ class FederationService { /** @var TrustedServers */ private $trustedServers; - public function __construct(ICacheFactory $cacheFactory, private IClientService $clientService, private LoggerInterface $logger, private TokenManager $tokenManager, private AppConfig $appConfig, private IRequest $request, private IURLGenerator $urlGenerator) { + public function __construct( + ICacheFactory $cacheFactory, + private IClientService $clientService, + private LoggerInterface $logger, + private TokenManager $tokenManager, + private AppConfig $appConfig, + private IRequest $request, + private IURLGenerator $urlGenerator, + ) { $this->cache = $cacheFactory->createDistributed('richdocuments_remote/'); try { $this->trustedServers = \OC::$server->get(\OCA\Federation\TrustedServers::class); diff --git a/lib/Service/FontService.php b/lib/Service/FontService.php index 28e554b6c2..621697b1f1 100644 --- a/lib/Service/FontService.php +++ b/lib/Service/FontService.php @@ -23,10 +23,12 @@ class FontService { */ private $cache; - public function __construct(private IAppData $appData, + public function __construct( + private IAppData $appData, ICacheFactory $cacheFactory, private IURLGenerator $url, - private IConfig $config) { + private IConfig $config, + ) { $this->cache = $cacheFactory->createDistributed(Application::APPNAME); } diff --git a/lib/Service/PdfService.php b/lib/Service/PdfService.php index 261cfc2cfd..2499e783d5 100644 --- a/lib/Service/PdfService.php +++ b/lib/Service/PdfService.php @@ -15,7 +15,7 @@ class PdfService { public function __construct( - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/Service/RemoteService.php b/lib/Service/RemoteService.php index d476bf7680..06937d373b 100644 --- a/lib/Service/RemoteService.php +++ b/lib/Service/RemoteService.php @@ -24,7 +24,7 @@ public function fetchTargets($file): array { $client = $this->clientService->newClient(); try { $response = $client->put( - $this->appConfig->getCollaboraUrlInternal(). '/cool/extract-link-targets', + $this->appConfig->getCollaboraUrlInternal() . '/cool/extract-link-targets', $this->getRequestOptionsForFile($file) ); } catch (Exception $e) { @@ -46,7 +46,7 @@ public function fetchTargets($file): array { public function fetchTargetThumbnail(File $file, string $target): ?string { $client = $this->clientService->newClient(); try { - $response = $client->put($this->appConfig->getCollaboraUrlInternal(). '/cool/get-thumbnail', $this->getRequestOptionsForFile($file, $target)); + $response = $client->put($this->appConfig->getCollaboraUrlInternal() . '/cool/get-thumbnail', $this->getRequestOptionsForFile($file, $target)); return (string)$response->getBody(); } catch (Exception $e) { $this->logger->info('Failed to fetch target thumbnail', ['exception' => $e]); diff --git a/lib/Service/UserScopeService.php b/lib/Service/UserScopeService.php index 1d278c9685..d622443d26 100644 --- a/lib/Service/UserScopeService.php +++ b/lib/Service/UserScopeService.php @@ -14,7 +14,7 @@ class UserScopeService { public function __construct( private IUserSession $userSession, - private IUserManager $userManager + private IUserManager $userManager, ) { } diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 3cd692532a..9c99946772 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -24,7 +24,7 @@ public function __construct( private CapabilitiesService $capabilitiesService, private DemoService $demoService, private FontService $fontService, - private InitialStateService $initialStateService + private InitialStateService $initialStateService, ) { } diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index ed98e36ece..bd0af6753d 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -17,7 +17,7 @@ public function __construct( private IConfig $config, private CapabilitiesService $capabilitiesService, private InitialStateService $initialState, - private ?string $userId + private ?string $userId, ) { } diff --git a/lib/Settings/Section.php b/lib/Settings/Section.php index e59f3c9eb5..5d7db05f3b 100644 --- a/lib/Settings/Section.php +++ b/lib/Settings/Section.php @@ -12,7 +12,11 @@ use OCP\Settings\IIconSection; class Section implements IIconSection { - public function __construct(private IURLGenerator $url, private CapabilitiesService $capabilitites, private IL10N $l10n) { + public function __construct( + private IURLGenerator $url, + private CapabilitiesService $capabilitites, + private IL10N $l10n, + ) { } public function getID() { diff --git a/lib/Template/CollaboraTemplateProvider.php b/lib/Template/CollaboraTemplateProvider.php index 13813fa377..b9f48ebd9c 100644 --- a/lib/Template/CollaboraTemplateProvider.php +++ b/lib/Template/CollaboraTemplateProvider.php @@ -21,7 +21,7 @@ class CollaboraTemplateProvider implements ICustomTemplateProvider { public function __construct( private TemplateManager $templateManager, private IURLGenerator $urlGenerator, - private ITemplateManager $coreTemplateManager + private ITemplateManager $coreTemplateManager, ) { } diff --git a/lib/TemplateManager.php b/lib/TemplateManager.php index 363d3ded44..b1709b3ebd 100644 --- a/lib/TemplateManager.php +++ b/lib/TemplateManager.php @@ -76,7 +76,7 @@ public function __construct( private IRootFolder $rootFolder, private IL10N $l, private IDBConnection $db, - private LoggerInterface $logger + private LoggerInterface $logger, ) { $this->userId = $userId; } diff --git a/lib/WOPI/Parser.php b/lib/WOPI/Parser.php index 8c654a34cb..f34edf9dee 100644 --- a/lib/WOPI/Parser.php +++ b/lib/WOPI/Parser.php @@ -13,7 +13,7 @@ class Parser { public function __construct( private DiscoveryService $discoveryService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 6ec12295f7..cf8552eeea 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -8,7 +8,7 @@ define('PHPUNIT_RUN', 1); } -require_once __DIR__.'/../../../lib/base.php'; +require_once __DIR__ . '/../../../lib/base.php'; if (!class_exists(\PHPUnit\Framework\TestCase::class)) { require_once('PHPUnit/Autoload.php'); diff --git a/tests/features/bootstrap/ApiContext.php b/tests/features/bootstrap/ApiContext.php index 465b971312..acb27eb10d 100644 --- a/tests/features/bootstrap/ApiContext.php +++ b/tests/features/bootstrap/ApiContext.php @@ -71,7 +71,7 @@ public function userFillsInFieldsOfWithValuesAsTo($user, $source, ?string $conve ]; } - $this->serverContext->sendOCSRequest('POST', 'apps/richdocuments/api/v1/template/fields/fill/' . $fileId . '?' + $this->serverContext->sendOCSRequest('POST', 'apps/richdocuments/api/v1/template/fields/fill/' . $fileId . '?' . ($convert ? '&convert=' . $convert : '') . ($target ? '&destination=' . $target : ''), ['fields' => $formData]); diff --git a/tests/features/bootstrap/DirectContext.php b/tests/features/bootstrap/DirectContext.php index bd4350522c..a2c8bb96c7 100644 --- a/tests/features/bootstrap/DirectContext.php +++ b/tests/features/bootstrap/DirectContext.php @@ -112,9 +112,9 @@ private function handleDirectEditingLink() { $redirects = $response->getHeader('X-Guzzle-Redirect-History'); $lastServer = array_pop($redirects); if ($lastServer) { - $currentServer = parse_url($lastServer, PHP_URL_SCHEME) . '://'. parse_url($lastServer, PHP_URL_HOST) . ( + $currentServer = parse_url($lastServer, PHP_URL_SCHEME) . '://' . parse_url($lastServer, PHP_URL_HOST) . ( parse_url($lastServer, PHP_URL_PORT) ? ':' . parse_url($lastServer, PHP_URL_PORT) : '' - ). '/'; + ) . '/'; } $contents = $response->getBody()->getContents(); diff --git a/tests/features/bootstrap/RichDocumentsContext.php b/tests/features/bootstrap/RichDocumentsContext.php index b5b32cb294..786e5b3669 100644 --- a/tests/features/bootstrap/RichDocumentsContext.php +++ b/tests/features/bootstrap/RichDocumentsContext.php @@ -65,9 +65,9 @@ public function userOpens($user, $file) { $redirects = $result->getHeader('X-Guzzle-Redirect-History'); $lastServer = array_pop($redirects); if ($lastServer) { - $this->currentServer = parse_url($lastServer, PHP_URL_SCHEME) . '://'. parse_url($lastServer, PHP_URL_HOST) . ( + $this->currentServer = parse_url($lastServer, PHP_URL_SCHEME) . '://' . parse_url($lastServer, PHP_URL_HOST) . ( parse_url($lastServer, PHP_URL_PORT) ? ':' . parse_url($lastServer, PHP_URL_PORT) : '' - ). '/'; + ) . '/'; } $this->extractRichdocumentsFrontendContext($result); @@ -87,7 +87,7 @@ public function generateTokenWithApi($user, $fileId, ?string $shareToken = null, $response = $this->serverContext->getOCSResponse(); - $this->fileId = $fileId . '_ocfake'; + $this->fileId = $fileId . '_ocfake'; $this->fileIds[] = $this->fileId; $this->wopiToken = $response['token']; $this->wopiContext->setWopiParameters($this->currentServer, $this->fileId, $this->wopiToken); @@ -192,9 +192,9 @@ public function userCreatesANewFileFromATemplate($user, $file) { $redirects = $result->getHeader('X-Guzzle-Redirect-History'); $lastServer = array_pop($redirects); if ($lastServer) { - $this->currentServer = parse_url($lastServer, PHP_URL_SCHEME) . '://'. parse_url($lastServer, PHP_URL_HOST) . ( + $this->currentServer = parse_url($lastServer, PHP_URL_SCHEME) . '://' . parse_url($lastServer, PHP_URL_HOST) . ( parse_url($lastServer, PHP_URL_PORT) ? ':' . parse_url($lastServer, PHP_URL_PORT) : '' - ). '/'; + ) . '/'; } $this->extractRichdocumentsFrontendContext($result);