Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3295274
PhabricatorOwnersPackageNameTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorOwnersPackageNameTransaction.php
View Options
<?php
final
class
PhabricatorOwnersPackageNameTransaction
extends
PhabricatorOwnersPackageTransactionType
{
const
TRANSACTIONTYPE
=
'owners.name'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getName
(
)
;
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
(
)
;
$missing
=
$this
->
isEmptyTextTransaction
(
$object
->
getName
(
)
,
$xactions
)
;
if
(
$missing
)
{
$errors
[
]
=
$this
->
newRequiredError
(
pht
(
'Package name is required.'
)
,
nonempty
(
last
(
$xactions
)
,
null
)
)
;
}
foreach
(
$xactions
as
$xaction
)
{
$new
=
$xaction
->
getNewValue
(
)
;
if
(
preg_match
(
'([,!])'
,
$new
)
)
{
$errors
[
]
=
$this
->
newInvalidError
(
pht
(
'Package names may not contain commas (",") or exclamation '
.
'marks ("!"). These characters are ambiguous when package '
.
'names are parsed from the command line.'
)
,
$xaction
)
;
}
}
return
$errors
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setName
(
$value
)
;
}
public
function
getTitle
(
)
{
return
pht
(
'%s renamed this package from %s to %s.'
,
$this
->
renderAuthor
(
)
,
$this
->
renderOldValue
(
)
,
$this
->
renderNewValue
(
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Mar 27, 01:39 (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1204559
Default Alt Text
PhabricatorOwnersPackageNameTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment