soy-php/phpmd-task

为Soy的PHPMD任务

0.2.0 2015-11-20 17:29 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:36:45 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

简介

这是一个针对 PHP Mess Detector 的任务,用于 Soy

使用方法

使用composer将soy-php/phpmd-task包含到您的项目中

$ composer require soy-php/phpmd-task

然后在您的recipe中,您可以如下使用任务

<?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;