Fixed factory and composer php 5.4

Fixed bug on the new factory and added requirement for php 5.4 in
composer
Revert "Fixed factory and composer php 5.4"

This reverts commit b797a9a6f9a42f34f13c681379a20a1d46a2eaba.
Fixed unify factory and requirement for php in Composer