Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F76571601
PhabricatorIntConfigType.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
Thu, Aug 8, 22:19
Size
756 B
Mime Type
text/x-php
Expires
Sat, Aug 10, 22:19 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19735028
Attached To
rPH Phabricator
PhabricatorIntConfigType.php
View Options
<?php
final
class
PhabricatorIntConfigType
extends
PhabricatorTextConfigType
{
const
TYPEKEY
=
'int'
;
protected
function
newCanonicalValue
(
PhabricatorConfigOption
$option
,
$value
)
{
if
(!
preg_match
(
'/^-?[0-9]+
\z
/'
,
$value
))
{
throw
$this
->
newException
(
pht
(
'Value for option "%s" must be an integer.'
,
$option
->
getKey
()));
}
return
(
int
)
$value
;
}
public
function
validateStoredValue
(
PhabricatorConfigOption
$option
,
$value
)
{
if
(!
is_int
(
$value
))
{
throw
$this
->
newException
(
pht
(
'Option "%s" is of type "%s", but the configured value is not '
.
'an integer.'
,
$option
->
getKey
(),
$this
->
getTypeKey
()));
}
}
}
Event Timeline
Log In to Comment