You can use several installation methods.
See the official documentation.
You can execute phpmd
by CLI and link this rule set with it.
See the official documentation for examples.
Follow the following instructions to automate the executation as an IDE feature.
See the documentation.
See the documentation.
Use this good plugin.
See the documentation.