TraitUse.php 798 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. class TraitUse extends Node\Stmt
  5. {
  6. /** @var Node\Name[] Traits */
  7. public $traits;
  8. /** @var TraitUseAdaptation[] Adaptations */
  9. public $adaptations;
  10. /**
  11. * Constructs a trait use node.
  12. *
  13. * @param Node\Name[] $traits Traits
  14. * @param TraitUseAdaptation[] $adaptations Adaptations
  15. * @param array $attributes Additional attributes
  16. */
  17. public function __construct(array $traits, array $adaptations = array(), array $attributes = array()) {
  18. parent::__construct($attributes);
  19. $this->traits = $traits;
  20. $this->adaptations = $adaptations;
  21. }
  22. public function getSubNodeNames() {
  23. return array('traits', 'adaptations');
  24. }
  25. }