Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/308926
Change subject: PHP code cleanup ...................................................................... PHP code cleanup Followed idea's code suggestions. TODO: * Is private State::version still being used? Comments seem to indicate some sort of serialization * JsonSchema\Validator has two implementations: mediawiki/extensions/Kartographer/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php mediawiki/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php Change-Id: I70cd8e05cd687576efb4f7204cf92afbf6b3c16b --- M includes/ApiSanitizeMapData.php M includes/Hooks.php M includes/SpecialMap.php M includes/State.php M includes/Tag/TagHandler.php 5 files changed, 5 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/26/308926/1 diff --git a/includes/ApiSanitizeMapData.php b/includes/ApiSanitizeMapData.php index cd5067a..b0b1148 100644 --- a/includes/ApiSanitizeMapData.php +++ b/includes/ApiSanitizeMapData.php @@ -37,6 +37,7 @@ } private function sanitizeJson( Title $title, $text ) { + /** @var Parser $wgParser */ global $wgParser; $parser = $wgParser->getFreshParser(); diff --git a/includes/Hooks.php b/includes/Hooks.php index c934c66..4dbf3b0 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -14,11 +14,6 @@ use ParserOutput; class Hooks { - private static $tags = [ - 'mapframe' => 'Kartographer\Tag\MapFrame::entryPoint', - 'maplink' => 'Kartographer\Tag\MapLink::entryPoint', - ]; - /** * ParserFirstCallInit hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/ParserFirstCallInit @@ -55,7 +50,7 @@ * @return bool */ /*public static function onRejectParserCacheValue( ParserOutput $po ) { - // One of these should be prsent in any output with old version of data + // One of these should be present in any output with old version of data if ( $po->getExtensionData( 'kartographer_valid' ) || $po->getExtensionData( 'kartographer_broken' ) ) { diff --git a/includes/SpecialMap.php b/includes/SpecialMap.php index 5203b9a..867d905 100644 --- a/includes/SpecialMap.php +++ b/includes/SpecialMap.php @@ -40,7 +40,7 @@ } $attributions = Html::rawElement( 'div', [ 'id' => 'mw-specialMap-attributions' ], - wfMessage( 'kartographer-attribution' )->title( $this->getTitle() )->parse() ); + wfMessage( 'kartographer-attribution' )->title( $this->getPageTitle() )->parse() ); $this->getOutput()->addHTML( Html::openElement( 'div', [ 'id' => 'mw-specialMap-container', 'class' => 'thumb' ] ) diff --git a/includes/State.php b/includes/State.php index f90741a..5c05e28 100644 --- a/includes/State.php +++ b/includes/State.php @@ -13,7 +13,7 @@ const VERSION = 1; /** @var int Version of this class, for checking after deserialization */ - private $version = self::VERSION; + private /** @noinspection PhpUnusedPrivateFieldInspection */ $version = self::VERSION; private $valid = false; private $broken = false; @@ -23,7 +23,7 @@ private $data = []; /** - * Retrieves an instance of self from ParserOutout, if present + * Retrieves an instance of self from ParserOutput, if present * * @param ParserOutput $output * @return self|null diff --git a/includes/Tag/TagHandler.php b/includes/Tag/TagHandler.php index f467fd0..00264b6 100644 --- a/includes/Tag/TagHandler.php +++ b/includes/Tag/TagHandler.php @@ -16,7 +16,6 @@ use Kartographer\State; use Language; use Parser; -use ParserOutput; use PPFrame; use Status; use stdClass; -- To view, visit https://gerrit.wikimedia.org/r/308926 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70cd8e05cd687576efb4f7204cf92afbf6b3c16b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: Yurik <yu...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits