-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProperty.php
53 lines (39 loc) · 1.18 KB
/
Property.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Sf2gen\Component\PhpCoder;
class Property extends VisibleStaticCode {
protected $varName = false;
protected $type = false;
protected $defaultValue = false;
public function __construct($varName) {
$this->varName = $varName;
}
public function getType() {
return ($this->type ? $this->type : 'variant');
}
public function setType($type) {
$this->type = $type;
}
public function getVarName() {
return $this->varName;
}
public function getDefaultValue() {
return ($this->defaultValue ? ' = ' . self::quote($this->defaultValue) : '');
}
public function setDefaultValue($defaultValue) {
$this->defaultValue = $defaultValue;
}
public function getDollar() {
return '$';
}
public function getEndOfLine() {
return ';';
}
public function output() {
return $this->getVisibility()
. $this->getStatic()
. $this->getDollar() . $this->getVarName()
. $this->getDefaultValue()
. $this->getEndOfLine()
;
}
}