Add phpmd and fix code smell