codeclimate / codeclimate-phpmd

Code Climate PHPMD Engine
MIT License
10 stars 12 forks source link

Supports string and array settings for file_extensions config #37

Closed chrishulton closed 7 years ago

chrishulton commented 7 years ago

Addresses error:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to 
  PHPMD\PHPMD::setFileExtensions() must be of the type array, null given

Our docs are inconsistent about how to specify this setting, ie:

engines:
  phpmd:
    enabled: true
    config:
      file_extensions: "php"

vs

engines:
  phpmd:
    enabled: true
    config:
      file_extensions: 
        - php
        - inc

We could just update the docs, but it is easy enough to support both. I did not add a spec for this, but I tested it out with a local repo.

In order to make this change, I had to update the Dockerfile to get the image building. I also decided to update the dependencies while in here, which required a fix to the Makefile.