revert r111028 (attempt to fix bug 34254)
[lhc/web/wiklou.git] / includes / parser / Preprocessor.php
index 322e197..ae088fd 100644 (file)
@@ -1,16 +1,52 @@
 <?php
+/**
+ * Interfaces for preprocessors
+ *
+ * @file
+ */
 
 /**
  * @ingroup Parser
  */
 interface Preprocessor {
-       /** Create a new preprocessor object based on an initialised Parser object */
+       /**
+        * Create a new preprocessor object based on an initialised Parser object
+        *
+        * @param $parser Parser
+        */
        function __construct( $parser );
 
-       /** Create a new top-level frame for expansion of a page */
+       /**
+        * Create a new top-level frame for expansion of a page
+        *
+        * @return PPFrame
+        */
        function newFrame();
 
-       /** Preprocess text to a PPNode */
+       /**
+        * Create a new custom frame for programmatic use of parameter replacement as used in some extensions
+        *
+        * @param $args array
+        *
+        * @return PPFrame
+        */
+       function newCustomFrame( $args );
+
+       /**
+        * Create a new custom node for programmatic use of parameter replacement as used in some extensions
+        *
+        * @param $values
+        */
+       function newPartNodeArray( $values );
+
+       /**
+        * Preprocess text to a PPNode
+        *
+        * @param $text
+        * @param $flags
+        *
+        * @return PPNode
+        */
        function preprocessToObj( $text, $flags = 0 );
 }
 
@@ -28,6 +64,11 @@ interface PPFrame {
 
        /**
         * Create a child frame
+        *
+        * @param $args array
+        * @param $title Title
+        *
+        * @return PPFrame
         */
        function newChild( $args = false, $title = false );
 
@@ -59,9 +100,26 @@ interface PPFrame {
 
        /**
         * Returns true if there are no arguments in this frame
+        *
+        * @return bool
         */
        function isEmpty();
 
+       /**
+        * Returns all arguments of this frame
+        */
+       function getArguments();
+
+       /**
+        * Returns all numbered arguments of this frame
+        */
+       function getNumberedArguments();
+
+       /**
+        * Returns all named arguments of this frame
+        */
+       function getNamedArguments();
+
        /**
         * Get an argument to this frame by name
         */
@@ -69,6 +127,10 @@ interface PPFrame {
 
        /**
         * Returns true if the infinite loop check is OK, false if a loop is detected
+        *
+        * @param $title
+        *
+        * @return bool
         */
        function loopCheck( $title );
 
@@ -76,6 +138,13 @@ interface PPFrame {
         * Return true if the frame is a template frame
         */
        function isTemplate();
+
+       /**
+        * Get a title of frame
+        *
+        * @return Title
+        */
+       function getTitle();
 }
 
 /**
@@ -100,6 +169,8 @@ interface PPNode {
 
        /**
         * Get the first child of a tree node. False if there isn't one.
+        *
+        * @return PPNode
         */
        function getFirstChild();