Encapsed.php 700 B

12345678910111213141516171819202122232425262728293031
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Scalar;
  3. use PhpParser\Node\Expr;
  4. use PhpParser\Node\Scalar;
  5. class Encapsed extends Scalar
  6. {
  7. /** @var Expr[] list of string parts */
  8. public $parts;
  9. /**
  10. * Constructs an encapsed string node.
  11. *
  12. * @param Expr[] $parts Encaps list
  13. * @param array $attributes Additional attributes
  14. */
  15. public function __construct(array $parts, array $attributes = []) {
  16. $this->attributes = $attributes;
  17. $this->parts = $parts;
  18. }
  19. public function getSubNodeNames() : array {
  20. return ['parts'];
  21. }
  22. public function getType() : string {
  23. return 'Scalar_Encapsed';
  24. }
  25. }