From 12385d60c7fc2c263357cb069fd35abb05ff8bd3 Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Thu, 9 Jan 2025 20:02:54 +0100 Subject: [PATCH 1/4] update htmlpurifier to 4.18.0 Also update other packages Signed-off-by: Benjamin Brahmer --- composer.json | 2 +- composer.lock | 118 +++++++++++++++++++++++++------------------------- 2 files changed, 59 insertions(+), 61 deletions(-) diff --git a/composer.json b/composer.json index 8e7393dad..7da5b2324 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ }, "require": { "php": "^8.2", - "ezyang/htmlpurifier": "4.17.0", + "ezyang/htmlpurifier": "4.18.0", "pear/net_url2": "^2.2.2", "riimu/kit-pathjoin": "^1.2.0", "debril/feed-io": "v5.3.1", diff --git a/composer.lock b/composer.lock index 92dc57181..0c0105b45 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": "8fd4dc47a89e68647713c10b995e92fd", + "content-hash": "2b93261f8295691c1c62c09c299f26f0", "packages": [ { "name": "arthurhoaro/favicon", @@ -133,20 +133,20 @@ }, { "name": "ezyang/htmlpurifier", - "version": "v4.17.0", + "version": "v4.18.0", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c" + "reference": "cb56001e54359df7ae76dc522d08845dc741621b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c", - "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/cb56001e54359df7ae76dc522d08845dc741621b", + "reference": "cb56001e54359df7ae76dc522d08845dc741621b", "shasum": "" }, "require": { - "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "require-dev": { "cerdic/css-tidy": "^1.7 || ^2.0", @@ -188,9 +188,9 @@ ], "support": { "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0" + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.18.0" }, - "time": "2023-11-17T15:01:25+00:00" + "time": "2024-11-01T03:51:45+00:00" }, { "name": "fivefilters/readability.php", @@ -259,20 +259,20 @@ }, { "name": "league/uri", - "version": "7.4.1", + "version": "7.5.1", "source": { "type": "git", "url": "https://github.com/thephpleague/uri.git", - "reference": "bedb6e55eff0c933668addaa7efa1e1f2c417cc4" + "reference": "81fb5145d2644324614cc532b28efd0215bda430" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri/zipball/bedb6e55eff0c933668addaa7efa1e1f2c417cc4", - "reference": "bedb6e55eff0c933668addaa7efa1e1f2c417cc4", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/81fb5145d2644324614cc532b28efd0215bda430", + "reference": "81fb5145d2644324614cc532b28efd0215bda430", "shasum": "" }, "require": { - "league/uri-interfaces": "^7.3", + "league/uri-interfaces": "^7.5", "php": "^8.1" }, "conflict": { @@ -337,7 +337,7 @@ "docs": "https://uri.thephpleague.com", "forum": "https://thephpleague.slack.com", "issues": "https://github.com/thephpleague/uri-src/issues", - "source": "https://github.com/thephpleague/uri/tree/7.4.1" + "source": "https://github.com/thephpleague/uri/tree/7.5.1" }, "funding": [ { @@ -345,20 +345,20 @@ "type": "github" } ], - "time": "2024-03-23T07:42:40+00:00" + "time": "2024-12-08T08:40:02+00:00" }, { "name": "league/uri-interfaces", - "version": "7.4.1", + "version": "7.5.0", "source": { "type": "git", "url": "https://github.com/thephpleague/uri-interfaces.git", - "reference": "8d43ef5c841032c87e2de015972c06f3865ef718" + "reference": "08cfc6c4f3d811584fb09c37e2849e6a7f9b0742" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/8d43ef5c841032c87e2de015972c06f3865ef718", - "reference": "8d43ef5c841032c87e2de015972c06f3865ef718", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/08cfc6c4f3d811584fb09c37e2849e6a7f9b0742", + "reference": "08cfc6c4f3d811584fb09c37e2849e6a7f9b0742", "shasum": "" }, "require": { @@ -421,7 +421,7 @@ "docs": "https://uri.thephpleague.com", "forum": "https://thephpleague.slack.com", "issues": "https://github.com/thephpleague/uri-src/issues", - "source": "https://github.com/thephpleague/uri-interfaces/tree/7.4.1" + "source": "https://github.com/thephpleague/uri-interfaces/tree/7.5.0" }, "funding": [ { @@ -429,7 +429,7 @@ "type": "github" } ], - "time": "2024-03-23T07:42:40+00:00" + "time": "2024-12-08T08:18:47+00:00" }, { "name": "masterminds/html5", @@ -938,29 +938,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -968,7 +966,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -979,9 +977,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/event-manager", @@ -1206,16 +1204,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -1258,9 +1256,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", @@ -1430,16 +1428,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.11", + "version": "1.12.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733" + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", - "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c91d4e8bc056f46cf653656e6f71004b254574d1", + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1", "shasum": "" }, "require": { @@ -1484,7 +1482,7 @@ "type": "github" } ], - "time": "2024-11-17T14:08:01+00:00" + "time": "2025-01-05T16:40:22+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -1535,21 +1533,21 @@ }, { "name": "phpstan/phpstan-doctrine", - "version": "1.5.6", + "version": "1.5.7", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-doctrine.git", - "reference": "8ba022846e79238872e315fff61e19b42ba2f139" + "reference": "231d3f795ed5ef54c98961fd3958868cbe091207" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/8ba022846e79238872e315fff61e19b42ba2f139", - "reference": "8ba022846e79238872e315fff61e19b42ba2f139", + "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/231d3f795ed5ef54c98961fd3958868cbe091207", + "reference": "231d3f795ed5ef54c98961fd3958868cbe091207", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12.6" + "phpstan/phpstan": "^1.12.12" }, "conflict": { "doctrine/collections": "<1.0", @@ -1601,22 +1599,22 @@ "description": "Doctrine extensions for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-doctrine/issues", - "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.5.6" + "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.5.7" }, - "time": "2024-11-09T17:34:01+00:00" + "time": "2024-12-02T16:47:26+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "11d4235fbc6313ecbf93708606edfd3222e44949" + "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/11d4235fbc6313ecbf93708606edfd3222e44949", - "reference": "11d4235fbc6313ecbf93708606edfd3222e44949", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/72a6721c9b64b3e4c9db55abbc38f790b318267e", + "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e", "shasum": "" }, "require": { @@ -1653,9 +1651,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.1" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.2" }, - "time": "2024-11-12T12:43:59+00:00" + "time": "2024-12-17T17:20:49+00:00" }, { "name": "phpstan/phpstan-strict-rules", @@ -3273,7 +3271,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -3284,6 +3282,6 @@ "ext-dom": "*", "ext-curl": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } From f64e2e76142800beea1372cac6959ec49a35c52c Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Thu, 9 Jan 2025 20:03:19 +0100 Subject: [PATCH 2/4] Run static testing with php 8.4 Signed-off-by: Benjamin Brahmer --- .github/workflows/api-php-static-code-check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/api-php-static-code-check.yml b/.github/workflows/api-php-static-code-check.yml index 5ed3a0f1c..fcb49b9e8 100644 --- a/.github/workflows/api-php-static-code-check.yml +++ b/.github/workflows/api-php-static-code-check.yml @@ -15,6 +15,10 @@ jobs: nextcloud: pre-release database: sqlite experimental: true + - php-versions: 8.4 + nextcloud: pre-release + database: sqlite + experimental: true name: "phpstan: Nextcloud ${{ matrix.nextcloud }} with ${{ matrix.php-versions }}" steps: - name: Checkout From 6c17dc114960df4c2a31245e6b7c03492d9eca3c Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Thu, 9 Jan 2025 20:13:38 +0100 Subject: [PATCH 3/4] fix implicitly nullable via default value null Signed-off-by: Benjamin Brahmer --- lib/Db/Item.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/Db/Item.php b/lib/Db/Item.php index 17bf4a048..81c2df96a 100644 --- a/lib/Db/Item.php +++ b/lib/Db/Item.php @@ -392,7 +392,7 @@ public function jsonSerialize(): array ]; } - public function setAuthor(string $author = null): self + public function setAuthor(?string $author = null): self { if (!is_null($author)) { $author = strip_tags($author); @@ -406,7 +406,7 @@ public function setAuthor(string $author = null): self return $this; } - public function setBody(string $body = null): self + public function setBody(?string $body = null): self { // FIXME: this should not happen if the target="_blank" is already // on the link @@ -420,7 +420,7 @@ public function setBody(string $body = null): self return $this; } - public function setContentHash(string $contentHash = null): self + public function setContentHash(?string $contentHash = null): self { if ($this->contentHash !== $contentHash) { $this->contentHash = $contentHash; @@ -430,7 +430,7 @@ public function setContentHash(string $contentHash = null): self return $this; } - public function setEnclosureLink(string $enclosureLink = null): self + public function setEnclosureLink(?string $enclosureLink = null): self { if ($this->enclosureLink !== $enclosureLink) { $this->enclosureLink = $enclosureLink; @@ -440,7 +440,7 @@ public function setEnclosureLink(string $enclosureLink = null): self return $this; } - public function setEnclosureMime(string $enclosureMime = null): self + public function setEnclosureMime(?string $enclosureMime = null): self { if ($this->enclosureMime !== $enclosureMime) { $this->enclosureMime = $enclosureMime; @@ -450,7 +450,7 @@ public function setEnclosureMime(string $enclosureMime = null): self return $this; } - public function setMediaThumbnail(string $mediaThumbnail = null): self + public function setMediaThumbnail(?string $mediaThumbnail = null): self { if ($this->mediaThumbnail !== $mediaThumbnail) { $this->mediaThumbnail = $mediaThumbnail; @@ -460,7 +460,7 @@ public function setMediaThumbnail(string $mediaThumbnail = null): self return $this; } - public function setMediaDescription(string $mediaDescription = null): self + public function setMediaDescription(?string $mediaDescription = null): self { if ($this->mediaDescription !== $mediaDescription) { $this->mediaDescription = $mediaDescription; @@ -480,7 +480,7 @@ public function setFeedId(int $feedId): self return $this; } - public function setFingerprint(string $fingerprint = null): self + public function setFingerprint(?string $fingerprint = null): self { if ($this->fingerprint !== $fingerprint) { $this->fingerprint = $fingerprint; @@ -510,7 +510,7 @@ public function setGuidHash(string $guidHash): self return $this; } - public function setLastModified(string $lastModified = null): self + public function setLastModified(?string $lastModified = null): self { if ($this->lastModified !== $lastModified) { $this->lastModified = $lastModified; @@ -520,7 +520,7 @@ public function setLastModified(string $lastModified = null): self return $this; } - public function setPubDate(int $pubDate = null): self + public function setPubDate(?int $pubDate = null): self { if ($this->pubDate !== $pubDate) { $this->pubDate = $pubDate; @@ -540,7 +540,7 @@ public function setRtl(bool $rtl): self return $this; } - public function setSearchIndex(string $searchIndex = null): self + public function setSearchIndex(?string $searchIndex = null): self { if ($this->searchIndex !== $searchIndex) { $this->searchIndex = $searchIndex; @@ -560,7 +560,7 @@ public function setStarred(bool $starred): self return $this; } - public function setTitle(string $title = null): self + public function setTitle(?string $title = null): self { if (!is_null($title)) { $title = trim(strip_tags($title)); @@ -574,7 +574,7 @@ public function setTitle(string $title = null): self return $this; } - public function setSharedBy(string $sharedBy = null): self + public function setSharedBy(?string $sharedBy = null): self { if ($this->sharedBy !== $sharedBy) { $this->sharedBy = $sharedBy; @@ -584,7 +584,7 @@ public function setSharedBy(string $sharedBy = null): self return $this; } - public function setSharedByDisplayName(string $sharedByDisplayName = null): self + public function setSharedByDisplayName(?string $sharedByDisplayName = null): self { if ($this->sharedByDisplayName !== $sharedByDisplayName) { $this->sharedByDisplayName = $sharedByDisplayName; @@ -603,7 +603,7 @@ public function setUnread(bool $unread): self return $this; } - public function setUrl(string $url = null): self + public function setUrl(?string $url = null): self { if (is_null($url)) { return $this; @@ -620,7 +620,7 @@ public function setUrl(string $url = null): self return $this; } - public function setCategoriesJson(string $categoriesJson = null): self + public function setCategoriesJson(?string $categoriesJson = null): self { if ($this->categoriesJson !== $categoriesJson) { $this->categoriesJson = $categoriesJson; @@ -630,7 +630,7 @@ public function setCategoriesJson(string $categoriesJson = null): self return $this; } - public function setCategories(array $categories = null): self + public function setCategories(?array $categories = null): self { $categoriesJson = !is_null($categories) ? json_encode($categories) : null; $this->setCategoriesJson($categoriesJson); From 0202c79e56bc49ed3390836a57b49f8c1dadde10 Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Thu, 9 Jan 2025 20:18:41 +0100 Subject: [PATCH 4/4] fix implicitly nullable via default value null Signed-off-by: Benjamin Brahmer --- CHANGELOG.md | 1 + lib/Service/ItemServiceV2.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac167c259..9dcc0246a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ You can also check [on GitHub](https://github.com/nextcloud/news/releases), the ### Changed - add explanations for the individual values in the feed information table - show error message from `opml` import in web-ui +- enable PHP 8.4 ### Fixed - fix proxy port removed if standard port for the protocol (#3027) diff --git a/lib/Service/ItemServiceV2.php b/lib/Service/ItemServiceV2.php index 4f1401c9d..7fbd5e82c 100644 --- a/lib/Service/ItemServiceV2.php +++ b/lib/Service/ItemServiceV2.php @@ -144,7 +144,7 @@ public function read(string $userId, int $id, bool $read): Entity * * @return int|null Amount of deleted items or null if not applicable */ - public function purgeOverThreshold(int $threshold = null, bool $purgeUnread = null): ?int + public function purgeOverThreshold(?int $threshold = null, ?bool $purgeUnread = null): ?int { $threshold = $threshold ?? $this->config->getValueInt( Application::NAME,