soy-php/phpmd-task

PHPMD task for Soy

0.2.0 2015-11-20 17:29 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:45:27 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Introduction

This is a PHP Mess Detector task for Soy

Usage

Include soy-php/phpmd-task in your project with composer:

$ composer require soy-php/phpmd-task

Then in your recipe you can use the task as follows:

<?php

$recipe = new \Soy\Recipe();

$recipe->component('default', function (\Soy\PhpMessDetector\RunTask $messDetectorTask) {
    $messDetectorTask
        ->setBinary('phpmd')
        ->addTarget('.')
        ->setVerbose(true)
        ->setThrowExceptionOnError(false)
        ->addExcludePattern('vendor/')
        ->addSuffix('php')
        ->setReport(\Soy\PhpMessDetector\RunTask::REPORT_XML)
        ->setStrict(true)
        ->run();
});

return $recipe;