Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/ArcanistAlias.php
| Show All 30 Lines | public static function newFromConfig($key, $value) { | ||||
| // ] | // ] | ||||
| // } | // } | ||||
| // | // | ||||
| // For now, we parse the older format and fill in the toolset as "arc". | // For now, we parse the older format and fill in the toolset as "arc". | ||||
| $is_list = false; | $is_list = false; | ||||
| $is_dict = false; | $is_dict = false; | ||||
| if ($value && is_array($value)) { | if ($value && is_array($value)) { | ||||
| if (array_keys($value) === range(0, count($value) - 1)) { | if (phutil_is_natural_list($value)) { | ||||
| $is_list = true; | $is_list = true; | ||||
| } else { | } else { | ||||
| $is_dict = true; | $is_dict = true; | ||||
| } | } | ||||
| } | } | ||||
| if ($is_list) { | if ($is_list) { | ||||
| $alias->trigger = $key; | $alias->trigger = $key; | ||||
| ▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines | |||||