Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7436332
VariableDeclaration.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
VariableDeclaration.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 "var", "const" or "let" declaration.
* For example: var a = 1
*
* @author Marco Marchiò <marco.mm89@gmail.com>
*/
class
VariableDeclaration
extends
Node
implements
Declaration
{
/**
* Map of node properties
*
* @var array
*/
protected
$propertiesMap
=
array
(
"declarations"
=>
true
,
"kind"
=>
false
);
//Kind constants
/**
* "var" kind
*/
const
KIND_VAR
=
"var"
;
/**
* "let" kind
*/
const
KIND_LET
=
"let"
;
/**
* "const" kind
*/
const
KIND_CONST
=
"const"
;
/**
* Declarations array
*
* @var VariableDeclarator[]
*/
protected
$declarations
=
array
();
/**
* Declaration kind that is one of the kind constants
*
* @var string
*/
protected
$kind
=
self
::
KIND_VAR
;
/**
* Returns the declarations array
*
* @return VariableDeclarator[]
*/
public
function
getDeclarations
()
{
return
$this
->
declarations
;
}
/**
* Sets the declarations array
*
* @param VariableDeclarator[] $declarations Declarations array
*
* @return $this
*/
public
function
setDeclarations
(
$declarations
)
{
$this
->
assertArrayOf
(
$declarations
,
"VariableDeclarator"
);
$this
->
declarations
=
$declarations
;
return
$this
;
}
/**
* Returns the declaration kind that is one of the kind constants
*
* @return string
*/
public
function
getKind
()
{
return
$this
->
kind
;
}
/**
* Sets the declaration kind that is one of the kind constants
*
* @param string $kind Declaration kind
*
* @return $this
*/
public
function
setKind
(
$kind
)
{
$this
->
kind
=
$kind
;
return
$this
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 13:23 (3 h, 1 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e8/45/0071ca281898576d221abc02d448
Default Alt Text
VariableDeclaration.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment