PHP code cleanup to meet quality standards