nanoninja / docker-nginx-php-mysql

Docker running Nginx, PHP-FPM, MySQL & PHPMyAdmin
1.76k stars 867 forks source link

Add PHPMD Support #22

Closed zanematthew closed 6 years ago

zanematthew commented 6 years ago

This can be a controversial request, since I know that some (most) PHP developers (still) love to;

  1. Bloat their code with a ton of nested foreach if/elseif/elseif/else foreach if/else statements
  2. Use underscores in method names
  3. Debate on the bracket issue

Personally I use PHPMD and do like (enjoy) it.

I've added support for this on my local branch, but have not submitted a pull request. Figured, I'd ask, and open a dialog first.

Steps to add support;

  1. Update the Makefile with; (note, this will scan all your files in app/src)

    phpmd:
    @docker-compose exec -T php \
        ./app/vendor/bin/phpmd \
        app/src/ \
        text \
        cleancode,codesize,controversial,design,naming,unusedcode
  2. Update composer with;

"phpmd/phpmd" : "@stable"
  1. Run the composer update.

  2. Use it with make phpmd.

nanoninja commented 6 years ago

Hi @zanematthew,

Sorry for my late, I have a lot of work right now.

I will look at your proposals and we will discuss them very soon if you wish.

zanematthew commented 6 years ago

@nanoninja no problem, understood. I'm currently using this as a base on a personal project and its going well.

nanoninja commented 6 years ago

Hi @zanematthew,

Thanks for your feedback.

I thought about it too and then I told myself that the choice belonged to the users. Also, I did not want the installation to be too long if I added more outbuildings.

I think that one can make an attempt at this and that doing clean code is more important than my previous considerations.

It is relevant to add phpmd to the project.