Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102524945
ConduitAPI_macro_creatememe_Method.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, Feb 21, 15:41
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 23, 15:41 (2 d)
Engine
blob
Format
Raw Data
Handle
24342205
Attached To
rPH Phabricator
ConduitAPI_macro_creatememe_Method.php
View Options
<?php
/**
* @group conduit
*/
final
class
ConduitAPI_macro_creatememe_Method
extends
ConduitAPI_macro_Method
{
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_UNSTABLE
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Generate a meme.'
);
}
public
function
defineParamTypes
()
{
return
array
(
'macroName'
=>
'string'
,
'upperText'
=>
'optional string'
,
'lowerText'
=>
'optional string'
,
);
}
public
function
defineReturnType
()
{
return
'string'
;
}
public
function
defineErrorTypes
()
{
return
array
(
'ERR-NOT-FOUND'
=>
'Macro was not found.'
,
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$user
=
$request
->
getUser
();
$macro_name
=
$request
->
getValue
(
'macroName'
);
$upper_text
=
$request
->
getValue
(
'upperText'
);
$lower_text
=
$request
->
getValue
(
'lowerText'
);
$uri
=
PhabricatorMacroMemeController
::
generateMacro
(
$user
,
$macro_name
,
$upper_text
,
$lower_text
);
if
(!
$uri
)
{
throw
new
ConduitException
(
'ERR-NOT-FOUND'
);
}
return
array
(
'uri'
=>
$uri
,
);
}
}
Event Timeline
Log In to Comment