for ($f = false, $p = 0, $i = 0; $i < $argc; ++$i) {
$o = $argv[$i];
- if ($o{0} === "-" && strlen($o) > 2 && $o{1} !== "-") {
+ if ($o[0] === "-" && strlen($o) > 2 && $o[1] !== "-") {
// multiple short opts, e.g. -vps
$argc += strlen($o) - 2;
array_splice($argv, $i, 1, array_map(function($s) {
return "-$s";
}, str_split(substr($o, 1))));
$o = $argv[$i];
- } elseif ($o{0} === "-" && strlen($o) > 2 && $o{1} === "-" && 0 < ($eq = strpos($o, "="))) {
+ } elseif ($o[0] === "-" && strlen($o) > 2 && $o[1] === "-" && 0 < ($eq = strpos($o, "="))) {
// long opt with argument, e.g. --foo=bar
$argc++;
array_splice($argv, $i, 1, [
}
if ($f || !isset($this->spec[$o])) {
- if ($o{0} !== "-" && isset($this->spec["--$p"])) {
+ if ($o[0] !== "-" && isset($this->spec["--$p"])) {
$this[$p] = $o;
if (!$this->optIsMulti($p)) {
++$p;
if (is_numeric($o)) {
return "--$o";
}
- if ($o{0} !== '-') {
+ if ($o[0] !== '-') {
if (strlen($o) > 1) {
$o = "-$o";
}
$sudo = isset($this->args->sudo) ? $this->args->sudo : null;
$type = $this->metadata("type") ?: "extension";
- $activate = new Task\Activate($temp, $files, $type, $this->args->prefix, $this->args{"common-name"}, $sudo);
+ $activate = new Task\Activate($temp, $files, $type, $this->args->prefix, $this->args["common-name"], $sudo);
if (!$activate->run($this->verbosity())) {
$this->info("Extension already activated ...\n");
}
$pattern = "";
$length = strlen($upper);
for ($i = 0; $i < $length; ++$i) {
- if ($lower{$i} === $upper{$i}) {
- $pattern .= $upper{$i};
+ if ($lower[$i] === $upper[$i]) {
+ $pattern .= $upper[$i];
} else {
- $pattern .= "[" . $upper{$i} . $lower{$i} . "]";
+ $pattern .= "[" . $upper[$i] . $lower[$i] . "]";
}
}
return $pattern;