菜谱项目

Trait_.php 723B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. class Trait_ extends ClassLike
  5. {
  6. /**
  7. * Constructs a trait node.
  8. *
  9. * @param string $name Name
  10. * @param array $subNodes Array of the following optional subnodes:
  11. * 'stmts' => array(): Statements
  12. * @param array $attributes Additional attributes
  13. */
  14. public function __construct($name, array $subNodes = array(), array $attributes = array()) {
  15. parent::__construct($attributes);
  16. $this->name = $name;
  17. $this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
  18. }
  19. public function getSubNodeNames() {
  20. return array('name', 'stmts');
  21. }
  22. }