PHP Class Jyxo\Gettext\Parser

Author: Matěj Humpál
Inheritance: implements Iterator, implements Countable
Datei anzeigen Open project: jyxo/php

Protected Properties

Property Type Description
$current integer Internal pointer to the fragments array.
$file string Path to the parsed PO file.
$header string PO file header (copyright and other information).
$headerClass string Useful for subclassing.
$itemClass string Useful for subclassing.
$items Fragments parsed from the PO file.

Public Methods

Method Description
__call ( string $name, array $args ) : mixed Method overloading.
__construct ( string $file ) Constructor.
count ( ) : integer {@link \Countable} interface method
current ( ) : mixed {@link \ArrayIterator} interface method.
key ( ) : mixed {@link \ArrayIterator} interface method.
next ( ) {@link \ArrayIterator} interface method.
rewind ( ) {@link \ArrayIterator} interface method.
valid ( ) : boolean {@link \ArrayIterator} interface method.

Protected Methods

Method Description
parse ( string $file ) The actual parser.

Method Details

__call() public method

Makes getProperty methods available for retrieving property values Makes setProperty methods available for setting property values
public __call ( string $name, array $args ) : mixed
$name string Method name
$args array Method parameters
return mixed Value of variable or \Jyxo\Gettext\Parser

__construct() public method

Loads and parses the given file.
public __construct ( string $file )
$file string Path to the PO file.

count() public method

{@link \Countable} interface method
public count ( ) : integer
return integer

current() public method

{@link \ArrayIterator} interface method.
public current ( ) : mixed
return mixed

key() public method

{@link \ArrayIterator} interface method.
public key ( ) : mixed
return mixed

next() public method

{@link \ArrayIterator} interface method.
public next ( )

parse() protected method

Walks through the file, splits it on empty lines and tries to parse each fragment using the defined parser class ({@link \Jyxo\Gettext\Parser\Item} by default). Does not work with the file header.
See also: Jyxo\Gettext\Parser::$items
See also: Jyxo\Gettext\Parser\Item
protected parse ( string $file )
$file string Path to the PO file

rewind() public method

{@link \ArrayIterator} interface method.
public rewind ( )

valid() public method

{@link \ArrayIterator} interface method.
public valid ( ) : boolean
return boolean

Property Details

$current protected_oe property

Internal pointer to the fragments array.
protected int $current
return integer

$file protected_oe property

Path to the parsed PO file.
protected string $file
return string

$header protected_oe property

PO file header (copyright and other information).
protected string $header
return string

$headerClass protected_oe property

Useful for subclassing.
protected string $headerClass
return string

$itemClass protected_oe property

Useful for subclassing.
protected string $itemClass
return string

$items protected_oe property

Fragments parsed from the PO file.
protected $items