Mercurial > hg > isophonics-drupal-site
comparison vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 5fb285c0d0e3 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 <?php declare(strict_types=1); | 1 <?php declare(strict_types=1); |
2 | 2 |
3 namespace PhpParser; | 3 namespace PhpParser; |
4 | |
5 use PhpParser\Node; | |
6 | 4 |
7 abstract class NodeAbstract implements Node, \JsonSerializable | 5 abstract class NodeAbstract implements Node, \JsonSerializable |
8 { | 6 { |
9 protected $attributes; | 7 protected $attributes; |
10 | 8 |
157 public function hasAttribute(string $key) : bool { | 155 public function hasAttribute(string $key) : bool { |
158 return array_key_exists($key, $this->attributes); | 156 return array_key_exists($key, $this->attributes); |
159 } | 157 } |
160 | 158 |
161 public function getAttribute(string $key, $default = null) { | 159 public function getAttribute(string $key, $default = null) { |
162 if (!array_key_exists($key, $this->attributes)) { | 160 if (array_key_exists($key, $this->attributes)) { |
163 return $default; | |
164 } else { | |
165 return $this->attributes[$key]; | 161 return $this->attributes[$key]; |
166 } | 162 } |
163 | |
164 return $default; | |
167 } | 165 } |
168 | 166 |
169 public function getAttributes() : array { | 167 public function getAttributes() : array { |
170 return $this->attributes; | 168 return $this->attributes; |
171 } | 169 } |