ScriptReorganizer
[ class tree: ScriptReorganizer ] [ index: ScriptReorganizer ] [ all elements ]

Source for file Decorator.php

Documentation is available at Decorator.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * ScriptReorganizer Type :: Decorator
  7.  *
  8.  * PHP version 5
  9.  *
  10.  * LICENSE: This library is free software; you can redistribute it and/or modify it
  11.  * under the terms of the GNU Lesser General Public License as published by the Free
  12.  * Software Foundation; either version 2.1 of the License, or (at your option) any
  13.  * later version.
  14.  *
  15.  * @category   Tools
  16.  * @package    ScriptReorganizer
  17.  * @subpackage Type
  18.  * @author     Stefano F. Rausch <stefano@rausch-e.net>
  19.  * @copyright  2005 Stefano F. Rausch <stefano@rausch-e.net>
  20.  * @license    http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  21.  * @version    SVN: $Id: Decorator.php 32 2005-10-30 22:05:19Z stefanorausch $
  22.  * @link       http://pear.php.net/package/ScriptReorganizer
  23.  * @filesource
  24.  */
  25.  
  26. /**
  27.  * Extends <kbd>ScriptReorganizer_Type</kbd>
  28.  */
  29. require_once 'ScriptReorganizer/Type.php';
  30.  
  31. /**
  32.  * Base class to be extended by (type) decorators to apply
  33.  *
  34.  * All decorators must follow the naming convention
  35.  * <kbd>ScriptReorganizer_Type_Decorator_<Decorator></kbd>.
  36.  *
  37.  * @category   Tools
  38.  * @package    ScriptReorganizer
  39.  * @subpackage Type
  40.  * @author     Stefano F. Rausch <stefano@rausch-e.net>
  41.  * @copyright  2005 Stefano F. Rausch <stefano@rausch-e.net>
  42.  * @license    http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  43.  * @version    Release: @package_version@
  44.  * @link       http://pear.php.net/package/ScriptReorganizer
  45.  */
  46. {
  47.     // {{{ public function __construct( ScriptReorganizer_Type $type )
  48.     
  49.     /**
  50.      * Constructor
  51.      *
  52.      * @param ScriptReorganizer_Type $type a <kbd>ScriptReorganizer_Type</kbd> to
  53.      *         decorate
  54.      */
  55.     public function __constructScriptReorganizer_Type $type )
  56.     {
  57.         $this->type $type;
  58.     }
  59.     
  60.     // }}}
  61.     // {{{ public function __destruct()
  62.     
  63.     /**
  64.      * Destructor
  65.      */
  66.     public function __destruct()
  67.     {
  68.         unset$this->type );
  69.     }
  70.     
  71.     // }}}
  72.     
  73.     // {{{ public function load( $file )
  74.     
  75.     /**
  76.      * Loads the script's content to be reorganized from disk
  77.      *
  78.      * @param  string $file a string representing the file's name to load
  79.      * @return void 
  80.      * @throws {@link ScriptReorganizer_Type_Exception ScriptReorganizer_Type_Exception}
  81.      */
  82.     public function load$file )
  83.     {
  84.         $this->type->load$file );
  85.     }
  86.     
  87.     // }}}
  88.     // {{{ public function reformat()
  89.     
  90.     /**
  91.      * Reorganizes the script's content by applying the chosen
  92.      * {@link ScriptReorganizer_Strategy Strategy}
  93.      *
  94.      * @return void 
  95.      */
  96.     public function reformat()
  97.     {
  98.         $this->type->reformat();
  99.     }
  100.     
  101.     // }}}
  102.     // {{{ public function save( $file )
  103.     
  104.     /**
  105.      * Saves the reorganized script's content to disk
  106.      *
  107.      * @param  string $file a string representing the file's name to save
  108.      * @return void 
  109.      * @throws {@link ScriptReorganizer_Type_Exception ScriptReorganizer_Type_Exception}
  110.      */
  111.     public function save$file )
  112.     {
  113.         $this->type->save$file );
  114.     }
  115.     
  116.     // }}}
  117.     
  118.     // {{{ package function _getContent()
  119.     
  120.     /**
  121.      * Gets the script's content currently being reorganized
  122.      *
  123.      * @visibility package restricted
  124.      * @return     string a string representing the script's content
  125.      */
  126.     public function _getContent()
  127.     {
  128.         return $this->type->_getContent();
  129.     }
  130.     
  131.     // }}}
  132.     // {{{ package function _setContent( $content )
  133.     
  134.     /**
  135.      * Sets the script's content currently being reorganized
  136.      *
  137.      * @visibility package restricted
  138.      * @param      string $content a string representing the content's replacement
  139.      * @return     void 
  140.      */
  141.     public function _setContent$content )
  142.     {
  143.         $this->type->_setContent$content );
  144.     }
  145.     
  146.     // }}}
  147.     
  148.     // {{{ private properties
  149.     
  150.     /**
  151.      * Holds the type to decorate
  152.      *
  153.      * @var ScriptReorganizer_Type 
  154.      */
  155.     private $type = null;
  156.     
  157.     // }}}
  158. }
  159.  
  160. /*
  161.  * Local variables:
  162.  * tab-width: 4
  163.  * c-basic-offset: 4
  164.  * c-hanging-comment-ender-p: nil
  165.  * End:
  166.  */
  167.  
  168. ?>

Documentation generated on Mon, 11 Mar 2019 14:10:29 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.