Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1430724
DebugUnionType.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
DebugUnionType.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Phan\Debug
;
use
Phan\Language\Type
;
use
Phan\Language\UnionType
;
use
const
DEBUG_BACKTRACE_IGNORE_ARGS
;
/**
* Utility for debugging assignments to a given union type.
* This can be used when creating a union type to figure out the causes of unexpected error messages.
*
* Not used as part of normal phan operations.
* @phan-file-suppress PhanPluginRemoveDebugCall
* @suppress PhanUnreferencedClass
*/
class
DebugUnionType
extends
UnionType
{
/**
* Add a type name to the list of types
* @override
*/
public
function
withType
(
Type
$type
):
UnionType
{
\printf
(
"%s: Adding type %s to %s"
,
\spl_object_hash
(
$this
),
(
string
)
$type
,
(
string
)
$this
);
\debug_print_backtrace
(
DEBUG_BACKTRACE_IGNORE_ARGS
);
return
parent
::
withType
(
$type
);
}
/**
* Add the given types to this type
*/
public
function
withUnionType
(
UnionType
$union_type
):
UnionType
{
\printf
(
"%s: Adding union type %s to %s"
,
\spl_object_hash
(
$this
),
(
string
)
$union_type
,
(
string
)
$this
);
\debug_print_backtrace
(
DEBUG_BACKTRACE_IGNORE_ARGS
);
return
parent
::
withUnionType
(
$union_type
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 19:28 (4 h, 8 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d7/08/816e1351ab297f5536dc344c80bd
Default Alt Text
DebugUnionType.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment