| Server IP : 213.186.33.4 / Your IP : 216.73.217.87 Web Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/awebpaca/piwik/vendor/php-di/php-di/src/Definition/ObjectDefinition/ |
Upload File : |
<?php
declare(strict_types=1);
namespace DI\Definition\ObjectDefinition;
/**
* Describe an injection in a class property.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
class PropertyInjection
{
/**
* Property name.
* @var string
*/
private $propertyName;
/**
* Value that should be injected in the property.
* @var mixed
*/
private $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.
* @var string|null
*/
private $className;
/**
* @param string $propertyName Property name
* @param mixed $value Value that should be injected in the property
*/
public function __construct(string $propertyName, $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()
{
return $this->value;
}
/**
* @return string|null
*/
public function getClassName()
{
return $this->className;
}
public function replaceNestedDefinition(callable $replacer)
{
$this->value = $replacer($this->value);
}
}