r107686 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107685‎ | r107686 | r107687 >
Date:00:53, 31 December 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
docs++
Modified paths:
  • /trunk/extensions/EducationProgram/api/ApiDeleteEducation.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPDBObject.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPPager.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEPFormPage.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEPPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialEPPage.php
@@ -16,7 +16,7 @@
1717
1818 /**
1919 * The subpage, ie the part after Special:PageName/
20 - * Emptry string if none is provided.
 20+ * Empty string if none is provided.
2121 *
2222 * @since 0.1
2323 * @var string
@@ -49,7 +49,9 @@
5050 *
5151 * @since 0.1
5252 *
53 - * @param string|null $arg
 53+ * @param string|null $subPage
 54+ *
 55+ * @return boolean
5456 */
5557 public function execute( $subPage ) {
5658 $subPage = is_null( $subPage ) ? '' : $subPage;
@@ -128,7 +130,7 @@
129131 *
130132 * @since 0.1
131133 *
132 - * @param array $links
 134+ * @param array $items
133135 */
134136 protected function displayNavigation( array $items = array() ) {
135137 $links = array();
Index: trunk/extensions/EducationProgram/specials/SpecialEPFormPage.php
@@ -100,6 +100,8 @@
101101 }
102102
103103 /**
 104+ * Display the form and set the item field, or redirect the user.
 105+ *
104106 * @since 0.1
105107 */
106108 protected function showContent() {
@@ -371,7 +373,7 @@
372374 }
373375
374376 /**
375 - * Gets called for evey known submitted value, so they can be dealth with if needed.
 377+ * Gets called for evey known submitted value, so they can be dealt with if needed.
376378 *
377379 * @since 0.1
378380 *
Index: trunk/extensions/EducationProgram/includes/EPDBObject.php
@@ -207,7 +207,7 @@
208208 *
209209 * @since 0.1
210210 *
211 - * @param integere|null $id
 211+ * @param integer|null $id
212212 */
213213 public function setId( $id ) {
214214 return $this->setField( 'id', $id );
@@ -429,7 +429,6 @@
430430 *
431431 * @param string $name
432432 * @param mixed $value
433 - * @param boolean $haxPrefix
434433 *
435434 * @throws MWException
436435 */
@@ -943,6 +942,7 @@
944943 * @param array $conditions
945944 * @param array $options
946945 * @param array $joinConds
 946+ * @param array $tables
947947 *
948948 * @return ResultWrapper
949949 */
Index: trunk/extensions/EducationProgram/includes/EPPager.php
@@ -1,7 +1,7 @@
22 <?php
33
44 /**
5 - * Abstract class extensing the TablePager with common functions
 5+ * Abstract class extending the TablePager with common functions
66 * for pagers listing EPDBObject deriving classes and some compatibility helpers.
77 *
88 * @since 0.1
@@ -135,8 +135,7 @@
136136 $this->currentObject = $c::newFromDBResult( $row );
137137
138138 $cells = array();
139 - $fields = $this->getFieldNames();
140 -
 139+
141140 foreach ( $this->getFieldNames() as $field => $name ) {
142141 if ( $field === '_select' ) {
143142 $value = Html::element(
@@ -189,8 +188,7 @@
190189 * @return array
191190 */
192191 public function getFieldNames() {
193 - $c = $this->className; // Yeah, this is needed in PHP 5.3 >_>
194 - $conds = $this->conds; // Indeed, this is also needed >_>
 192+ $conds = $this->conds; // Yeah, this is needed in PHP 5.3 >_>
195193 $fields = array_filter( $this->getFields(), function( $name ) use ( $conds ) {
196194 return !array_key_exists( $name, $conds );
197195 } );
@@ -198,18 +196,18 @@
199197 $fields = $this->getFieldNameList( $fields );
200198
201199 if ( $this->hasMultipleItemControl() ) {
202 - // This is a hack to get an extra colum for select all control.
 200+ // This is a hack to get an extra column for select all control.
203201 $fields = array_merge( array( '_select' => '' ), $fields );
204202 }
205203
206 - $fields['_controls'] = ''; // This is a hack to get an extra colum for the control links.
 204+ $fields['_controls'] = ''; // This is a hack to get an extra column for the control links.
207205
208206 return $fields;
209207 }
210208
211209 /**
212210 * Returns HTML for the multiple item control.
213 - * With actions comming from @see getMultipleItemActions.
 211+ * With actions coming from @see getMultipleItemActions.
214212 *
215213 * @since 0.1
216214 *
@@ -520,7 +518,7 @@
521519 protected abstract function getFormattedValue( $name, $value );
522520
523521 /**
524 - * Returns a list of (escaped, html) links to add in an adittional column.
 522+ * Returns a list of (escaped, html) links to add in an additional column.
525523 *
526524 * @since 0.1
527525 *
@@ -538,7 +536,7 @@
539537 * @since 0.1
540538 *
541539 * @param string $type
542 - * @paran integer $id
 540+ * @param integer $id
543541 *
544542 * @return string
545543 */
Index: trunk/extensions/EducationProgram/api/ApiDeleteEducation.php
@@ -14,6 +14,13 @@
1515 */
1616 class ApiDeleteEducation extends ApiBase {
1717
 18+ /**
 19+ * Maps class names to values for the type parameter.
 20+ *
 21+ * @since 0.1
 22+ *
 23+ * @var array
 24+ */
1825 protected static $typeMap = array(
1926 'org' => 'EPOrg',
2027 'course' => 'EPCourse',
@@ -22,6 +29,15 @@
2330 'mentor' => 'EPMentor',
2431 );
2532
 33+ /**
 34+ * Returns the type param value for a class name.
 35+ *
 36+ * @since 0.1
 37+ *
 38+ * @param string $className
 39+ *
 40+ * @return string
 41+ */
2642 public static function getTypeForClassName( $className ) {
2743 static $map = null;
2844
@@ -57,10 +73,14 @@
5874 }
5975
6076 /**
 77+ * Returns if the user is allowed to delete the specified object(s).
 78+ *
6179 * @since 0.1
6280 *
6381 * @param string $type
6482 * @param array $params
 83+ *
 84+ * @return boolean
6585 */
6686 protected function userIsAllowed( $type, array $params ) {
6787 $user = $this->getUser();

Status & tagging log