code format and added tests

Hello,

I formated the code to fix the indent, added some DocBlocks and unit tests. I also added more php versions to the config for travis, added a config for scrutinizer.