Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100544662
DifferentialDoorkeeperRevisionFeedStoryPublisher.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, Jan 31, 14:50
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Feb 2, 14:50 (2 d)
Engine
blob
Format
Raw Data
Handle
23979720
Attached To
rPH Phabricator
DifferentialDoorkeeperRevisionFeedStoryPublisher.php
View Options
<?php
final
class
DifferentialDoorkeeperRevisionFeedStoryPublisher
extends
DoorkeeperFeedStoryPublisher
{
public
function
canPublishStory
(
PhabricatorFeedStory
$story
,
$object
)
{
return
(
$object
instanceof
DifferentialRevision
);
}
public
function
willPublishStory
(
$object
)
{
return
id
(
new
DifferentialRevisionQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withIDs
(
array
(
$object
->
getID
()))
->
needRelationships
(
true
)
->
executeOne
();
}
public
function
getOwnerPHID
(
$object
)
{
return
$object
->
getAuthorPHID
();
}
public
function
getActiveUserPHIDs
(
$object
)
{
$status
=
$object
->
getStatus
();
if
(
$status
==
ArcanistDifferentialRevisionStatus
::
NEEDS_REVIEW
)
{
return
$object
->
getReviewers
();
}
else
{
return
array
();
}
}
public
function
getPassiveUserPHIDs
(
$object
)
{
$status
=
$object
->
getStatus
();
if
(
$status
==
ArcanistDifferentialRevisionStatus
::
NEEDS_REVIEW
)
{
return
array
();
}
else
{
return
$object
->
getReviewers
();
}
}
public
function
getCCUserPHIDs
(
$object
)
{
return
$object
->
getCCPHIDs
();
}
public
function
getObjectTitle
(
$object
)
{
$prefix
=
$this
->
getTitlePrefix
(
$object
);
$lines
=
new
PhutilNumber
(
$object
->
getLineCount
());
$lines
=
pht
(
'[Request, %d lines]'
,
$lines
);
$id
=
$object
->
getID
();
$title
=
$object
->
getTitle
();
return
ltrim
(
"{$prefix} {$lines} D{$id}: {$title}"
);
}
public
function
getObjectURI
(
$object
)
{
return
PhabricatorEnv
::
getProductionURI
(
'/D'
.
$object
->
getID
());
}
public
function
getObjectDescription
(
$object
)
{
return
$object
->
getSummary
();
}
public
function
isObjectClosed
(
$object
)
{
switch
(
$object
->
getStatus
())
{
case
ArcanistDifferentialRevisionStatus
::
CLOSED
:
case
ArcanistDifferentialRevisionStatus
::
ABANDONED
:
return
true
;
default
:
return
false
;
}
}
public
function
getResponsibilityTitle
(
$object
)
{
$prefix
=
$this
->
getTitlePrefix
(
$object
);
return
pht
(
'%s Review Request'
,
$prefix
);
}
public
function
getStoryText
(
$object
)
{
$story
=
$this
->
getFeedStory
();
if
(
$story
instanceof
PhabricatorFeedStoryDifferential
)
{
$text
=
$story
->
renderForAsanaBridge
();
}
else
{
$text
=
$story
->
renderText
();
}
return
$text
;
}
private
function
getTitlePrefix
(
DifferentialRevision
$revision
)
{
$prefix_key
=
'metamta.differential.subject-prefix'
;
return
PhabricatorEnv
::
getEnvConfig
(
$prefix_key
);
}
}
Event Timeline
Log In to Comment