PluginProbe
Elementor Website Builder – more than just a page builder / 3.30.0-beta1
Elementor Website Builder – more than just a page builder v3.30.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
elementor / vendor_prefixed / dependency-injection / php-di / php-di / src / Definition / ValueDefinition.php

ValueDefinition.php in Elementor Website Builder – more than just a page builder 3.30.0-beta1, at vendor_prefixed/dependency-injection/php-di/php-di/src/Definition/ValueDefinition.php

62 lines 1.2 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 namespace ElementorDeps\DI\Definition;
5
6 use ElementorDeps\Psr\Container\ContainerInterface;
7 /**
8 * Definition of a value for dependency injection.
9 *
10 * @author Matthieu Napoli <[email protected]>
11 */
12 class ValueDefinition implements Definition, SelfResolvingDefinition
13 {
14 /**
15 * Entry name.
16 * @var string
17 */
18 private $name = '';
19 /**
20 * @var mixed
21 */
22 private $value;
23 /**
24 * @param mixed $value
25 */
26 public function __construct($value)
27 {
28 $this->value = $value;
29 }
30 public function getName() : string
31 {
32 return $this->name;
33 }
34 public function setName(string $name)
35 {
36 $this->name = $name;
37 }
38 /**
39 * @return mixed
40 */
41 public function getValue()
42 {
43 return $this->value;
44 }
45 public function resolve(ContainerInterface $container)
46 {
47 return $this->getValue();
48 }
49 public function isResolvable(ContainerInterface $container) : bool
50 {
51 return \true;
52 }
53 public function replaceNestedDefinitions(callable $replacer)
54 {
55 // no nested definitions
56 }
57 public function __toString()
58 {
59 return \sprintf('Value (%s)', \var_export($this->value, \true));
60 }
61 }
62