public function setCommandLineValues($args)
{
if (defined('PHP_CODESNIFFER_IN_TESTS') === true) {
$this->values = array('stdin' => null, 'quiet' => true);
} else {
if (empty($this->values) === true) {
$this->values = $this->getDefaults();
}
}
$this->_cliArgs = $args;
$numArgs = count($args);
for ($i = 0; $i < $numArgs; $i++) {
$arg = $this->_cliArgs[$i];
if ($arg === '') {
continue;
}
if ($arg[0] === '-') {
if ($arg === '-' || $arg === '--') {
// Empty argument, ignore it.
continue;
}
if ($arg[1] === '-') {
$this->processLongArgument(substr($arg, 2), $i);
} else {
$switches = str_split($arg);
foreach ($switches as $switch) {
if ($switch === '-') {
continue;
}
$this->processShortArgument($switch, $i);
}
}
} else {
$this->processUnknownArgument($arg, $i);
}
//end if
}
//end for
}