Added phpdoc and fixed code style [skip CI]