PHP 5.5 errors are no longer allowed on Travis CI
Refactored the code of all publishers.

First, some duplicated code have been removed. Second, some long
methods have been splitted into several smaller methods.

Thanks to Scrutinizer CI and SensioLabs Insight for discovering these errors.