From 659df897ea828bba243ca9879875870c35e7bb03 Mon Sep 17 00:00:00 2001 From: thiemowmde Date: Thu, 16 Jan 2025 14:24:44 +0100 Subject: Remove trivial 1-line PHPDocs that just repeat the code I assume these are all either auto-generated by an IDE or the language-level type declarations have been added later. In any case the comments don't add any new information to what the code already says. This is just extra clutter that makes the code harder to read, I would argue. There are many, many more comments like this. In this patch I intentionally focus on the most trivial 1-line comments. Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d --- includes/parser/ParserObserver.php | 3 --- includes/parser/Parsoid/Config/PageConfig.php | 3 --- includes/parser/Parsoid/Config/PageContent.php | 3 --- includes/parser/Parsoid/Config/SiteConfig.php | 1 - includes/parser/Parsoid/HtmlToContentTransform.php | 24 ---------------------- includes/parser/Parsoid/ParsoidServices.php | 3 --- 6 files changed, 37 deletions(-) (limited to 'includes/parser') diff --git a/includes/parser/ParserObserver.php b/includes/parser/ParserObserver.php index 7655641b0132..bb28e0d073bf 100644 --- a/includes/parser/ParserObserver.php +++ b/includes/parser/ParserObserver.php @@ -49,9 +49,6 @@ class ParserObserver { private MapCacheLRU $previousParseStackTraces; - /** - * @param LoggerInterface $logger - */ public function __construct( LoggerInterface $logger ) { $this->logger = $logger; $this->previousParseStackTraces = new MapCacheLRU( 10 ); diff --git a/includes/parser/Parsoid/Config/PageConfig.php b/includes/parser/Parsoid/Config/PageConfig.php index f99028e0911a..c57227813b18 100644 --- a/includes/parser/Parsoid/Config/PageConfig.php +++ b/includes/parser/Parsoid/Config/PageConfig.php @@ -134,9 +134,6 @@ class PageConfig extends IPageConfig { return $stuff['revision-record'] ?? null; } - /** - * @return ?RevisionRecord - */ private function getRevision(): ?RevisionRecord { return $this->revision; } diff --git a/includes/parser/Parsoid/Config/PageContent.php b/includes/parser/Parsoid/Config/PageContent.php index 2ed56384b37f..fca23ae2fc77 100644 --- a/includes/parser/Parsoid/Config/PageContent.php +++ b/includes/parser/Parsoid/Config/PageContent.php @@ -31,9 +31,6 @@ use Wikimedia\Parsoid\Config\PageContent as IPageContent; class PageContent extends IPageContent { private RevisionRecord $rev; - /** - * @param RevisionRecord $rev - */ public function __construct( RevisionRecord $rev ) { $this->rev = $rev; } diff --git a/includes/parser/Parsoid/Config/SiteConfig.php b/includes/parser/Parsoid/Config/SiteConfig.php index be6964a6b240..6fb3fb5cbbbc 100644 --- a/includes/parser/Parsoid/Config/SiteConfig.php +++ b/includes/parser/Parsoid/Config/SiteConfig.php @@ -807,7 +807,6 @@ class SiteConfig extends ISiteConfig { return $this->config->get( MainConfigNames::UrlProtocols ); } - /** @return array */ public function getNoFollowConfig(): array { return [ 'nofollow' => $this->config->get( MainConfigNames::NoFollowLinks ), diff --git a/includes/parser/Parsoid/HtmlToContentTransform.php b/includes/parser/Parsoid/HtmlToContentTransform.php index ad48d2c85055..1ab61ee213da 100644 --- a/includes/parser/Parsoid/HtmlToContentTransform.php +++ b/includes/parser/Parsoid/HtmlToContentTransform.php @@ -106,9 +106,6 @@ class HtmlToContentTransform { $this->options = $options; } - /** - * @param RevisionRecord $rev - */ public function setOriginalRevision( RevisionRecord $rev ): void { if ( $this->pageConfig ) { throw new LogicException( 'Cannot set revision after using the PageConfig' ); @@ -121,9 +118,6 @@ class HtmlToContentTransform { $this->oldid = $rev->getId(); } - /** - * @param int $oldid - */ public function setOriginalRevisionId( int $oldid ): void { if ( $this->pageConfig ) { throw new LogicException( 'Cannot set revision ID after using the PageConfig' ); @@ -135,9 +129,6 @@ class HtmlToContentTransform { $this->oldid = $oldid; } - /** - * @param Bcp47Code $lang - */ public function setContentLanguage( Bcp47Code $lang ): void { if ( $this->pageConfig ) { throw new LogicException( 'Cannot set content language after using the PageConfig' ); @@ -199,16 +190,10 @@ class HtmlToContentTransform { $this->modifiedPageBundle->mw = $modifiedDataMW; } - /** - * @param string $originalSchemaVeraion - */ public function setOriginalSchemaVersion( string $originalSchemaVeraion ): void { $this->originalPageBundle->version = $originalSchemaVeraion; } - /** - * @param string $originalHtml - */ public function setOriginalHtml( string $originalHtml ): void { if ( $this->doc ) { throw new LogicException( __FUNCTION__ . ' cannot be called after' . @@ -218,9 +203,6 @@ class HtmlToContentTransform { $this->originalPageBundle->html = $originalHtml; } - /** - * @param array $originalDataMW - */ public function setOriginalDataMW( array $originalDataMW ): void { if ( $this->doc ) { throw new LogicException( __FUNCTION__ . ' cannot be called after getModifiedDocument()' ); @@ -235,9 +217,6 @@ class HtmlToContentTransform { } } - /** - * @param array $originalDataParsoid - */ public function setOriginalDataParsoid( array $originalDataParsoid ): void { if ( $this->doc ) { throw new LogicException( __FUNCTION__ . ' cannot be called after getModifiedDocument()' ); @@ -248,9 +227,6 @@ class HtmlToContentTransform { $this->modifiedPageBundle->parsoid = $originalDataParsoid; } - /** - * @return PageConfig - */ private function getPageConfig(): PageConfig { if ( !$this->pageConfig ) { diff --git a/includes/parser/Parsoid/ParsoidServices.php b/includes/parser/Parsoid/ParsoidServices.php index 0c4c4a647617..626146a0de06 100644 --- a/includes/parser/Parsoid/ParsoidServices.php +++ b/includes/parser/Parsoid/ParsoidServices.php @@ -34,9 +34,6 @@ use Wikimedia\Parsoid\Config\SiteConfig; class ParsoidServices { private MediaWikiServices $services; - /** - * @param MediaWikiServices $services - */ public function __construct( MediaWikiServices $services ) { $this->services = $services; } -- cgit v1.2.3