Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/ImportExpression.php

raw
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 an import expression (dynamic import).
14 *
15 * @author Marco Marchiò <[email protected]>
16 */
17 class ImportExpression extends Node implements Expression
18 {
19 /**
20 * Map of node properties
21 *
22 * @var array
23 */
24 protected $propertiesMap = array(
25 "source" => true,
26 "options" => true
27 );
28
29 /**
30 * The import source
31 *
32 * @var Expression
33 */
34 protected $source;
35
36 /**
37 * Optional import options
38 *
39 * @var Expression|null
40 */
41 protected $options;
42
43 /**
44 * Returns the import source
45 *
46 * @return Expression
47 */
48 public function getSource()
49 {
50 return $this->source;
51 }
52
53 /**
54 * Sets the import source
55 *
56 * @param Expression $source Import source
57 *
58 * @return $this
59 */
60 public function setSource(Expression $source)
61 {
62 $this->source = $source;
63 return $this;
64 }
65
66 /**
67 * Returns the import options
68 *
69 * @return Expression|null
70 */
71 public function getOptions()
72 {
73 return $this->options;
74 }
75
76 /**
77 * Sets the import options
78 *
79 * @param Expression|null $options Import options
80 *
81 * @return $this
82 */
83 public function setOptions($options)
84 {
85 $this->assertType($options, "Expression", true);
86 $this->options = $options;
87 return $this;
88 }
89 }