Page MenuHomeWickedGov Phorge

UnionTypeNode.php
No OneTemporary

Size
659 B
Referenced Files
None
Subscribers
None

UnionTypeNode.php

<?php declare(strict_types = 1);
namespace PHPStan\PhpDocParser\Ast\Type;
use PHPStan\PhpDocParser\Ast\NodeAttributes;
use function array_map;
use function implode;
class UnionTypeNode implements TypeNode
{
use NodeAttributes;
/** @var TypeNode[] */
public array $types;
/**
* @param TypeNode[] $types
*/
public function __construct(array $types)
{
$this->types = $types;
}
public function __toString(): string
{
return '(' . implode(' | ', array_map(static function (TypeNode $type): string {
if ($type instanceof NullableTypeNode) {
return '(' . $type . ')';
}
return (string) $type;
}, $this->types)) . ')';
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 21:10 (1 d, 15 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
51/5a/f48afdc9833898fa19cdb692e0db
Default Alt Text
UnionTypeNode.php (659 B)

Event Timeline