cleaned php code to follow psr2 standard