Constant.php 827 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * This file is part of the Nette Framework (https://nette.org)
  4. * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
  5. */
  6. declare(strict_types=1);
  7. namespace Nette\PhpGenerator;
  8. use Nette;
  9. /**
  10. * Class constant.
  11. */
  12. final class Constant
  13. {
  14. use Nette\SmartObject;
  15. use Traits\NameAware;
  16. use Traits\VisibilityAware;
  17. use Traits\CommentAware;
  18. use Traits\AttributeAware;
  19. /** @var mixed */
  20. private $value;
  21. /** @var bool */
  22. private $final = false;
  23. /** @return static */
  24. public function setValue($val): self
  25. {
  26. $this->value = $val;
  27. return $this;
  28. }
  29. public function getValue()
  30. {
  31. return $this->value;
  32. }
  33. /** @return static */
  34. public function setFinal(bool $state = true): self
  35. {
  36. $this->final = $state;
  37. return $this;
  38. }
  39. public function isFinal(): bool
  40. {
  41. return $this->final;
  42. }
  43. }