r95519 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95518‎ | r95519 | r95520 >
Date:20:57, 25 August 2011
Author:hashar
Status:ok
Tags:
Comment:
comment templates to be completed :-)
Modified paths:
  • /trunk/extensions/GPoC/AssessmentsExtractor.php (modified) (history)
  • /trunk/extensions/GPoC/SpecialAssessmentLog.php (modified) (history)
  • /trunk/extensions/GPoC/TableDisplay.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GPoC/TableDisplay.php
@@ -3,17 +3,33 @@
44 exit( 1 );
55 }
66
 7+/**
 8+ * @todo Document overall purpose of this class.
 9+ */
710 class TableDisplay {
 11+
 12+ /**
 13+ * Register our parser functions
 14+ */
815 public static function ParserFunctionInit( &$parser ) {
916 $parser->setFunctionHook( 'AssessmentStats', 'TableDisplay::AssessmentStatsRender' );
1017 return true;
1118 }
1219
 20+ /**
 21+ * Register new magic words.
 22+ */
1323 public static function LanguageGetMagic( &$magicWords, $langCode ) {
1424 $magicWords['AssessmentStats'] = array( 0, 'AssessmentStats' );
1525 return true;
16 - }
 26+ }
1727
 28+ /**
 29+ * @todo Document!
 30+ * @param string $projectName
 31+ * @param unknown $projectStats
 32+ * @return string A wikitable containing statistics for a project name
 33+ */
1834 private static function formatTable( $projectName, $projectStats ) {
1935 // Column Headers
2036 $col_headers = array_keys($projectStats['top']);
@@ -31,7 +47,12 @@
3248 $output .= "|}";
3349 return $output;
3450 }
35 -
 51+
 52+ /**
 53+ * Callback for AssessmentsStats parser function
 54+ * @param Parser $parser Parser object passed by MW hook system (unused)
 55+ * @param unknown A project object??
 56+ */
3657 public static function AssessmentStatsRender( $parser, $project ) {
3758 $projectStats = Statistics::getProjectStats( $project );
3859 $output = TableDisplay::formatTable( $project, $projectStats );
Index: trunk/extensions/GPoC/AssessmentsExtractor.php
@@ -5,12 +5,24 @@
66 **/
77 class AssessmentsExtractor
88 {
 9+ /** @todo document */
910 private $mText;
1011
 12+ /**
 13+ * @todo Document
 14+ * @param string $preparedText TODO: what is it for?
 15+ */
1116 function __construct( $preparedText ) {
1217 $this->mText = $preparedText;
13 - }
 18+ }
1419
 20+ /**
 21+ * Once AssessmentsExtractor is build, call this method to generate
 22+ * an array of assessment.
 23+ * @todo Describe the returned array
 24+ * @todo What happens if the preparedText does not match the expected format?
 25+ * @return array Assessments
 26+ */
1527 public function extractAssessments() {
1628 $regex = '/<span data-project-name="(?P<project>.*)" data-importance="(?P<importance>.*)" data-quality="(?P<quality>.*)"\s*>/';
1729 $matches = array();
Index: trunk/extensions/GPoC/SpecialAssessmentLog.php
@@ -1,5 +1,6 @@
22 <?php
33 /**
 4+ * @todo Document this file
45 */
56
67 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -7,6 +8,9 @@
89 die( 1 );
910 }
1011
 12+/**
 13+ * A special page showing various logs related to the assessment extension
 14+ */
1115 class SpecialAssessmentLog extends SpecialPage {
1216
1317 public function __construct() {

Status & tagging log