PHP Class JoliTypo\Fixer

Mostrar archivo Open project: jolicode/jolitypo Class Usage Examples

Protected Properties

Property Type Description
$_rules
$locale The default locale (used by some Fixer)
$protectedTags HTML Tags to bypass
$stateBag StateBag

Public Methods

Method Description
__construct ( array $rules )
fix ( string $content ) : string
fixString ( string $content ) : string
getLanguageFromLocale ( $locale ) : string Get language part of a Locale string (fr_FR => fr).
getLocale ( ) : string Get the current Locale tag.
setLocale ( string $locale ) Change the locale of the Fixer.
setProtectedTags ( array $protectedTags ) Customize the list of protected tags.
setRules ( array $rules ) Change the list of rules for a given locale.

Private Methods

Method Description
compileRules ( $rules ) Build the _rules array of Fixer.
doFix ( DOMText $childNode, DOMNode $node, DOMDocument $dom ) Run the Fixers on a DOMText content.
exportDOMDocument ( DOMDocument $dom ) : string
fixContentEncoding ( $content ) : string Convert the content encoding properly and add Content-Type meta if HTML document.
loadDOMDocument ( $content ) : DOMDocument
processDOM ( DOMNode $node, DOMDocument $dom ) Loop over all the DOMNode recursively.

Method Details

__construct() public method

public __construct ( array $rules )
$rules array Array of Fixer

fix() public method

public fix ( string $content ) : string
$content string HTML content to fix
return string Fixed content

fixString() public method

public fixString ( string $content ) : string
$content string Basic content to fix
return string

getLanguageFromLocale() public static method

Get language part of a Locale string (fr_FR => fr).
public static getLanguageFromLocale ( $locale ) : string
$locale
return string

getLocale() public method

Get the current Locale tag.
public getLocale ( ) : string
return string

setLocale() public method

Change the locale of the Fixer.
public setLocale ( string $locale )
$locale string An IETF language tag

setProtectedTags() public method

Customize the list of protected tags.
public setProtectedTags ( array $protectedTags )
$protectedTags array

setRules() public method

Change the list of rules for a given locale.
public setRules ( array $rules )
$rules array Array of Fixer

Property Details

$_rules protected_oe property

protected $_rules

$locale protected_oe property

The default locale (used by some Fixer)
protected $locale

$protectedTags protected_oe property

HTML Tags to bypass
protected $protectedTags

$stateBag protected_oe property

protected StateBag,jolitypo $stateBag
return StateBag