r89441 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89440‎ | r89441 | r89442 >
Date:20:39, 3 June 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added some docs
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php
@@ -16,14 +16,16 @@
1717 */
1818 abstract class SMWDescription {
1919
 20+ /**
 21+ * @var array of SMWPrintRequest
 22+ */
2023 protected $m_printreqs = array();
21 - // add code for managing printouts, including iteration
2224
2325 /**
2426 * Get the (possibly empty) array of all print requests that
2527 * exist for the entities that fit this description.
2628 *
27 - * @return array
 29+ * @return array of SMWPrintRequest
2830 */
2931 public function getPrintRequests() {
3032 return $this->m_printreqs;
@@ -32,7 +34,7 @@
3335 /**
3436 * Set the array of print requests completely.
3537 *
36 - * @param array $printrequests
 38+ * @param array of SMWPrintRequest $printrequests
3739 */
3840 public function setPrintRequests( array $printrequests ) {
3941 $this->m_printreqs = $printrequests;
@@ -68,6 +70,8 @@
6971 * over the canonical [[has location::\<q\>[[Paris]]\</q\>]].
7072 *
7173 * @param boolean $asvalue
 74+ *
 75+ * @return string
7276 */
7377 abstract public function getQueryString( $asvalue = false );
7478
@@ -193,8 +197,18 @@
194198 */
195199 class SMWClassDescription extends SMWDescription {
196200
 201+ /**
 202+ * @var array of SMWDIWikiPage
 203+ */
197204 protected $m_diWikiPages;
198205
 206+ /**
 207+ * Constructor.
 208+ *
 209+ * @param mixed $content SMWDIWikiPage or array of SMWDIWikiPage
 210+ *
 211+ * @throws Exception
 212+ */
199213 public function __construct( $content ) {
200214 if ( $content instanceof SMWDIWikiPage ) {
201215 $this->m_diWikiPages = array( $content );
@@ -205,10 +219,16 @@
206220 }
207221 }
208222
 223+ /**
 224+ * @param SMWClassDescription $description
 225+ */
209226 public function addDescription( SMWClassDescription $description ) {
210227 $this->m_diWikiPages = array_merge( $this->m_diWikiPages, $description->getCategories() );
211228 }
212229
 230+ /**
 231+ * @return array of SMWDIWikiPage
 232+ */
213233 public function getCategories() {
214234 return $this->m_diWikiPages;
215235 }
@@ -285,12 +305,23 @@
286306 */
287307 class SMWConceptDescription extends SMWDescription {
288308
 309+ /**
 310+ * @var SMWDIWikiPage
 311+ */
289312 protected $m_concept;
290313
 314+ /**
 315+ * Constructor.
 316+ *
 317+ * @param SMWDIWikiPage $concept
 318+ */
291319 public function __construct( SMWDIWikiPage $concept ) {
292320 $this->m_concept = $concept;
293321 }
294322
 323+ /**
 324+ * @return SMWDIWikiPage
 325+ */
295326 public function getConcept() {
296327 return $this->m_concept;
297328 }
@@ -330,12 +361,23 @@
331362 */
332363 class SMWNamespaceDescription extends SMWDescription {
333364
 365+ /**
 366+ * @var integer
 367+ */
334368 protected $m_namespace;
335369
 370+ /**
 371+ * Constructor.
 372+ *
 373+ * @param integer $namespace The namespace index
 374+ */
336375 public function __construct( $namespace ) {
337376 $this->m_namespace = $namespace;
338377 }
339378
 379+ /**
 380+ * @return integer
 381+ */
340382 public function getNamespace() {
341383 return $this->m_namespace;
342384 }

Status & tagging log