Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4106162
ParameterAssertionException.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ParameterAssertionException.php
View Options
<?php
namespace
Wikimedia\Assert
;
use
InvalidArgumentException
;
/**
* Exception indicating that an parameter assertion failed.
* This generally means a disagreement between the caller and the implementation of a function.
*
* @since 0.1.0
*
* @license MIT
* @author Daniel Kinzler
* @copyright Wikimedia Deutschland e.V.
*/
class
ParameterAssertionException
extends
InvalidArgumentException
implements
AssertionException
{
/**
* @var string
*/
private
$parameterName
;
/**
* @param string $parameterName
* @param string $description
*
* @throws ParameterTypeException
*/
public
function
__construct
(
$parameterName
,
$description
)
{
if
(
!
is_string
(
$parameterName
)
)
{
throw
new
ParameterTypeException
(
'parameterName'
,
'string'
);
}
if
(
!
is_string
(
$description
)
)
{
throw
new
ParameterTypeException
(
'description'
,
'string'
);
}
parent
::
__construct
(
"Bad value for parameter $parameterName: $description"
);
$this
->
parameterName
=
$parameterName
;
}
/**
* @return string
*/
public
function
getParameterName
():
string
{
return
$this
->
parameterName
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 19:20 (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ec/37/53dada5ef9857bf64f45c7af8eeb
Default Alt Text
ParameterAssertionException.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment