Class PHP_Beautifier_Filter_Pear

Description

Filter the code to make it compatible with PEAR Coding Standards

The default filter, PHP_Beautifier_Filter_Default have most of the specs but adhere more to GNU C. So, this filter make the following modifications:

  • Add 2 newlines after Break in switch statements. Break indent is the same of previous line
  • Brace in function definition put on a new line, same indent of 'function' construct
  • Comments started with '#' are replaced with '//'
  • Open tags are replaced with <?php
  • T_OPEN_TAG_WITH_ECHO replaced with <?php echo
  • With setting 'add_header', the filter add one of the standard PEAR comment header (php, bsd, apache, lgpl, pear) or any file as licence header. Use:
    1.  $oBeaut->addFilter('Pear',array('add_header'=>'php'));
Two extra options allows to break the spec about newline before braces on function and classes. By default, they are set to true. Use
  1.  $oBeaut->addFilter('Pear',array('newline_class'=>false'newline_function'=>false));

Located in /Beautifier/Filter/Pear.filter.php (line 59)

PHP_Beautifier_Filter
   |
   --PHP_Beautifier_Filter_Pear
Variable Summary
Method Summary
 void preProcess ()
 void t_break ( $sTag)
 void t_case ( $sTag)
 void t_close_brace ( $sTag)
 void t_comment ( $sTag)
 void t_default ( $sTag)
 void t_open_brace ( $sTag)
 void t_open_tag ( $sTag)
 void t_open_tag_with_echo ( $sTag)
 void t_semi_colon ( $sTag)
Variables
mixed $aSettings = array('add_header' => false, 'newline_class' => true, 'newline_function' => true, 'switch_without_indent'=> true) (line 61)
  • access: protected

Redefinition of:
PHP_Beautifier_Filter::$aSettings
Settings for the Filter
mixed $sDescription = 'Filter the code to make it compatible with PEAR Coding Specs' (line 62)
  • access: protected

Redefinition of:
PHP_Beautifier_Filter::$sDescription
Description of the Filter

Inherited Variables

Inherited from PHP_Beautifier_Filter

PHP_Beautifier_Filter::$aFilterTokenFunctions
PHP_Beautifier_Filter::$aSettingsDefinition
PHP_Beautifier_Filter::$aToken
PHP_Beautifier_Filter::$bOn
PHP_Beautifier_Filter::$oBeaut
Methods
addHeaderComment (line 180)
void addHeaderComment ()
preProcess (line 176)
void preProcess ()

Redefinition of:
PHP_Beautifier_Filter::preProcess()
Called from PHP_Beautifier::process() at the beginning
t_break (line 116)
void t_break ( $sTag)
  • $sTag
t_case (line 100)
void t_case ( $sTag)
  • $sTag
t_close_brace (line 68)
void t_close_brace ( $sTag)
  • $sTag
t_comment (line 148)
void t_comment ( $sTag)
  • $sTag
t_default (line 112)
void t_default ( $sTag)
  • $sTag
t_open_brace (line 123)
void t_open_brace ( $sTag)
  • $sTag
t_open_tag (line 157)
void t_open_tag ( $sTag)
  • $sTag
t_open_tag_with_echo (line 64)
void t_open_tag_with_echo ( $sTag)
  • $sTag
t_semi_colon (line 83)
void t_semi_colon ( $sTag)
  • $sTag

Inherited Methods

Inherited From PHP_Beautifier_Filter

 PHP_Beautifier_Filter::__construct()
 PHP_Beautifier_Filter::addSettingDefinition()
 PHP_Beautifier_Filter::getDescription()
 PHP_Beautifier_Filter::getName()
 PHP_Beautifier_Filter::getSetting()
 PHP_Beautifier_Filter::handleToken()
 PHP_Beautifier_Filter::off()
 PHP_Beautifier_Filter::on()
 PHP_Beautifier_Filter::postProcess()
 PHP_Beautifier_Filter::preProcess()
 PHP_Beautifier_Filter::setSetting()
 PHP_Beautifier_Filter::__call()
 PHP_Beautifier_Filter::__sleep()
 PHP_Beautifier_Filter::__toString()
Class Constants

Inherited Constants

Inherited from PHP_Beautifier_Filter

PHP_Beautifier_Filter::BYPASS

Documentation generated on Mon, 31 May 2010 16:16:09 -0400 by phpDocumentor 1.4.3