Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7416883
ConstantGenerator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
858 B
Referenced Files
None
Subscribers
None
ConstantGenerator.php
View Options
<?php
namespace
Eris\Generator
;
use
Eris\Generator
;
use
Eris\Generators
;
use
Eris\Random\RandomRange
;
/**
* @param mixed $value the only value to generate
* @return ConstantGenerator
*/
function
constant
(
$value
)
{
return
Generators
::
constant
(
$value
);
}
/**
* @psalm-template T
* @template-implements Generator<T>
*/
class
ConstantGenerator
implements
Generator
{
private
$value
;
public
static
function
box
(
$value
)
{
return
new
self
(
$value
);
}
public
function
__construct
(
$value
)
{
$this
->
value
=
$value
;
}
public
function
__invoke
(
$_size
,
RandomRange
$rand
)
{
return
GeneratedValueSingle
::
fromJustValue
(
$this
->
value
,
'constant'
);
}
public
function
shrink
(
GeneratedValue
$element
)
{
return
GeneratedValueSingle
::
fromJustValue
(
$this
->
value
,
'constant'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 03:01 (1 d, 10 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8d/da/b260b6b498e5a1e3ffb73b977bb6
Default Alt Text
ConstantGenerator.php (858 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment