ArrayItem.php 932 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * @property PHPParser_Node_Expr $value Value
  4. * @property null|PHPParser_Node_Expr $key Key
  5. * @property bool $byRef Whether to assign by reference
  6. */
  7. class PHPParser_Node_Expr_ArrayItem extends PHPParser_Node_Expr
  8. {
  9. /**
  10. * Constructs an array item node.
  11. *
  12. * @param PHPParser_Node_Expr $value Value
  13. * @param null|PHPParser_Node_Expr $key Key
  14. * @param bool $byRef Whether to assign by reference
  15. * @param array $attributes Additional attributes
  16. */
  17. public function __construct(PHPParser_Node_Expr $value, PHPParser_Node_Expr $key = null, $byRef = false, array $attributes = array()) {
  18. parent::__construct(
  19. array(
  20. 'key' => $key,
  21. 'value' => $value,
  22. 'byRef' => $byRef
  23. ),
  24. $attributes
  25. );
  26. }
  27. }