Array.php
1 year ago
Broken.php
1 year ago
ClassWithCtor.php
1 year ago
ComplexClassWithCtor.php
1 year ago
DependencyInjector.php
1 year ago
DerivedClass.php
1 year ago
DerivedClass2.php
1 year ago
FactoryMethod.php
1 year ago
FactoryMethodWithError.php
1 year ago
JsonMapperCommentsDiscardedException.php
1 year ago
JsonMapperForCheckingAllowedPaths.php
1 year ago
Logger.php
1 year ago
MapsWithSetters.php
1 year ago
Php7TypedClass.php
1 year ago
Php7_1TypedClass.php
1 year ago
PrivateWithSetter.php
1 year ago
Simple.php
1 year ago
SimpleBase.php
1 year ago
SimpleBaseWithMissingDiscrimType.php
1 year ago
ValueObject.php
1 year ago
ComplexClassWithCtor.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | class ComplexClassWithCtor |
| 4 | { |
| 5 | private $attribute_1; |
| 6 | private $attribute_2; |
| 7 | |
| 8 | /** |
| 9 | * @var int |
| 10 | */ |
| 11 | public $attr3; |
| 12 | |
| 13 | /** |
| 14 | * @maps $attr4 |
| 15 | */ |
| 16 | public $foo = false; |
| 17 | |
| 18 | private $attr5; |
| 19 | |
| 20 | public $anotherProp; |
| 21 | |
| 22 | private $anotherSetter; |
| 23 | |
| 24 | public function __construct($attr1, $attr2, $attr3, $attr4, $attr5) |
| 25 | { |
| 26 | $this->attribute_1 = $attr1; |
| 27 | $this->attribute_2 = $attr2; |
| 28 | $this->attr3 = $attr3 + 1; |
| 29 | $this->foo = $attr4; |
| 30 | $attr5[] = 'last'; |
| 31 | $this->attr5 = $attr5; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * @param array |
| 36 | */ |
| 37 | public function setAttr5($val) { |
| 38 | $this->attr5 = $val; |
| 39 | } |
| 40 | |
| 41 | public function getAttr5() |
| 42 | { |
| 43 | return $this->attr5; |
| 44 | } |
| 45 | |
| 46 | public function getAttr1() |
| 47 | { |
| 48 | return $this->attribute_1; |
| 49 | } |
| 50 | |
| 51 | public function getAttr2() |
| 52 | { |
| 53 | return $this->attribute_2; |
| 54 | } |
| 55 | |
| 56 | public function getAnotherSetter() |
| 57 | { |
| 58 | return $this->anotherSetter; |
| 59 | } |
| 60 | |
| 61 | public function setAnotherSetter($val) |
| 62 | { |
| 63 | $this->anotherSetter = $val . ' new'; |
| 64 | } |
| 65 | } |
| 66 |