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

Class: PHP_Beautifier_Filter_Pear

Source Location: /PHP_Beautifier-0.1.15/Beautifier/Filter/Pear.filter.php

Class Overview

PHP_Beautifier_Filter
   |
   --PHP_Beautifier_Filter_Pear

Filter the code to make it compatible with PEAR Coding Standards


Author(s):

Version:

  • CVS: $Id:$

Copyright:

  • 2004-2010 Claudio Bustos

Variables

Methods


Inherited Variables

Inherited Methods

Class: PHP_Beautifier_Filter

PHP_Beautifier_Filter::__construct()
Constructor If you need to overload this (for example, to create a definition for setting with addSettingDefinition() remember call the parent constructor.
PHP_Beautifier_Filter::addSettingDefinition()
Add a setting definition
PHP_Beautifier_Filter::getDescription()
PHP_Beautifier_Filter::getName()
return @string
PHP_Beautifier_Filter::getSetting()
Get a setting of the Filter
PHP_Beautifier_Filter::handleToken()
Function called from PHP_Beautifier::process() to process the tokens.
PHP_Beautifier_Filter::off()
Turn off the Filter Use inside the code to beautify Ex.
PHP_Beautifier_Filter::on()
Turn on the Filter Use inside the code to beautify Ex.
PHP_Beautifier_Filter::postProcess()
Called from PHP_Beautifier::process() at the end of processing
PHP_Beautifier_Filter::preProcess()
Called from PHP_Beautifier::process() at the beginning
PHP_Beautifier_Filter::setSetting()
Set a value of a Setting
PHP_Beautifier_Filter::__call()
PHP_Beautifier_Filter::__sleep()
PHP_Beautifier_Filter::__toString()

Class Details

[line 59]
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));



[ Top ]


Class Variables

$aSettings = array('add_header' => false, 'newline_class' => true, 'newline_function' => true, 'switch_without_indent'=> true)

[line 61]

  • Access: protected

Type:   mixed
Overrides:   Array


[ Top ]

$sDescription =  'Filter the code to make it compatible with PEAR Coding Specs'

[line 62]

  • Access: protected

Type:   mixed
Overrides:   Array


[ Top ]



Method Detail

addHeaderComment   [line 180]

void addHeaderComment( )


[ Top ]

preProcess   [line 176]

void preProcess( )


Overrides PHP_Beautifier_Filter::preProcess() (Called from PHP_Beautifier::process() at the beginning)
[ Top ]

t_break   [line 116]

void t_break( $sTag)


Parameters:

   $sTag   — 

[ Top ]

t_case   [line 100]

void t_case( $sTag)


Parameters:

   $sTag   — 

[ Top ]

t_close_brace   [line 68]

void t_close_brace( $sTag)


Parameters:

   $sTag   — 

[ Top ]

t_comment   [line 148]

void t_comment( $sTag)


Parameters:

   $sTag   — 

[ Top ]

t_default   [line 112]

void t_default( $sTag)


Parameters:

   $sTag   — 

[ Top ]

t_open_brace   [line 123]

void t_open_brace( $sTag)


Parameters:

   $sTag   — 

[ Top ]

t_open_tag   [line 157]

void t_open_tag( $sTag)


Parameters:

   $sTag   — 

[ Top ]

t_open_tag_with_echo   [line 64]

void t_open_tag_with_echo( $sTag)


Parameters:

   $sTag   — 

[ Top ]

t_semi_colon   [line 83]

void t_semi_colon( $sTag)


Parameters:

   $sTag   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:37:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.