PluginProbe
Packeta / 1.6.1
Packeta v1.6.1
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / deps / nette / php-generator / src / PhpGenerator / Property.php

Property.php in Packeta 1.6.1, at deps/nette/php-generator/src/PhpGenerator/Property.php

89 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * This file is part of the Nette Framework (https://nette.org)
5 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6 */
7 declare (strict_types=1);
8 namespace Packetery\Nette\PhpGenerator;
9
10 use Packetery\Nette;
11 /**
12 * Class property description.
13 *
14 * @property mixed $value
15 */
16 final class Property
17 {
18 use \Packetery\Nette\SmartObject;
19 use Traits\NameAware;
20 use Traits\VisibilityAware;
21 use Traits\CommentAware;
22 use Traits\AttributeAware;
23 /** @var mixed */
24 private $value;
25 /** @var bool */
26 private $static = \false;
27 /** @var string|null */
28 private $type;
29 /** @var bool */
30 private $nullable = \false;
31 /** @var bool */
32 private $initialized = \false;
33 /** @return static */
34 public function setValue($val) : self
35 {
36 $this->value = $val;
37 $this->initialized = \true;
38 return $this;
39 }
40 public function &getValue()
41 {
42 return $this->value;
43 }
44 /** @return static */
45 public function setStatic(bool $state = \true) : self
46 {
47 $this->static = $state;
48 return $this;
49 }
50 public function isStatic() : bool
51 {
52 return $this->static;
53 }
54 /** @return static */
55 public function setType(?string $type) : self
56 {
57 if ($type && $type[0] === '?') {
58 $type = \substr($type, 1);
59 $this->nullable = \true;
60 }
61 $this->type = $type;
62 return $this;
63 }
64 public function getType() : ?string
65 {
66 return $this->type;
67 }
68 /** @return static */
69 public function setNullable(bool $state = \true) : self
70 {
71 $this->nullable = $state;
72 return $this;
73 }
74 public function isNullable() : bool
75 {
76 return $this->nullable;
77 }
78 /** @return static */
79 public function setInitialized(bool $state = \true) : self
80 {
81 $this->initialized = $state;
82 return $this;
83 }
84 public function isInitialized() : bool
85 {
86 return $this->initialized || $this->value !== null;
87 }
88 }
89