‪TYPO3CMS  9.5
Testclasses.php
Go to the documentation of this file.
1 <?php
6 {
7 }
8 
13 {
17  public ‪$b;
18 
22  public ‪$c;
23 
29  {
30  $this->b = ‪$b;
31  $this->c = ‪$c;
32  }
33 }
34 
39 {
43  public ‪$b;
44 
48  public ‪$c;
49 
53  public ‪$myvalue;
54 
60  public function ‪__construct(\‪t3lib_object_tests_b ‪$b, \‪t3lib_object_tests_c ‪$c, array ‪$myvalue = ['some' => 'default'])
61  {
62  $this->b = ‪$b;
63  $this->c = ‪$c;
64  $this->myvalue = ‪$myvalue;
65  }
66 }
67 
72 {
76  public ‪$b;
77 
81  public ‪$c;
82 
86  public ‪$myvalue;
87 
94  {
95  $this->b = ‪$b;
96  $this->c = ‪$c;
97  $this->myvalue = ‪$myvalue;
98  }
99 }
100 
105 {
109  public ‪$b;
110 
114  public ‪$c;
115 
119  public ‪$myvalue;
120 
126  public function ‪__construct(\‪t3lib_object_tests_b ‪$b, \‪t3lib_object_tests_c ‪$c, $someDefaultParameter = ['some' => 'default'])
127  {
128  $this->b = ‪$b;
129  $this->c = ‪$c;
130  $this->myvalue = $someDefaultParameter;
131  }
132 }
133 
138 {
142  public ‪$c;
143 
148  {
149  $this->c = ‪$c;
150  }
151 }
152 
157 {
158 }
159 
164 {
165 }
166 
171 {
172 }
173 
177 class ‪t3lib_object_tests_serializable implements \Serializable
178 {
179  public function ‪serialize()
180  {
181  }
182  public function ‪unserialize($s)
183  {
184  }
185 }
186 
191 {
192 }
193 
198 {
199 }
200 
205 {
210  {
211  $this->dependency = $i;
212  }
213 }
214 
219 {
223  public function ‪__construct(\‪t3lib_object_tests_cyclic2 $c)
224  {
225  }
226 }
227 
232 {
236  public function ‪__construct(\‪t3lib_object_tests_cyclic1 $c)
237  {
238  }
239 }
240 
245 {
250  {
251  }
252 }
253 
258 {
263  {
264  }
265 }
266 
271 {
275  public ‪$b;
276 
280  public ‪$bchild;
281 
285  public function ‪injectClassB(\‪t3lib_object_tests_b $o)
286  {
287  $this->b = $o;
288  }
289 
295  {
296  $this->bchild = $o;
297  }
298 }
299 
304 {
308  public ‪$settings;
309 
313  public function ‪injectExtensionSettings(array ‪$settings)
314  {
315  $this->settings = ‪$settings;
316  }
317 }
318 
323 {
327  public ‪$o2;
328 
333  {
334  $this->o2 = $cyclic2;
335  }
336 }
337 
342 {
346  public ‪$o1;
347 
351  public ‪$o3;
352 
357  {
358  $this->o1 = $cyclic1;
359  }
360 
365  {
366  $this->o3 = $cyclic3;
367  }
368 }
369 
374 {
378  public ‪$o1;
379 
384  {
385  $this->o1 = $cyclic1;
386  }
387 }
388 
393 {
398  {
399  }
400 
405  {
406  }
407 
411  public function ‪injectSettings(array $settings)
412  {
413  }
414 }
415 
416 /*
417  * 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.
418 If a Singleton requires a Singleton for Injection -> allowed, autowiring active
419 If a Prototype requires a Prototype for Injection -> allowed, autowiring active
420 If a Prototype requires a Singleton for Injection -> allowed, autowiring active
421  */
426 {
427 }
428 
433 {
434 }
435 
440 {
444  public ‪$dependency;
445 
450  {
451  $this->dependency = ‪$dependency;
452  }
453 }
454 
459 {
463  public ‪$dependency;
464 
469  {
470  $this->dependency = ‪$dependency;
471  }
472 }
473 
478 {
482  public ‪$dependency;
483 
488  {
489  $this->dependency = ‪$dependency;
490  }
491 }
492 
497 {
501  public ‪$dependency;
502 
507  {
508  $this->dependency = ‪$dependency;
509  }
510 }
511 
516 {
520  public function ‪__construct(\‪t3lib_object_prototype $dependency)
521  {
522  $this->dependency = $dependency;
523  }
524 }
525 
530 {
534  public function ‪__construct(\‪t3lib_object_singleton $dependency)
535  {
536  $this->dependency = $dependency;
537  }
538 }
539 
544 {
548  public function ‪__construct(\‪t3lib_object_prototype $dependency)
549  {
550  $this->dependency = $dependency;
551  }
552 }
553 
558 {
562  public function ‪__construct(\‪t3lib_object_singleton $dependency)
563  {
564  $this->dependency = $dependency;
565  }
566 }
567 
572 {
576  protected ‪$initialized = false;
577 
578  public function ‪initializeObject()
579  {
580  if ($this->initialized) {
581  throw new \Exception('initializeObject was called a second time', 1433944932);
582  }
583  $this->initialized = true;
584  }
585 
589  public function ‪isInitialized()
590  {
591  return ‪$this->initialized;
592  }
593 }
‪t3lib_object_tests_b
Definition: Testclasses.php:127
‪t3lib_object_tests_resolveablecyclic2\$o3
‪t3lib_object_tests_resolveablecyclic3 $o3
Definition: Testclasses.php:333
‪t3lib_object_tests_a\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:20
‪t3lib_object_tests_injectmethods\injectClassB
‪injectClassB(\t3lib_object_tests_b $o)
Definition: Testclasses.php:271
‪t3lib_object_tests_cyclic2WithSetterDependency
Definition: Testclasses.php:246
‪t3lib_object_tests_amixed_array\$myvalue
‪array $myvalue
Definition: Testclasses.php:48
‪t3lib_object_tests_class_with_injectsettings\injectFoo
‪injectFoo(\t3lib_object_tests_resolveablecyclic1 $c1)
Definition: Testclasses.php:378
‪t3lib_object_singletonNeedsSingleton
Definition: Testclasses.php:439
‪t3lib_object_singletonNeedsPrototypeInConstructor
Definition: Testclasses.php:493
‪t3lib_object_singletonNeedsSingletonInConstructor\__construct
‪__construct(\t3lib_object_singleton $dependency)
Definition: Testclasses.php:511
‪t3lib_object_tests_initializable
Definition: Testclasses.php:549
‪t3lib_object_tests_initializable\$initialized
‪bool $initialized
Definition: Testclasses.php:552
‪t3lib_object_tests_resolveablecyclic1\$o2
‪t3lib_object_tests_resolveablecyclic2 $o2
Definition: Testclasses.php:311
‪t3lib_object_tests_injectsettings\injectExtensionSettings
‪injectExtensionSettings(array $settings)
Definition: Testclasses.php:298
‪t3lib_object_tests_initializable\initializeObject
‪initializeObject()
Definition: Testclasses.php:554
‪t3lib_object_tests_a\__construct
‪__construct(\t3lib_object_tests_c $c, \t3lib_object_tests_b $b)
Definition: Testclasses.php:26
‪t3lib_object_singleton
Definition: Testclasses.php:407
‪t3lib_object_prototypeNeedsPrototypeInConstructor
Definition: Testclasses.php:521
‪t3lib_object_tests_resolveablecyclic3\$o1
‪t3lib_object_tests_resolveablecyclic1 $o1
Definition: Testclasses.php:359
‪t3lib_object_singletonNeedsSingletonInConstructor
Definition: Testclasses.php:507
‪t3lib_object_prototypeNeedsPrototype\$dependency
‪t3lib_object_prototype $dependency
Definition: Testclasses.php:460
‪t3lib_object_prototypeNeedsSingletonInConstructor
Definition: Testclasses.php:535
‪t3lib_object_tests_cyclic2WithSetterDependency\injectFoo
‪injectFoo(\t3lib_object_tests_cyclic1WithSetterDependency $c)
Definition: Testclasses.php:250
‪t3lib_object_tests_b_child_someimplementation
Definition: Testclasses.php:186
‪t3lib_object_tests_cyclic1WithSetterDependency\injectFoo
‪injectFoo(\t3lib_object_tests_cyclic2WithSetterDependency $c)
Definition: Testclasses.php:237
‪t3lib_object_tests_serializable
Definition: Testclasses.php:166
‪t3lib_object_tests_a\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:16
‪t3lib_object_tests_amixed_array_singleton
Definition: Testclasses.php:97
‪t3lib_object_tests_amixed_null\$myvalue
‪mixed null $myvalue
Definition: Testclasses.php:78
‪t3lib_object_tests_class_with_injectsettings\injectingFoo
‪injectingFoo(\t3lib_object_tests_resolveablecyclic1 $c1)
Definition: Testclasses.php:385
‪t3lib_object_tests_class_with_injectsettings
Definition: Testclasses.php:374
‪t3lib_object_tests_serializable\serialize
‪serialize()
Definition: Testclasses.php:167
‪t3lib_object_tests_b_child
Definition: Testclasses.php:152
‪t3lib_object_tests_injectmethods
Definition: Testclasses.php:259
‪t3lib_object_tests_resolveablecyclic1
Definition: Testclasses.php:308
‪t3lib_object_tests_cyclic1\__construct
‪__construct(\t3lib_object_tests_cyclic2 $c)
Definition: Testclasses.php:211
‪t3lib_object_tests_amixed_array\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:44
‪t3lib_object_prototypeNeedsSingletonInConstructor\__construct
‪__construct(\t3lib_object_singleton $dependency)
Definition: Testclasses.php:539
‪t3lib_object_tests_resolveablecyclic2\$o1
‪t3lib_object_tests_resolveablecyclic1 $o1
Definition: Testclasses.php:329
‪t3lib_object_singletonNeedsSingleton\$dependency
‪t3lib_object_singleton $dependency
Definition: Testclasses.php:442
‪t3lib_object_singletonNeedsSingleton\injectDependency
‪injectDependency(\t3lib_object_singleton $dependency)
Definition: Testclasses.php:447
‪t3lib_object_tests_resolveablecyclic3\injectCyclic1
‪injectCyclic1(\t3lib_object_tests_resolveablecyclic1 $cyclic1)
Definition: Testclasses.php:364
‪t3lib_object_tests_amixed_array
Definition: Testclasses.php:37
‪t3lib_object_tests_needsinterface
Definition: Testclasses.php:193
‪t3lib_object_tests_resolveablecyclic2\injectCyclic3
‪injectCyclic3(\t3lib_object_tests_resolveablecyclic3 $cyclic3)
Definition: Testclasses.php:346
‪TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject
Definition: AbstractDomainObject.php:26
‪t3lib_object_singletonNeedsPrototype
Definition: Testclasses.php:421
‪t3lib_object_prototypeNeedsSingleton\injectDependency
‪injectDependency(\t3lib_object_singleton $dependency)
Definition: Testclasses.php:483
‪t3lib_object_tests_needsinterface\__construct
‪__construct(\t3lib_object_tests_someinterface $i)
Definition: Testclasses.php:197
‪t3lib_object_prototypeNeedsSingleton
Definition: Testclasses.php:475
‪t3lib_object_singletonNeedsPrototype\injectDependency
‪injectDependency(\t3lib_object_prototype $dependency)
Definition: Testclasses.php:429
‪t3lib_object_prototypeNeedsPrototype\injectDependency
‪injectDependency(\t3lib_object_prototype $dependency)
Definition: Testclasses.php:465
‪t3lib_object_tests_singleton
Definition: Testclasses.php:6
‪t3lib_object_tests_amixed_array_singleton\$myvalue
‪array $myvalue
Definition: Testclasses.php:108
‪t3lib_object_tests_resolveablecyclic2
Definition: Testclasses.php:326
‪t3lib_object_prototype
Definition: Testclasses.php:414
‪t3lib_object_tests_cyclic1
Definition: Testclasses.php:207
‪t3lib_object_tests_amixed_null\__construct
‪__construct(\t3lib_object_tests_b $b, \t3lib_object_tests_c $c, $myvalue=null)
Definition: Testclasses.php:85
‪t3lib_object_tests_cyclic2\__construct
‪__construct(\t3lib_object_tests_cyclic1 $c)
Definition: Testclasses.php:224
‪t3lib_object_tests_amixed_array_singleton\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:104
‪t3lib_object_tests_amixed_null\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:74
‪t3lib_object_tests_injectsettings
Definition: Testclasses.php:290
‪t3lib_object_tests_amixed_null
Definition: Testclasses.php:67
‪t3lib_object_singletonNeedsPrototypeInConstructor\__construct
‪__construct(\t3lib_object_prototype $dependency)
Definition: Testclasses.php:497
‪t3lib_object_tests_amixed_array_singleton\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:100
‪t3lib_object_tests_resolveablecyclic3
Definition: Testclasses.php:356
‪t3lib_object_tests_initializable\isInitialized
‪bool isInitialized()
Definition: Testclasses.php:565
‪t3lib_object_tests_resolveablecyclic2\injectCyclic1
‪injectCyclic1(\t3lib_object_tests_resolveablecyclic1 $cyclic1)
Definition: Testclasses.php:338
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪t3lib_object_singletonNeedsPrototype\$dependency
‪t3lib_object_prototype $dependency
Definition: Testclasses.php:424
‪t3lib_object_tests_a
Definition: Testclasses.php:13
‪t3lib_object_tests_cyclic1WithSetterDependency
Definition: Testclasses.php:233
‪t3lib_object_tests_someimplementation
Definition: Testclasses.php:179
‪t3lib_object_tests_c
Definition: Testclasses.php:145
‪t3lib_object_prototypeNeedsPrototype
Definition: Testclasses.php:457
‪t3lib_object_tests_amixed_array\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:40
‪t3lib_object_tests_serializable\unserialize
‪unserialize($s)
Definition: Testclasses.php:170
‪t3lib_object_tests_resolveablecyclic1\__construct
‪__construct(\t3lib_object_tests_resolveablecyclic2 $cyclic2)
Definition: Testclasses.php:316
‪t3lib_object_tests_someinterface
Definition: Testclasses.php:159
‪t3lib_object_tests_class_with_injectsettings\injectSettings
‪injectSettings(array $settings)
Definition: Testclasses.php:392
‪t3lib_object_tests_injectmethods\$bchild
‪t3lib_object_tests_b_child $bchild
Definition: Testclasses.php:266
‪t3lib_object_tests_amixed_array_singleton\__construct
‪__construct(\t3lib_object_tests_b $b, \t3lib_object_tests_c $c, $someDefaultParameter=['some'=> 'default'])
Definition: Testclasses.php:115
‪t3lib_object_tests_amixed_array\__construct
‪__construct(\t3lib_object_tests_b $b, \t3lib_object_tests_c $c, array $myvalue=['some'=> 'default'])
Definition: Testclasses.php:55
‪t3lib_object_tests_injectmethods\setClassBChild
‪setClassBChild(\t3lib_object_tests_b_child $o)
Definition: Testclasses.php:280
‪t3lib_object_prototypeNeedsPrototypeInConstructor\__construct
‪__construct(\t3lib_object_prototype $dependency)
Definition: Testclasses.php:525
‪t3lib_object_tests_cyclic2
Definition: Testclasses.php:220
‪t3lib_object_tests_amixed_null\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:70
‪t3lib_object_tests_b\$c
‪t3lib_object_tests_c $c
Definition: Testclasses.php:130
‪t3lib_object_tests_injectmethods\$b
‪t3lib_object_tests_b $b
Definition: Testclasses.php:262
‪t3lib_object_prototypeNeedsSingleton\$dependency
‪t3lib_object_singleton $dependency
Definition: Testclasses.php:478
‪t3lib_object_tests_b\__construct
‪__construct(\t3lib_object_tests_c $c)
Definition: Testclasses.php:135
‪t3lib_object_tests_injectsettings\$settings
‪array $settings
Definition: Testclasses.php:293