Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistInspectWorkflow.php
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (!$objects) { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| $all_refs = array(); | $all_refs = array(); | ||||
| $ref_lists = array(); | $ref_lists = array(); | ||||
| foreach ($objects as $description) { | foreach ($objects as $description) { | ||||
| $matches = null; | $matches = null; | ||||
| if (!preg_match('/^(\w+)(?:\(([^)]+)\))?\z/', $description, $matches)) { | $pattern = '/^([\w-]+)(?:\(([^)]+)\))?\z/'; | ||||
| if (!preg_match($pattern, $description, $matches)) { | |||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'Object specification "%s" is unknown, expected a specification '. | 'Object specification "%s" is unknown, expected a specification '. | ||||
| 'like "commit(HEAD)".')); | 'like "commit(HEAD)".', | ||||
| $description)); | |||||
| } | } | ||||
| $function = $matches[1]; | $function = $matches[1]; | ||||
| if (!isset($inspectors[$function])) { | if (!isset($inspectors[$function])) { | ||||
| ksort($inspectors); | ksort($inspectors); | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| ▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | private function describeHardpoint( | ||||
| $children = array(); | $children = array(); | ||||
| $values = array(); | $values = array(); | ||||
| $hardpoint_key = $hardpoint->getHardpointKey(); | $hardpoint_key = $hardpoint->getHardpointKey(); | ||||
| if ($ref->hasAttachedHardpoint($hardpoint_key)) { | if ($ref->hasAttachedHardpoint($hardpoint_key)) { | ||||
| $mode = '*'; | $mode = '*'; | ||||
| $value = $ref->getHardpoint($hardpoint_key); | $value = $ref->getHardpoint($hardpoint_key); | ||||
| if ($value instanceof ArcanistRefPro) { | if ($value instanceof ArcanistRefPro) { | ||||
| $children[] = $value; | $children[] = $value; | ||||
| } else if (is_array($value)) { | |||||
| foreach ($value as $key => $child) { | |||||
| if ($child instanceof ArcanistRefPro) { | |||||
| $children[] = $child; | |||||
| } else { | |||||
| $values[] = $value; | |||||
| } | |||||
| } | |||||
| } else { | } else { | ||||
| $values[] = $value; | $values[] = $value; | ||||
| } | } | ||||
| } else { | } else { | ||||
| $mode = 'o'; | $mode = 'o'; | ||||
| } | } | ||||
| $out = array(); | $out = array(); | ||||
| $out[] = tsprintf( | $out[] = tsprintf( | ||||
| "%s%s [%s] %s\n", | "%s%s [%s] %s\n", | ||||
| $indent, | $indent, | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||