phpcs errors and warnings corrected