Wilkins has uploaded a new change for review. https://gerrit.wikimedia.org/r/245910
Change subject: Code cleanup from PHPMD suggestions ...................................................................... Code cleanup from PHPMD suggestions Change-Id: I8af8116dc3e2499c3fd4688ee002ac2d4a4f5a6b --- M DescendantFamilyTree.php M FamilyTree.php M FamilyTreeFactory.php M Gedcom5FilePrinter.php M GenealogicalFilePrinter.php M PersonPageValues.php M SemanticGenealogy.body.php 7 files changed, 17 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy refs/changes/10/245910/1 diff --git a/DescendantFamilyTree.php b/DescendantFamilyTree.php index 218e269..5656612 100644 --- a/DescendantFamilyTree.php +++ b/DescendantFamilyTree.php @@ -24,14 +24,14 @@ { $output = $this->getOutput(); $children = $person->getChildren(); - $i = 1; + $count = 1; foreach ($children as $child) { - $pel = $pellissier . $i . '.'; + $pel = $pellissier . $count . '.'; $output->addWikiText($pel . ' ' . $child->getDescriptionWikiText(false)); if ($end > 0) { $this->outputDescendantLine($child, $pel, $end - 1); } - $i++; + $count++; } } diff --git a/FamilyTree.php b/FamilyTree.php index c1c0f3f..92b9582 100644 --- a/FamilyTree.php +++ b/FamilyTree.php @@ -137,6 +137,6 @@ */ public function render() { - $output->addHtml(""); + $this->output->addHtml(""); } } diff --git a/FamilyTreeFactory.php b/FamilyTreeFactory.php index f3bcac7..2c819fc 100644 --- a/FamilyTreeFactory.php +++ b/FamilyTreeFactory.php @@ -16,13 +16,14 @@ /** * Create a new FamilyTree object - * - * @param string $type the type of the wanted FamilyTree + * + * @param string $type the type of the wanted FamilyTree * * @return object a new FamilyTree Object */ public static function create($type) { + global $wgOut; switch($type) { case 'ancestors': return new AncestorsFamilyTree(); @@ -34,7 +35,7 @@ return new RelationFamilyTree(); break; default: - $output->addWikiText('<span class="error">' . wfMsg('semanticgenealogy-specialfamilytree-error-unknowntype', $type) . '</span>'); + $wgOut->addWikiText('<span class="error">' . wfMsg('semanticgenealogy-specialfamilytree-error-unknowntype', $type) . '</span>'); } } } diff --git a/Gedcom5FilePrinter.php b/Gedcom5FilePrinter.php index 433f629..aad0851 100644 --- a/Gedcom5FilePrinter.php +++ b/Gedcom5FilePrinter.php @@ -43,7 +43,6 @@ */ protected function setFamiliesList() { - $i = 1; foreach ($this->people as $child) { $id = $this->getFamilyIdForChild($child); if ($id != '0S0') { diff --git a/GenealogicalFilePrinter.php b/GenealogicalFilePrinter.php index 8348a5c..b62a4fd 100644 --- a/GenealogicalFilePrinter.php +++ b/GenealogicalFilePrinter.php @@ -18,7 +18,7 @@ * Add people to the GEDCOM file * * @param $people array|PersonPageValues - * + * * @return void */ public function addPeople($people) diff --git a/PersonPageValues.php b/PersonPageValues.php index 6e6e633..3dee77f 100644 --- a/PersonPageValues.php +++ b/PersonPageValues.php @@ -89,16 +89,16 @@ return $this->children; } - public static function comparePeopleByBirthDate(PersonPageValues $a, PersonPageValues $b) + public static function comparePeopleByBirthDate(PersonPageValues $personA, PersonPageValues $personB) { - if ($a->birthdate instanceof SMWDITime) { - $aKey = $a->birthdate->getSortKey(); + if ($personA->birthdate instanceof SMWDITime) { + $aKey = $personA->birthdate->getSortKey(); } else { $aKey = 3000; } - if ($b->birthdate instanceof SMWDITime) { - $bKey = $b->birthdate->getSortKey(); + if ($personB->birthdate instanceof SMWDITime) { + $bKey = $personB->birthdate->getSortKey(); } else { $bKey = 3000; } @@ -132,10 +132,10 @@ return $text; } - protected static function getWikiTextDateFromSMWDITime(SMWDITime $di) + protected static function getWikiTextDateFromSMWDITime(SMWDITime $dataItem) { $val = new SMWTimeValue(SMWDataItem::TYPE_TIME); - $val->setDataItem($di); + $val->setDataItem($dataItem); return $val->getShortWikiText(); } diff --git a/SemanticGenealogy.body.php b/SemanticGenealogy.body.php index 41c2fd2..22d2dac 100644 --- a/SemanticGenealogy.body.php +++ b/SemanticGenealogy.body.php @@ -24,7 +24,7 @@ return $properties; } - global $wgGenealogicalProperties, $wgOut; + global $wgGenealogicalProperties; $properties = array(); if (!is_array($wgGenealogicalProperties)) { -- To view, visit https://gerrit.wikimedia.org/r/245910 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8af8116dc3e2499c3fd4688ee002ac2d4a4f5a6b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticGenealogy Gerrit-Branch: master Gerrit-Owner: Wilkins <thiba...@taillandier.name> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits