‪TYPO3CMS  10.4
Testclasses.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
18 
23 {
24 }
25 
30 {
34  public ‪$b;
35 
39  public ‪$c;
40 
46  {
47  $this->b = ‪$b;
48  $this->c = ‪$c;
49  }
50 }
51 
56 {
60  public ‪$b;
61 
65  public ‪$c;
66 
70  public ‪$myvalue;
71 
77  public function ‪__construct(\‪t3lib_object_tests_b ‪$b, \‪t3lib_object_tests_c ‪$c, array ‪$myvalue = ['some' => 'default'])
78  {
79  $this->b = ‪$b;
80  $this->c = ‪$c;
81  $this->myvalue = ‪$myvalue;
82  }
83 }
84 
89 {
93  public ‪$b;
94 
98  public ‪$c;
99 
103  public ‪$myvalue;
104 
111  {
112  $this->b = ‪$b;
113  $this->c = ‪$c;
114  $this->myvalue = ‪$myvalue;
115  }
116 }
117 
122 {
126  public ‪$b;
127 
131  public ‪$c;
132 
136  public ‪$myvalue;
137 
143  public function ‪__construct(\‪t3lib_object_tests_b ‪$b, \‪t3lib_object_tests_c ‪$c, $someDefaultParameter = ['some' => 'default'])
144  {
145  $this->b = ‪$b;
146  $this->c = ‪$c;
147  $this->myvalue = $someDefaultParameter;
148  }
149 }
150 
155 {
159  public ‪$c;
160 
165  {
166  $this->c = ‪$c;
167  }
168 }
169 
174 {
175 }
176 
181 {
182 }
183 
185 {
186 }
187 
191 class ‪t3lib_object_tests_serializable implements \Serializable
192 {
193  public function ‪serialize()
194  {
195  }
196  public function ‪unserialize($s)
197  {
198  }
199 }
200 
205 {
206 }
207 
212 {
213 }
214 
219 {
224  {
225  $this->dependency = $i;
226  }
227 }
228 
233 {
237  public function ‪__construct(\‪t3lib_object_tests_cyclic2 $c)
238  {
239  }
240 }
241 
243 {
247  public function ‪__construct(\‪t3lib_object_tests_cyclic1 $c)
248  {
249  }
250 }
251 
253 {
258  {
259  }
260 }
261 
263 {
268  {
269  }
270 }
271 
276 {
280  public ‪$b;
281 
285  public ‪$bchild;
286 
290  public function ‪injectClassB(\‪t3lib_object_tests_b $o)
291  {
292  $this->b = $o;
293  }
294 
300  {
301  $this->bchild = $o;
302  }
303 }
304 
309 {
313  public ‪$settings;
314 
319  {
320  $this->settings = ‪$settings;
321  }
322 }
323 
325 {
329  public ‪$o2;
330 
335  {
336  $this->o2 = $cyclic2;
337  }
338 }
339 
341 {
345  public ‪$o1;
346 
350  public ‪$o3;
351 
356  {
357  $this->o1 = $cyclic1;
358  }
359 
364  {
365  $this->o3 = $cyclic3;
366  }
367 }
368 
370 {
374  public ‪$o1;
375 
380  {
381  $this->o1 = $cyclic1;
382  }
383 }
384 
386 {
391  {
392  }
393 
398  {
399  }
400 
404  public function ‪injectSettings(array $settings)
405  {
406  }
407 }
408 
409 /*
410  * a Singleton requires a Prototype for Injection -> allowed, autowiring active, but in development context we write a log message, as it is bad practice and most likely points to some logic error.
411 If a Singleton requires a Singleton for Injection -> allowed, autowiring active
412 If a Prototype requires a Prototype for Injection -> allowed, autowiring active
413 If a Prototype requires a Singleton for Injection -> allowed, autowiring active
414  */
415 
417 {
418 }
419 
421 {
422 }
423 
425 {
430 
435  {
436  $this->dependency = ‪$dependency;
437  }
438 }
439 
441 {
445  public ‪$dependency;
446 
451  {
452  $this->dependency = ‪$dependency;
453  }
454 }
455 
457 {
461  public ‪$dependency;
462 
467  {
468  $this->dependency = ‪$dependency;
469  }
470 }
471 
473 {
477  public ‪$dependency;
478 
483  {
484  $this->dependency = ‪$dependency;
485  }
486 }
487 
489 {
493  public function ‪__construct(\‪t3lib_object_prototype $dependency)
494  {
495  $this->dependency = $dependency;
496  }
497 }
498 
500 {
504  public function ‪__construct(\‪t3lib_object_singleton $dependency)
505  {
506  $this->dependency = $dependency;
507  }
508 }
509 
511 {
515  public function ‪__construct(\‪t3lib_object_prototype $dependency)
516  {
517  $this->dependency = $dependency;
518  }
519 }
520 
522 {
526  public function ‪__construct(\‪t3lib_object_singleton $dependency)
527  {
528  $this->dependency = $dependency;
529  }
530 }
531 
536 {
540  protected ‪$initialized = false;
541 
542  public function ‪initializeObject()
543  {
544  if ($this->initialized) {
545  throw new \Exception('initializeObject was called a second time', 1433944932);
546  }
547  $this->initialized = true;
548  }
549 
553  public function ‪isInitialized()
554  {
555  return ‪$this->initialized;
556  }
557 }
‪t3lib_object_tests_b
Definition: Testclasses.php:144
‪t3lib_object_tests_resolveablecyclic2\$o3
‪t3lib_object_tests_resolveablecyclic3 $o3
Definition: Testclasses.php:332
‪t3lib_object_tests_a\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:37
‪t3lib_object_tests_injectmethods\injectClassB
‪injectClassB(\t3lib_object_tests_b $o)
Definition: Testclasses.php:276
‪t3lib_object_tests_cyclic2WithSetterDependency
Definition: Testclasses.php:251
‪t3lib_object_tests_amixed_array\$myvalue
‪array $myvalue
Definition: Testclasses.php:65
‪t3lib_object_tests_class_with_injectsettings\injectFoo
‪injectFoo(\t3lib_object_tests_resolveablecyclic1 $c1)
Definition: Testclasses.php:371
‪t3lib_object_singletonNeedsSingleton
Definition: Testclasses.php:421
‪t3lib_object_singletonNeedsPrototypeInConstructor
Definition: Testclasses.php:466
‪t3lib_object_singletonNeedsSingletonInConstructor\__construct
‪__construct(\t3lib_object_singleton $dependency)
Definition: Testclasses.php:481
‪t3lib_object_tests_initializable
Definition: Testclasses.php:513
‪t3lib_object_tests_initializable\$initialized
‪bool $initialized
Definition: Testclasses.php:516
‪t3lib_object_tests_resolveablecyclic1\$o2
‪t3lib_object_tests_resolveablecyclic2 $o2
Definition: Testclasses.php:313
‪t3lib_object_tests_injectsettings\injectExtensionSettings
‪injectExtensionSettings(array $settings)
Definition: Testclasses.php:303
‪t3lib_object_tests_initializable\initializeObject
‪initializeObject()
Definition: Testclasses.php:518
‪t3lib_object_tests_a\__construct
‪__construct(\t3lib_object_tests_c $c, \t3lib_object_tests_b $b)
Definition: Testclasses.php:43
‪t3lib_object_singleton
Definition: Testclasses.php:398
‪t3lib_object_prototypeNeedsPrototypeInConstructor
Definition: Testclasses.php:488
‪t3lib_object_tests_resolveablecyclic3\$o1
‪t3lib_object_tests_resolveablecyclic1 $o1
Definition: Testclasses.php:355
‪t3lib_object_singletonNeedsSingletonInConstructor
Definition: Testclasses.php:477
‪t3lib_object_prototypeNeedsPrototype\$dependency
‪t3lib_object_prototype $dependency
Definition: Testclasses.php:439
‪t3lib_object_prototypeNeedsSingletonInConstructor
Definition: Testclasses.php:499
‪t3lib_object_tests_cyclic2WithSetterDependency\injectFoo
‪injectFoo(\t3lib_object_tests_cyclic1WithSetterDependency $c)
Definition: Testclasses.php:255
‪t3lib_object_tests_b_child_someimplementation
Definition: Testclasses.php:200
‪t3lib_object_tests_cyclic1WithSetterDependency\injectFoo
‪injectFoo(\t3lib_object_tests_cyclic2WithSetterDependency $c)
Definition: Testclasses.php:245
‪t3lib_object_tests_serializable
Definition: Testclasses.php:180
‪t3lib_object_tests_a\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:33
‪t3lib_object_tests_amixed_array_singleton
Definition: Testclasses.php:114
‪t3lib_object_tests_amixed_null\$myvalue
‪mixed null $myvalue
Definition: Testclasses.php:95
‪t3lib_object_tests_class_with_injectsettings\injectingFoo
‪injectingFoo(\t3lib_object_tests_resolveablecyclic1 $c1)
Definition: Testclasses.php:378
‪t3lib_object_tests_class_with_injectsettings
Definition: Testclasses.php:367
‪t3lib_object_tests_serializable\serialize
‪serialize()
Definition: Testclasses.php:181
‪t3lib_object_tests_b_child
Definition: Testclasses.php:169
‪t3lib_object_tests_injectmethods
Definition: Testclasses.php:264
‪t3lib_object_tests_resolveablecyclic1
Definition: Testclasses.php:310
‪t3lib_object_tests_cyclic1\__construct
‪__construct(\t3lib_object_tests_cyclic2 $c)
Definition: Testclasses.php:225
‪t3lib_object_tests_amixed_array\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:61
‪t3lib_object_prototypeNeedsSingletonInConstructor\__construct
‪__construct(\t3lib_object_singleton $dependency)
Definition: Testclasses.php:503
‪t3lib_object_tests_resolveablecyclic2\$o1
‪t3lib_object_tests_resolveablecyclic1 $o1
Definition: Testclasses.php:328
‪t3lib_object_singletonNeedsSingleton\$dependency
‪t3lib_object_singleton $dependency
Definition: Testclasses.php:424
‪t3lib_object_singletonNeedsSingleton\injectDependency
‪injectDependency(\t3lib_object_singleton $dependency)
Definition: Testclasses.php:429
‪t3lib_object_tests_resolveablecyclic3\injectCyclic1
‪injectCyclic1(\t3lib_object_tests_resolveablecyclic1 $cyclic1)
Definition: Testclasses.php:360
‪t3lib_object_tests_amixed_array
Definition: Testclasses.php:54
‪t3lib_object_tests_needsinterface
Definition: Testclasses.php:207
‪t3lib_object_tests_resolveablecyclic2\injectCyclic3
‪injectCyclic3(\t3lib_object_tests_resolveablecyclic3 $cyclic3)
Definition: Testclasses.php:345
‪TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject
Definition: AbstractDomainObject.php:31
‪t3lib_object_singletonNeedsPrototype
Definition: Testclasses.php:406
‪t3lib_object_prototypeNeedsSingleton\injectDependency
‪injectDependency(\t3lib_object_singleton $dependency)
Definition: Testclasses.php:459
‪t3lib_object_tests_needsinterface\__construct
‪__construct(\t3lib_object_tests_someinterface $i)
Definition: Testclasses.php:211
‪t3lib_object_prototypeNeedsSingleton
Definition: Testclasses.php:451
‪t3lib_object_singletonNeedsPrototype\injectDependency
‪injectDependency(\t3lib_object_prototype $dependency)
Definition: Testclasses.php:414
‪t3lib_object_prototypeNeedsPrototype\injectDependency
‪injectDependency(\t3lib_object_prototype $dependency)
Definition: Testclasses.php:444
‪t3lib_object_tests_singleton
Definition: Testclasses.php:23
‪t3lib_object_tests_amixed_array_singleton\$myvalue
‪array $myvalue
Definition: Testclasses.php:125
‪t3lib_object_tests_resolveablecyclic2
Definition: Testclasses.php:325
‪t3lib_object_prototype
Definition: Testclasses.php:402
‪t3lib_object_tests_cyclic1
Definition: Testclasses.php:221
‪t3lib_object_tests_amixed_null\__construct
‪__construct(\t3lib_object_tests_b $b, \t3lib_object_tests_c $c, $myvalue=null)
Definition: Testclasses.php:102
‪t3lib_object_tests_cyclic2\__construct
‪__construct(\t3lib_object_tests_cyclic1 $c)
Definition: Testclasses.php:235
‪t3lib_object_tests_amixed_array_singleton\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:121
‪t3lib_object_tests_amixed_null\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:91
‪t3lib_object_tests_injectsettings
Definition: Testclasses.php:295
‪t3lib_object_tests_amixed_null
Definition: Testclasses.php:84
‪t3lib_object_singletonNeedsPrototypeInConstructor\__construct
‪__construct(\t3lib_object_prototype $dependency)
Definition: Testclasses.php:470
‪t3lib_object_tests_amixed_array_singleton\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:117
‪t3lib_object_tests_resolveablecyclic3
Definition: Testclasses.php:352
‪t3lib_object_tests_initializable\isInitialized
‪bool isInitialized()
Definition: Testclasses.php:529
‪t3lib_object_tests_resolveablecyclic2\injectCyclic1
‪injectCyclic1(\t3lib_object_tests_resolveablecyclic1 $cyclic1)
Definition: Testclasses.php:337
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:23
‪t3lib_object_singletonNeedsPrototype\$dependency
‪t3lib_object_prototype $dependency
Definition: Testclasses.php:409
‪t3lib_object_tests_a
Definition: Testclasses.php:30
‪t3lib_object_tests_cyclic1WithSetterDependency
Definition: Testclasses.php:241
‪t3lib_object_tests_someimplementation
Definition: Testclasses.php:193
‪t3lib_object_tests_c
Definition: Testclasses.php:162
‪t3lib_object_prototypeNeedsPrototype
Definition: Testclasses.php:436
‪t3lib_object_tests_amixed_array\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:57
‪t3lib_object_tests_serializable\unserialize
‪unserialize($s)
Definition: Testclasses.php:184
‪t3lib_object_tests_resolveablecyclic1\__construct
‪__construct(\t3lib_object_tests_resolveablecyclic2 $cyclic2)
Definition: Testclasses.php:318
‪t3lib_object_tests_someinterface
Definition: Testclasses.php:173
‪t3lib_object_tests_class_with_injectsettings\injectSettings
‪injectSettings(array $settings)
Definition: Testclasses.php:385
‪t3lib_object_tests_injectmethods\$bchild
‪t3lib_object_tests_b_child $bchild
Definition: Testclasses.php:271
‪t3lib_object_tests_amixed_array_singleton\__construct
‪__construct(\t3lib_object_tests_b $b, \t3lib_object_tests_c $c, $someDefaultParameter=['some'=> 'default'])
Definition: Testclasses.php:132
‪t3lib_object_tests_amixed_array\__construct
‪__construct(\t3lib_object_tests_b $b, \t3lib_object_tests_c $c, array $myvalue=['some'=> 'default'])
Definition: Testclasses.php:72
‪t3lib_object_tests_injectmethods\setClassBChild
‪setClassBChild(\t3lib_object_tests_b_child $o)
Definition: Testclasses.php:285
‪t3lib_object_prototypeNeedsPrototypeInConstructor\__construct
‪__construct(\t3lib_object_prototype $dependency)
Definition: Testclasses.php:492
‪t3lib_object_tests_cyclic2
Definition: Testclasses.php:231
‪t3lib_object_tests_amixed_null\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:87
‪t3lib_object_tests_b\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:147
‪t3lib_object_tests_injectmethods\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:267
‪t3lib_object_prototypeNeedsSingleton\$dependency
‪t3lib_object_singleton $dependency
Definition: Testclasses.php:454
‪t3lib_object_tests_b\__construct
‪__construct(\t3lib_object_tests_c $c)
Definition: Testclasses.php:152
‪t3lib_object_tests_injectsettings\$settings
‪array $settings
Definition: Testclasses.php:298