Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7435690
SwitchStatement.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
SwitchStatement.php
View Options
<?php
/**
* This file is part of the Peast package
*
* (c) Marco Marchiò <marco.mm89@gmail.com>
*
* For the full copyright and license information refer to the LICENSE file
* distributed with this source code
*/
namespace
Peast\Syntax\Node
;
/**
* A node that represents a switch statement.
* For example: switch (test) {}
*
* @author Marco Marchiò <marco.mm89@gmail.com>
*/
class
SwitchStatement
extends
Node
implements
Statement
{
/**
* Map of node properties
*
* @var array
*/
protected
$propertiesMap
=
array
(
"discriminant"
=>
true
,
"cases"
=>
true
);
/**
* Discriminant expression
*
* @var Expression
*/
protected
$discriminant
;
/**
* Cases array
*
* @var SwitchCase[]
*/
protected
$cases
=
array
();
/**
* Returns the discriminant expression
*
* @return Expression
*/
public
function
getDiscriminant
()
{
return
$this
->
discriminant
;
}
/**
* Sets the discriminant expression
*
* @param Expression $discriminant Discriminant expression
*
* @return $this
*/
public
function
setDiscriminant
(
Expression
$discriminant
)
{
$this
->
discriminant
=
$discriminant
;
return
$this
;
}
/**
* Returns the cases array
*
* @return SwitchCase[]
*/
public
function
getCases
()
{
return
$this
->
cases
;
}
/**
* Sets the cases array
*
* @param SwitchCase[] $cases Cases array
*
* @return $this
*/
public
function
setCases
(
$cases
)
{
$this
->
assertArrayOf
(
$cases
,
"SwitchCase"
);
$this
->
cases
=
$cases
;
return
$this
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 13:02 (49 m, 16 s ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0e/a5/538b23f5d5dfa273e8d799d9f095
Default Alt Text
SwitchStatement.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment