InterpolatedString.php 933 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Scalar;
  3. use PhpParser\Node\Expr;
  4. use PhpParser\Node\InterpolatedStringPart;
  5. use PhpParser\Node\Scalar;
  6. class InterpolatedString extends Scalar {
  7. /** @var (Expr|InterpolatedStringPart)[] list of string parts */
  8. public array $parts;
  9. /**
  10. * Constructs an interpolated string node.
  11. *
  12. * @param (Expr|InterpolatedStringPart)[] $parts Interpolated string parts
  13. * @param array<string, mixed> $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_InterpolatedString';
  24. }
  25. }
  26. // @deprecated compatibility alias
  27. class_alias(InterpolatedString::class, Encapsed::class);