Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/patch/PhabricatorSQLPatchList.php
Show First 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | foreach ($lines as $line) { | ||||
if (preg_match('(^\s*//\s*@(\S+)(?:\s+(.*))?\z)', $line, $matches)) { | if (preg_match('(^\s*//\s*@(\S+)(?:\s+(.*))?\z)', $line, $matches)) { | ||||
$attr_key = $matches[1]; | $attr_key = $matches[1]; | ||||
$attr_value = trim(idx($matches, 2)); | $attr_value = trim(idx($matches, 2)); | ||||
switch ($attr_key) { | switch ($attr_key) { | ||||
case 'phase': | case 'phase': | ||||
$phase_name = $attr_value; | $phase_name = $attr_value; | ||||
if (!strlen($phase_name)) { | if (!phutil_nonempty_string($phase_name)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Storage patch "%s" specifies a "@phase" attribute with '. | 'Storage patch "%s" specifies a "@phase" attribute with '. | ||||
'no phase value. Phase attributes must specify a value, '. | 'no phase value. Phase attributes must specify a value, '. | ||||
'like "@phase default".', | 'like "@phase default".', | ||||
$patch_name)); | $patch_name)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0