Refactor code to class
Miss to comment line
Fix for php 5.5 compability
Merge pull request #13 from Satariall/master

Now all be ok