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

Class: PHP_Beautifier_Filter

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

Class Overview


PHP_Beautifier_Filter


Author(s):

Version:

  • Release: 0.1.15

Copyright:

  • 2004-2006 Claudio Bustos

Variables

Methods


Child classes:

PHP_Beautifier_Filter_ListClassFunction
Create a list of functions and classes in the script By default, this Filter puts the list at the beggining of the script.
PHP_Beautifier_Filter_Default
Default Filter: Handle all the tokens. Uses K & R style
PHP_Beautifier_Filter_Lowercase
Lowercase: lowercase all control structures.
PHP_Beautifier_Filter_NewLines
New Lines: Add new lines after o before specific contents The settings are 'before' and 'after'. As value, use a colon separated list of contents or tokens
PHP_Beautifier_Filter_DocBlock
Filter Doc Blocks: Use DocBlockGenerator for beautify the phpdoc comments.
PHP_Beautifier_Filter_ArrayNested
Filter Array Nested: Indent the array structures Ex.
PHP_Beautifier_Filter_IndentStyles
Filter Indent Styles: Indent the code in k&r, allman, gnu or whitesmiths
PHP_Beautifier_Filter_EqualsAlign
Filter EqualsAlign: Align the equals symbols in contiguous lines.
PHP_Beautifier_Filter_phpBB
Filter the code to make it compatible with phpBB Coding Standards
PHP_Beautifier_Filter_Pear
Filter the code to make it compatible with PEAR Coding Standards

Inherited Variables

Inherited Methods


Class Details

[line 38]
PHP_Beautifier_Filter

Definition for creation of Filters For concrete details, please see PHP_Beautifier_Filter_Default



[ Top ]


Class Variables

$aFilterTokenFunctions = array()

[line 49]

Associative array of functions to use when some token are found
  • Access: protected

Type:   array


[ Top ]

$aSettings = array()

[line 54]

Settings for the Filter
  • Access: protected

Type:   array


[ Top ]

$aSettingsDefinition = array()

[line 61]

Definition of the settings

Should be an associative array. The keys are the names of settings and the values are an array with the keys 'type' and '

  • Access: protected

Type:   array


[ Top ]

$aToken =  false

[line 80]

Current token
  • Access: protected

Type:   mixed


[ Top ]

$bOn =  true

[line 76]

Switch to 'turn' on and off the filter
  • Access: protected

Type:   bool


[ Top ]

$oBeaut =

[line 44]

Stores a reference to main PHP_Beautifier
  • Access: protected

Type:   PHP_Beautifier


[ Top ]

$sDescription =  'Filter for PHP_Beautifier'

[line 66]

Description of the Filter
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 92]

PHP_Beautifier_Filter __construct( PHP_Beautifier $oBeaut, [array $aSettings = array()])

Constructor If you need to overload this (for example, to create a definition for setting with addSettingDefinition() remember call the parent constructor.

  1.  parent::__construct($oBeaut$aSettings)

  • Access: public

Overridden in child classes as:

PHP_Beautifier_Filter_ListClassFunction::__construct()
PHP_Beautifier_Filter_Lowercase::__construct()
PHP_Beautifier_Filter_NewLines::__construct()
PHP_Beautifier_Filter_IndentStyles::__construct()
PHP_Beautifier_Filter_phpBB::__construct()

Parameters:

PHP_Beautifier   $oBeaut   — 
array   $aSettings   —  settings for the Filter

[ Top ]

addSettingDefinition   [line 103]

void addSettingDefinition( string $sSetting, $sType, $sDescription)

Add a setting definition
  • Access: protected

Parameters:

string   $sSetting   — 
   $sType   — 
   $sDescription   — 

[ Top ]

getDescription   [line 236]

void getDescription( )

  • Access: public

[ Top ]

getName   [line 113]

void getName( )

return @string
  • Access: public

[ Top ]

getSetting   [line 150]

mixed getSetting( string $sSetting)

Get a setting of the Filter
  • Return: value of setting or false
  • Access: public

Parameters:

string   $sSetting   —  name of setting

[ Top ]

handleToken   [line 177]

bool handleToken( array $token)

Function called from PHP_Beautifier::process() to process the tokens.

If the received token is one of the keys of $aFilterTokenFunctions a function with the same name of the value of that key is called. If the method doesn't exists, __call() is called, and return PHP_Beautifier_Filter::BYPASS. PHP_Beautifier, now, call the next Filter is its list. If the method exists, it can return true or PHP_Beautifier_Filter::BYPASS.


Parameters:

array   $token   —  token

[ Top ]

off   [line 141]

void off( )

Turn off the Filter Use inside the code to beautify Ex.

  1.  ...some code...
  2.  // ArrayNested->off()
  3.  ...other code ...

  • Access: public

Overridden in child classes as:

PHP_Beautifier_Filter_Default::off()

[ Top ]

on   [line 127]

void on( )

Turn on the Filter Use inside the code to beautify Ex.

  1.  ...some code...
  2.  // ArrayNested->on()
  3.  ...other code ...

  • Access: public

[ Top ]

postProcess   [line 227]

void postProcess( )

Called from PHP_Beautifier::process() at the end of processing

The post-process must be made in PHP_Beautifier::$aOut

  • Access: public

Overridden in child classes as:

PHP_Beautifier_Filter_ListClassFunction::postProcess()

[ Top ]

preProcess   [line 219]

void preProcess( )

Called from PHP_Beautifier::process() at the beginning

of the processing

  • Access: public

Overridden in child classes as:

PHP_Beautifier_Filter_phpBB::preProcess()
PHP_Beautifier_Filter_Pear::preProcess()

[ Top ]

setSetting   [line 159]

void setSetting( string $sSetting, mixed $sValue)

Set a value of a Setting
  • Access: public

Parameters:

string   $sSetting   —  name of setting
mixed   $sValue   —  value of setting

[ Top ]

__call   [line 210]

mixed __call( string $sMethod, array $aArgs)


Overridden in child classes as:

PHP_Beautifier_Filter_Default::__call()
PHP_Beautifier_Filter_Lowercase::__call()
PHP_Beautifier_Filter_NewLines::__call()
PHP_Beautifier_Filter_IndentStyles::__call()

Parameters:

string   $sMethod   —  metodo
array   $aArgs   —  arguments

[ Top ]

__sleep   [line 230]

void __sleep( )

  • Access: public

[ Top ]

__toString   [line 240]

void __toString( )

  • Access: public

[ Top ]


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