Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5953146
RecipientSet.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
RecipientSet.php
View Options
<?php
namespace
MediaWiki\Notification
;
use
ArrayIterator
;
use
Countable
;
use
IteratorAggregate
;
use
MediaWiki\User\UserIdentity
;
use
Wikimedia\Assert\Assert
;
/**
* @since 1.44
* @unstable
*/
class
RecipientSet
implements
IteratorAggregate
,
Countable
{
/**
* @var UserIdentity[]
*/
private
array
$recipients
;
/**
* @param UserIdentity|UserIdentity[] $recipients
*/
public
function
__construct
(
$recipients
)
{
if
(
!
is_array
(
$recipients
)
)
{
$recipients
=
[
$recipients
];
}
Assert
::
parameterElementType
(
UserIdentity
::
class
,
$recipients
,
'$recipients'
);
$this
->
recipients
=
$recipients
;
}
/** @return UserIdentity[] */
public
function
getRecipients
():
array
{
return
$this
->
recipients
;
}
/**
* @param UserIdentity $identity
* @return void
*/
public
function
addRecipient
(
UserIdentity
$identity
)
{
$this
->
recipients
[]
=
$identity
;
}
public
function
getIterator
():
ArrayIterator
{
return
new
ArrayIterator
(
$this
->
recipients
);
}
public
function
count
():
int
{
return
count
(
$this
->
recipients
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 3 2026, 01:56 (4 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e4/86/ea4de652f2260bddafe7bd0ac4f9
Default Alt Text
RecipientSet.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment