__construct() public method

Constructs a PHP_CodeSniffer object.
See also: process()
public __construct ( integer $verbosity, integer $tabWidth, string $encoding = 'iso-8859-1', boolean $interactive = false )
$verbosity integer The verbosity level. 1: Print progress information. 2: Print tokenizer debug information. 3: Print sniff debug information.
$tabWidth integer The number of spaces each tab represents. If greater than zero, tabs will be replaced by spaces before testing each file.
$encoding string The charset of the sniffed files. This is important for some reports that output with utf-8 encoding as you don't want it double encoding messages.
$interactive boolean If TRUE, will stop after each file with errors and wait for user input.
Example #1
0
 public function __construct(Scisr_Db_Files $dbFiles, $verbosity = 0, $tabWidth = 0)
 {
     $this->_dbFiles = $dbFiles;
     // PHP_CodeSniffer messes up the cwd, so restore it after we construct
     $cwd = getcwd();
     parent::__construct($verbosity, $tabWidth);
     chdir($cwd);
     $this->setAllowedFileExtensions(array('php', 'inc', 'html'));
 }
 /**
  * Adapt CLI behaviour to framework
  * 
  * @return CMbCodeSniffer
  */
 function __construct()
 {
     $verbosity = 0;
     $tabwidth = 2;
     // Use for Apache MacOSX
     if (!isset($_SERVER["argc"])) {
         $_SERVER["argc"] = 0;
     }
     parent::__construct($verbosity, $tabwidth);
 }
Example #3
0
 public function __construct($verbosity = 0)
 {
     $this->cswSetStandard($this->cswDefaults['standard']);
     parent::__construct($verbosity);
 }