Replace parameters by class attributes.

Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
Minor style modifications.
PHPDoc update.
Reduce nested levels.

Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>