InterpolatedStringPart.php 850 B

1234567891011121314151617181920212223242526272829303132
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node;
  3. use PhpParser\NodeAbstract;
  4. class InterpolatedStringPart extends NodeAbstract {
  5. /** @var string String value */
  6. public string $value;
  7. /**
  8. * Constructs a node representing a string part of an interpolated string.
  9. *
  10. * @param string $value String value
  11. * @param array<string, mixed> $attributes Additional attributes
  12. */
  13. public function __construct(string $value, array $attributes = []) {
  14. $this->attributes = $attributes;
  15. $this->value = $value;
  16. }
  17. public function getSubNodeNames(): array {
  18. return ['value'];
  19. }
  20. public function getType(): string {
  21. return 'InterpolatedStringPart';
  22. }
  23. }
  24. // @deprecated compatibility alias
  25. class_alias(InterpolatedStringPart::class, Scalar\EncapsedStringPart::class);