mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 08:12:40 +01:00
0a62f13464
Summary: Ran `arc lint --apply-patches --everything` over rP, mainly to change double quotes to single quotes where appropriate. These changes also validate that the `ArcanistXHPASTLinter::LINT_DOUBLE_QUOTE` rule is working as expected. Test Plan: Eyeballed it. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin, hach-que Differential Revision: https://secure.phabricator.com/D9431
27 lines
553 B
PHP
27 lines
553 B
PHP
<?php
|
|
|
|
final class PhabricatorPHID {
|
|
|
|
protected $phid;
|
|
protected $phidType;
|
|
protected $ownerPHID;
|
|
protected $parentPHID;
|
|
|
|
public static function generateNewPHID($type, $subtype = null) {
|
|
if (!$type) {
|
|
throw new Exception('Can not generate PHID with no type.');
|
|
}
|
|
|
|
if ($subtype === null) {
|
|
$uniq_len = 20;
|
|
$type_str = "{$type}";
|
|
} else {
|
|
$uniq_len = 15;
|
|
$type_str = "{$type}-{$subtype}";
|
|
}
|
|
|
|
$uniq = Filesystem::readRandomCharacters($uniq_len);
|
|
return "PHID-{$type_str}-{$uniq}";
|
|
}
|
|
|
|
}
|