Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95946049
HarbormasterBuildAutoplan.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Dec 20, 23:26
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 22, 23:26 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23085818
Attached To
rPH Phabricator
HarbormasterBuildAutoplan.php
View Options
<?php
abstract
class
HarbormasterBuildAutoplan
extends
Phobject
{
abstract
public
function
getAutoplanPlanKey
();
abstract
public
function
getAutoplanName
();
public
static
function
getAutoplan
(
$key
)
{
return
idx
(
self
::
getAllAutoplans
(),
$key
);
}
public
static
function
getAllAutoplans
()
{
static
$plans
;
if
(
$plans
===
null
)
{
$objects
=
id
(
new
PhutilSymbolLoader
())
->
setAncestorClass
(
__CLASS__
)
->
loadObjects
();
$map
=
array
();
foreach
(
$objects
as
$object
)
{
$key
=
$object
->
getAutoplanPlanKey
();
if
(!
empty
(
$map
[
$key
]))
{
$other
=
$map
[
$key
];
throw
new
Exception
(
pht
(
'Two build autoplans (of classes "%s" and "%s") define the same '
.
'key ("%s"). Each autoplan must have a unique key.'
,
get_class
(
$other
),
get_class
(
$object
),
$key
));
}
$map
[
$key
]
=
$object
;
}
ksort
(
$map
);
$plans
=
$map
;
}
return
$plans
;
}
}
Event Timeline
Log In to Comment