From 350edf398c55b472e19a3017de9b4d2d3420b9e4 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 10 Apr 2024 15:33:43 +0200 Subject: PHP 8.3 #[\Override] (#6273) * PHP 8.3 #[\Override] https://php.watch/versions/8.3/override-attr With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors) * Update extension example accordingly --- app/Models/StatsDAOPGSQL.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/Models/StatsDAOPGSQL.php') diff --git a/app/Models/StatsDAOPGSQL.php b/app/Models/StatsDAOPGSQL.php index 5204b04e3..4fd00c29d 100644 --- a/app/Models/StatsDAOPGSQL.php +++ b/app/Models/StatsDAOPGSQL.php @@ -9,6 +9,7 @@ class FreshRSS_StatsDAOPGSQL extends FreshRSS_StatsDAO { * @param int $feed id * @return array */ + #[\Override] public function calculateEntryRepartitionPerFeedPerHour(?int $feed = null): array { return $this->calculateEntryRepartitionPerFeedPerPeriod('hour', $feed); } @@ -17,6 +18,7 @@ class FreshRSS_StatsDAOPGSQL extends FreshRSS_StatsDAO { * Calculates the number of article per day of week per feed * @return array */ + #[\Override] public function calculateEntryRepartitionPerFeedPerDayOfWeek(?int $feed = null): array { return $this->calculateEntryRepartitionPerFeedPerPeriod('day', $feed); } @@ -25,6 +27,7 @@ class FreshRSS_StatsDAOPGSQL extends FreshRSS_StatsDAO { * Calculates the number of article per month per feed * @return array */ + #[\Override] public function calculateEntryRepartitionPerFeedPerMonth(?int $feed = null): array { return $this->calculateEntryRepartitionPerFeedPerPeriod('month', $feed); } @@ -34,6 +37,7 @@ class FreshRSS_StatsDAOPGSQL extends FreshRSS_StatsDAO { * @param string $period format string to use for grouping * @return array */ + #[\Override] protected function calculateEntryRepartitionPerFeedPerPeriod(string $period, ?int $feed = null): array { $restrict = ''; if ($feed) { -- cgit v1.2.3