Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4108580
ParseErrorException.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
ParseErrorException.php
View Options
<?php
/*
* This file is part of Psy Shell.
*
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Psy\Exception
;
/**
* A "parse error" Exception for Psy.
*/
class
ParseErrorException
extends
\PhpParser\Error
implements
Exception
{
/**
* Constructor!
*
* @param string $message (default: '')
* @param array|int $attributes Attributes of node/token where error occurred
* (or start line of error -- deprecated)
*/
public
function
__construct
(
string
$message
=
''
,
$attributes
=
[])
{
$message
=
\sprintf
(
'PHP Parse error: %s'
,
$message
);
if
(!
\is_array
(
$attributes
))
{
$attributes
=
[
'startLine'
=>
$attributes
];
}
parent
::
__construct
(
$message
,
$attributes
);
}
/**
* Create a ParseErrorException from a PhpParser Error.
*
* @param \PhpParser\Error $e
*/
public
static
function
fromParseError
(
\PhpParser\Error
$e
):
self
{
return
new
self
(
$e
->
getRawMessage
(),
$e
->
getAttributes
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 20:38 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ab/5a/51e748f2a7a5668992ea4dd16ca1
Default Alt Text
ParseErrorException.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment