PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/ezcomponents/Template/src/syntax_trees/ast/nodes/constructs/empty.php

http://hppg.googlecode.com/
PHP | 51 lines | 18 code | 2 blank | 31 comment | 2 complexity | d7641567510d9303f185bb7a106c6b19 MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause
  1. <?php
  2. /**
  3. * File containing the ezcTemplateEmptyAstNode class
  4. *
  5. * @package Template
  6. * @version 1.4.2
  7. * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
  8. * @license http://ez.no/licenses/new_bsd New BSD License
  9. * @access private
  10. */
  11. /**
  12. * Represents an empty construct.
  13. *
  14. * @package Template
  15. * @version 1.4.2
  16. * @access private
  17. */
  18. class ezcTemplateEmptyAstNode extends ezcTemplateStatementAstNode
  19. {
  20. /**
  21. * The expression to output when evaluated.
  22. * @var ezcTemplateAstNode
  23. */
  24. public $expression;
  25. /**
  26. * Initialize with function name code and optional arguments
  27. *
  28. * @param ezcTemplateAstNode $expression
  29. */
  30. public function __construct( ezcTemplateAstNode $expression = null )
  31. {
  32. parent::__construct();
  33. $this->expression = $expression;
  34. }
  35. /**
  36. * Validates the expression against its constraints.
  37. *
  38. * @throws ezcTemplateInternalException if the constraints are not met.
  39. * @return void
  40. */
  41. public function validate()
  42. {
  43. if ( $this->expression === null )
  44. {
  45. throw new ezcTemplateInternalException( "Missing expression for class <" . get_class( $this ) . ">." );
  46. }
  47. }
  48. }
  49. ?>