Made the entire thing FIG compliant

Mostly just docblocks and missing space after cast.
php-cs-fixer was very useful ;-)