PHP Class Jyxo\Gettext\Parser

Author: Matěj Humpál
Inheritance: implements Iterator, implements Countable
Afficher le fichier Open project: jyxo/php

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
parse ( string $file ) The actual parser.

Method Details

__call() public méthode

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
Résultat mixed Value of variable or \Jyxo\Gettext\Parser

__construct() public méthode

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

count() public méthode

{@link \Countable} interface method
public count ( ) : integer
Résultat integer

current() public méthode

{@link \ArrayIterator} interface method.
public current ( ) : mixed
Résultat mixed

key() public méthode

{@link \ArrayIterator} interface method.
public key ( ) : mixed
Résultat mixed

next() public méthode

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

parse() protected méthode

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 méthode

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

valid() public méthode

{@link \ArrayIterator} interface method.
public valid ( ) : boolean
Résultat boolean

Property Details

$current protected_oe property

Internal pointer to the fragments array.
protected int $current
Résultat integer

$file protected_oe property

Path to the parsed PO file.
protected string $file
Résultat string

$header protected_oe property

PO file header (copyright and other information).
protected string $header
Résultat string

$headerClass protected_oe property

Useful for subclassing.
protected string $headerClass
Résultat string

$itemClass protected_oe property

Useful for subclassing.
protected string $itemClass
Résultat string

$items protected_oe property

Fragments parsed from the PO file.
protected $items