PHPMD\TextUI\CommandLineOptions::usage PHP Method

usage() public method

Returns usage information for the PHPMD command line interface.
public usage ( ) : string
return string
    public function usage()
    {
        return 'Mandatory arguments:' . \PHP_EOL . '1) A php source code filename or directory. Can be a comma-' . 'separated string' . \PHP_EOL . '2) A report format' . \PHP_EOL . '3) A ruleset filename or a comma-separated string of ruleset' . 'filenames' . \PHP_EOL . \PHP_EOL . 'Available formats: xml, text, html.' . \PHP_EOL . 'Available rulesets: ' . implode(', ', $this->availableRuleSets) . '.' . \PHP_EOL . \PHP_EOL . 'Optional arguments that may be put after the mandatory arguments:' . \PHP_EOL . '--minimumpriority: rule priority threshold; rules with lower ' . 'priority than this will not be used' . \PHP_EOL . '--reportfile: send report output to a file; default to STDOUT' . \PHP_EOL . '--suffixes: comma-separated string of valid source code ' . 'filename extensions, e.g. php,phtml' . \PHP_EOL . '--exclude: comma-separated string of patterns that are used to ' . 'ignore directories' . \PHP_EOL . '--strict: also report those nodes with a @SuppressWarnings ' . 'annotation' . \PHP_EOL . '--ignore-violations-on-exit: will exit with a zero code, ' . 'even if any violations are found' . \PHP_EOL;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * testCliUsageContainsStrictOption
  *
  * @return void
  */
 public function testCliUsageContainsStrictOption()
 {
     $args = array(__FILE__, __FILE__, 'text', 'codesize');
     $opts = new CommandLineOptions($args);
     $this->assertContains('--strict:', $opts->usage());
 }