[TASK] Removes extra empty lines
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Object / Container / Fixtures / ContainerConstructorInjectionTestFixtures.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Tests\Unit\Object\Container\Fixtures;
3
4 class SimpleTypeConstructorArgument
5 {
6 /**
7 * @var bool
8 */
9 public $foo;
10
11 /**
12 * @param bool $foo
13 */
14 public function __construct($foo = false)
15 {
16 $this->foo = $foo;
17 }
18 }
19
20 class ArgumentTestClass
21 {
22 }
23
24 class MandatoryConstructorArgument
25 {
26 /**
27 * @var ArgumentTestClass
28 */
29 public $argumentTestClass;
30
31 public $allArguments;
32
33 /**
34 * @param ArgumentTestClass $argumentTestClass
35 */
36 public function __construct(ArgumentTestClass $argumentTestClass)
37 {
38 $this->argumentTestClass = $argumentTestClass;
39 $this->allArguments = func_get_args();
40 }
41 }
42
43 class OptionalConstructorArgument
44 {
45 /**
46 * @var ArgumentTestClass
47 */
48 public $argumentTestClass;
49
50 /**
51 * @param ArgumentTestClass $argumentTestClass
52 */
53 public function __construct(ArgumentTestClass $argumentTestClass = null)
54 {
55 $this->argumentTestClass = $argumentTestClass;
56 }
57 }
58
59 class MandatoryConstructorArgumentTwo
60 {
61 /**
62 * @var ArgumentTestClass
63 */
64 public $argumentTestClass;
65
66 /**
67 * @var ArgumentTestClass
68 */
69 public $argumentTestClassTwo;
70
71 /**
72 * @param ArgumentTestClass $argumentTestClass
73 * @param ArgumentTestClass $argumentTestClassTwo
74 */
75 public function __construct(ArgumentTestClass $argumentTestClass, ArgumentTestClass $argumentTestClassTwo)
76 {
77 $this->argumentTestClass = $argumentTestClass;
78 $this->argumentTestClassTwo = $argumentTestClassTwo;
79 }
80 }
81
82 class TwoConstructorArgumentsSecondOptional
83 {
84 /**
85 * @var ArgumentTestClass
86 */
87 public $argumentTestClass;
88
89 /**
90 * @var ArgumentTestClass
91 */
92 public $argumentTestClassTwo;
93
94 /**
95 * @param ArgumentTestClass $argumentTestClass
96 * @param ArgumentTestClass $argumentTestClassTwo
97 */
98 public function __construct(ArgumentTestClass $argumentTestClass, ArgumentTestClass $argumentTestClassTwo = null)
99 {
100 $this->argumentTestClass = $argumentTestClass;
101 $this->argumentTestClassTwo = $argumentTestClassTwo;
102 }
103 }
104
105 class TwoConstructorArgumentsFirstOptional
106 {
107 /**
108 * @var ArgumentTestClass
109 */
110 public $argumentTestClass;
111
112 /**
113 * @var ArgumentTestClass
114 */
115 public $argumentTestClassTwo;
116
117 /**
118 * The extbase container code uses PHP parameter reflection isOptional() to determine
119 * injection. PHP behaves differently in current supported core versions, in effect
120 * constructor injection of the first argument can not be relied on.
121 *
122 * The according unit tests currently do not check the value of first argument.
123 *
124 * @see https://bugs.php.net/bug.php?id=62715
125 *
126 * @param ArgumentTestClass $argumentTestClass
127 * @param ArgumentTestClass $argumentTestClassTwo
128 */
129 public function __construct(ArgumentTestClass $argumentTestClass = null, ArgumentTestClass $argumentTestClassTwo)
130 {
131 $this->argumentTestClass = $argumentTestClass;
132 $this->argumentTestClassTwo = $argumentTestClassTwo;
133 }
134 }
135
136 class TwoConstructorArgumentsBothOptional
137 {
138 /**
139 * @var ArgumentTestClass
140 */
141 public $argumentTestClass;
142
143 /**
144 * @var ArgumentTestClass
145 */
146 public $argumentTestClassTwo;
147
148 /**
149 * @param ArgumentTestClass $argumentTestClass
150 * @param ArgumentTestClass $argumentTestClassTwo
151 */
152 public function __construct(ArgumentTestClass $argumentTestClass = null, ArgumentTestClass $argumentTestClassTwo = null)
153 {
154 $this->argumentTestClass = $argumentTestClass;
155 $this->argumentTestClassTwo = $argumentTestClassTwo;
156 }
157 }