Fix some issue found thanks to phpspec, also fixed some CS