PSR-2 code style

This commit adapts the code style according to the recommendations of
[PSR-2](http://www.php-fig.org/psr/psr-2/) and adds PHPDoc annotations for documentation purposes.
Yes, of course.