Show
Ignore:
Timestamp:
01/10/06 11:24:19 (3 years ago)
Author:
argh
Message:

Added some docs; Updated the render abstract method and added an error check for abstract method calls.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/patXMLPretty/Renderer.php

    r24 r40  
    1010 
    1111/** 
     12 * Error: abstract method called 
     13 */ 
     14 define( 'PATXMLPRETTY_RENDERER_ERROR_ABSTRACT_METHOD', 'patXMLPretty_Renderer:01' ); 
     15 
     16/** 
    1217 * Base renderer class that renderers extend for common functionality. 
    1318 * 
    1419 * @package     patXMLPretty 
    1520 * @subpackage  Renderer 
    16  * @author      Sebastian Mordziol <argh@php-tools.net> 
     21 * @author      Sebastian 'The Argh' Mordziol <argh@php-tools.net> 
    1722 * @version     0.1.0 
    1823 * @license     LGPL 
     
    6267    } 
    6368 
    64     function render( $documentInfo, $elementsTree ) 
     69   /** 
     70    * Main render method that patXMLPretty automatically 
     71    * calls to trigger the highlighting of the elements 
     72    * tree collected by the selected parsing engine. 
     73    * 
     74    * @abstract 
     75    * @access   public 
     76    * @param    array 
     77    * @param    array 
     78    * @param    array|null 
     79    * @return   string|patError 
     80    */ 
     81    function render( $documentInfo, $elementsTree, $doctype ) 
    6582    { 
     83        $error = patErrorManager::raiseError( 
     84            PATXMLPRETTY_RENDERER_ERROR_ABSTRACT_METHOD, 
     85            $this->userMessages['error'], 
     86            'The [render] renderer method is an abstract method that cannot be called directly. '. 
     87            'Chances are you either tried to call this method on the base class or the renderer '. 
     88            'class you are using does not implement it. For reference, my class name is ['.get_class( $this ).'].' 
     89        ); 
     90 
     91        return $error; 
    6692    } 
    6793}