| 1 |
<?php |
| 2 |
/** |
| 3 |
* This file is part of the Peast package |
| 4 |
* |
| 5 |
* (c) Marco Marchiò <[email protected]> |
| 6 |
* |
| 7 |
* For the full copyright and license information refer to the LICENSE file |
| 8 |
* distributed with this source code |
| 9 |
*/ |
| 10 |
namespace Peast\Syntax\Node; |
| 11 |
|
| 12 |
/** |
| 13 |
* A node that represents the "continue" statement inside loops. |
| 14 |
* |
| 15 |
* @author Marco Marchiò <[email protected]> |
| 16 |
*/ |
| 17 |
class ContinueStatement extends Node implements Statement |
| 18 |
{ |
| 19 |
/** |
| 20 |
* Map of node properties |
| 21 |
* |
| 22 |
* @var array |
| 23 |
*/ |
| 24 |
protected $propertiesMap = array( |
| 25 |
"label" => true |
| 26 |
); |
| 27 |
|
| 28 |
/** |
| 29 |
* The optional label of the continue statement |
| 30 |
* |
| 31 |
* @var Identifier |
| 32 |
*/ |
| 33 |
protected $label; |
| 34 |
|
| 35 |
/** |
| 36 |
* Returns the node's label |
| 37 |
* |
| 38 |
* @return Identifier |
| 39 |
*/ |
| 40 |
public function getLabel() |
| 41 |
{ |
| 42 |
return $this->label; |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* Sets the node's label |
| 47 |
* |
| 48 |
* @param Identifier $label Node's label |
| 49 |
* |
| 50 |
* @return $this |
| 51 |
*/ |
| 52 |
public function setLabel($label) |
| 53 |
{ |
| 54 |
$this->assertType($label, "Identifier", true); |
| 55 |
$this->label = $label; |
| 56 |
return $this; |
| 57 |
} |
| 58 |
} |