Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7456317
TypePart.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
990 B
Referenced Files
None
Subscribers
None
TypePart.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Phan\Language
;
/**
* A part of a type extracted from phpdoc
* @phan-pure
*/
class
TypePart
{
/** @var string the type string */
public
$type
;
/** @var string the separator before the type string */
public
$separator
;
public
function
__construct
(
string
$type
,
string
$separator
)
{
$this
->
type
=
$type
;
$this
->
separator
=
$separator
;
}
/**
* Combine a list of type parts into a new type part instance.
* @param non-empty-list<TypePart> $parts
*/
public
static
function
combine
(
array
$parts
):
TypePart
{
$result
=
null
;
$separator
=
''
;
foreach
(
$parts
as
$part
)
{
if
(
$result
===
null
)
{
$result
=
$part
->
type
;
$separator
=
$part
->
separator
;
continue
;
}
$result
.=
$part
->
separator
.
$part
->
type
;
}
return
new
TypePart
(
$result
,
$separator
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 00:26 (2 d, 12 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
14/c7/f54e4e59796c57a7522a09680e04
Default Alt Text
TypePart.php (990 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment