openshift makefile
[mdref/mdref] / mdref / RefListing.php
index fd86b945131c4a6b2a9f4005f87c89601aa639fe..3816be23d60beb0b8a8c6ab33993e7efc39d7831 100644 (file)
@@ -2,6 +2,9 @@
 
 namespace mdref;
 
+/**
+ * A list of markdown reference files
+ */
 class RefListing implements \Countable, \Iterator
 {
        /**
@@ -25,30 +28,56 @@ class RefListing implements \Countable, \Iterator
                }, $files);
        }
        
+       /**
+        * Implements \Countable
+        * @return int
+        */
        function count() {
                return count($this->entries);
        }
        
+       /**
+        * Implements \Iterator
+        */
        function rewind() {
                reset($this->entries);
        }
        
+       /**
+        * Implements \Iterator
+        * @return bool
+        */
        function valid() {
                return null !== key($this->entries);
        }
        
+       /**
+        * Implements \Iterator
+        * @return string
+        */
        function key() {
                return $this->path->getSubPath(current($this->entries));
        }
        
+       /**
+        * Implements \Iterator
+        */
        function next() {
                next($this->entries);
        }
-       
+
+       /**
+        * Implements \Iterator
+        * @return \mdref\RefEntry
+        */
        function current() {
                return new RefEntry($this->path, $this->key());//$this->format($this->key());
        }
        
+       /**
+        * Get the parent reference entry
+        * @return null|\mdref\RefEntry
+        */
        function getParent() {
                switch ($parent = dirname($this->path->getPathName())) {
                        case ".":
@@ -59,6 +88,10 @@ class RefListing implements \Countable, \Iterator
                }
        }
        
+       /**
+        * Get the reference entry this reflist is based of
+        * @return \mdref\RefEntry
+        */
        function getSelf() {
                return new RefEntry($this->path);
        }