remove code duplication
Codingstyle fixes
Codingstyle fixes
Merge pull request #4 from mjrider/fixes

logic deduplication and coding style fixes
Adding php5.6 to the build matrix