PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.3.1
Defender Security – Malware Scanner, Login Security & Firewall v5.3.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / lib / packages / DI / Definition / ObjectDefinition / PropertyInjection.php

PropertyInjection.php in Defender Security – Malware Scanner, Login Security & Firewall 5.3.1, at lib/packages/DI/Definition/ObjectDefinition/PropertyInjection.php

71 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace WPMU_DEV\Defender\Vendor\DI\Definition\ObjectDefinition;
6
7 /**
8 * Describe an injection in a class property.
9 *
10 * @author Matthieu Napoli <[email protected]>
11 */
12 class PropertyInjection
13 {
14 /**
15 * Property name.
16 * @var string
17 */
18 private $propertyName;
19
20 /**
21 * Value that should be injected in the property.
22 * @var mixed
23 */
24 private $value;
25
26 /**
27 * Use for injecting in properties of parent classes: the class name
28 * must be the name of the parent class because private properties
29 * can be attached to the parent classes, not the one we are resolving.
30 * @var string|null
31 */
32 private $className;
33
34 /**
35 * @param string $propertyName Property name
36 * @param mixed $value Value that should be injected in the property
37 */
38 public function __construct(string $propertyName, $value, string $className = null)
39 {
40 $this->propertyName = $propertyName;
41 $this->value = $value;
42 $this->className = $className;
43 }
44
45 public function getPropertyName() : string
46 {
47 return $this->propertyName;
48 }
49
50 /**
51 * @return mixed Value that should be injected in the property
52 */
53 public function getValue()
54 {
55 return $this->value;
56 }
57
58 /**
59 * @return string|null
60 */
61 public function getClassName()
62 {
63 return $this->className;
64 }
65
66 public function replaceNestedDefinition(callable $replacer)
67 {
68 $this->value = $replacer($this->value);
69 }
70 }
71