# defender-security/5.7.2/lib/packages/DI/Definition/ObjectDefinition/PropertyInjection.php

Defender Security – Malware Scanner, Login Security &amp; Firewall, version 5.7.2. 62 lines.

- Page: https://pluginprobe.com/plugins/defender-security/5.7.2/code/lib/packages/DI/Definition/ObjectDefinition/PropertyInjection.php
- Raw: https://pluginprobe.com/plugins/defender-security/5.7.2/raw/lib/packages/DI/Definition/ObjectDefinition/PropertyInjection.php
- Modified: 2025-12-15T08:51:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/defender-security/5.7.2/code/lib/packages/DI/Definition/ObjectDefinition/PropertyInjection.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace WPMU_DEV\Defender\Vendor\DI\Definition\ObjectDefinition;

/**
 * Describe an injection in a class property.
 *
 * @author Matthieu Napoli <matthieu@mnapoli.fr>
 */
class PropertyInjection
{
    private string $propertyName;

    /**
     * Value that should be injected in the property.
     */
    private mixed $value;

    /**
     * Use for injecting in properties of parent classes: the class name
     * must be the name of the parent class because private properties
     * can be attached to the parent classes, not the one we are resolving.
     */
    private ?string $className;

    /**
     * @param string $propertyName Property name
     * @param mixed $value Value that should be injected in the property
     */
    public function __construct(string $propertyName, mixed $value, ?string $className = null)
    {
        $this->propertyName = $propertyName;
        $this->value = $value;
        $this->className = $className;
    }

    public function getPropertyName() : string
    {
        return $this->propertyName;
    }

    /**
     * @return mixed Value that should be injected in the property
     */
    public function getValue() : mixed
    {
        return $this->value;
    }

    public function getClassName() : ?string
    {
        return $this->className;
    }

    public function replaceNestedDefinition(callable $replacer) : void
    {
        $this->value = $replacer($this->value);
    }
}

```
