/** * @param Options|array $options * * @return $this */ public function options($options) { if (!$options instanceof Options) { return parent::options($options); } $this->resetArgs(); if (file_exists($options->configDir . '/phpmetrics.yml')) { $this->option('config', realpath($options->configDir . '/phpmetrics.yml')); } if (!empty($options->suffices)) { $this->option('extensions', '"' . implode('|', array_map(function ($v) { return ltrim($v, '.'); }, $options->suffices)) . '"'); } if (!empty($options->ignore)) { $this->option('excluded-dirs', '"' . implode('|', $options->ignore) . '"'); } if ($options->isSavedToFiles) { $this->option('report-xml', $options->logDir . '/metrics.xml'); $this->option('report-html', $options->logDir . '/metrics.html'); $this->option('chart-bubbles', $options->logDir . '/bubble-chart.svg'); } else { $this->option('report-cli', ''); } $this->arg(implode(' ', $options->source)); return $this; }
/** * @param Options|array $options * * @return $this */ public function options($options) { if (!$options instanceof Options) { return parent::options($options); } $this->resetArgs(); if (file_exists($options->logDir . '/clover.xml')) { $this->option('coverage-report', $options->logDir . '/clover.xml'); } if (file_exists($options->configDir . '/pdepend.xml')) { $this->option('configuration', realpath($options->configDir . '/pdepend.xml')); } if (!empty($options->suffices)) { $this->option('suffix', implode(',', array_map(function ($v) { return ltrim($v, '.'); }, $options->suffices))); } if (!empty($options->ignore)) { $this->option('ignore', implode(',', $options->ignore)); } if ($options->isSavedToFiles) { $this->option('dependency-xml', $options->logDir . '/dependency.xml'); $this->option('jdepend-chart', $options->logDir . '/jdepend.svg'); $this->option('jdepend-xml', $options->logDir . '/jdepend.xml'); $this->option('overview-pyramid', $options->logDir . '/pyramid.svg'); $this->option('summary-xml', $options->logDir . '/summary.xml'); } $this->arg(implode(',', $options->source)); return $this; }
/** * @param Options|array $options * * @return $this */ public function options($options) { if (!$options instanceof Options) { return parent::options($options); } $this->resetArgs(); if (!empty($options->suffices)) { $this->option('names', '"*' . implode(',*', $options->suffices) . '"'); } if (!empty($options->ignore)) { $this->addExclusions($options); } if ($options->isSavedToFiles) { $this->option($this->logOption, $options->logDir . '/' . $this->logFile); } $this->arg(implode(' ', $options->source)); return $this; }
/** * @param Options|array $options * * @return $this */ public function options($options) { if (!$options instanceof Options) { return parent::options($options); } $this->resetArgs()->arg(implode(',', $options->source))->arg($options->isSavedToFiles ? 'xml' : 'text'); if (file_exists($options->configDir . '/phpmd.xml')) { $this->arg($options->configDir . '/phpmd.xml'); } else { $this->arg('cleancode,codesize,controversial,design,naming,unusedcode'); } if ($options->isSavedToFiles) { $this->option('reportfile', $options->logDir . '/phpmd.xml'); } if (!empty($options->suffices)) { $this->option('suffixes', implode(',', $options->suffices)); } if (!empty($options->ignore)) { $this->option('exclude', implode(',', $options->ignore)); } return $this; }
/** * @param Options|array $options * * @return $this */ public function options($options) { if (!$options instanceof Options) { return parent::options($options); } $this->resetArgs(); $this->option('standard', Configuration::get('codestyle.standard')); if (!empty($options->suffices)) { $this->option('extensions', implode(',', array_map(function ($v) { return ltrim($v, '.'); }, $options->suffices))); } if (!empty($options->ignore)) { $this->option('ignore', implode(',', $options->ignore)); } if ($options->isSavedToFiles) { $this->option('report', 'checkstyle'); $this->option('report-file', $options->logDir . '/checkstyle.xml'); } else { $this->option('report', 'full'); } $this->arg(implode(' ', $options->source)); return $this; }