1 | <?php |
||
12 | class CallbackWrapperDefinition implements DumpableInterface |
||
13 | { |
||
14 | /** |
||
15 | * The identifier of the instance in the container. |
||
16 | * |
||
17 | * @var string|null |
||
18 | */ |
||
19 | private $identifier; |
||
20 | |||
21 | /** |
||
22 | * @var DumpableInterface |
||
23 | */ |
||
24 | private $wrappedDefinition; |
||
25 | |||
26 | /** |
||
27 | * @param null|string $identifier |
||
28 | * @param DumpableInterface $wrappedDefinition |
||
29 | */ |
||
30 | public function __construct($identifier, DumpableInterface $wrappedDefinition) |
||
31 | { |
||
32 | $this->identifier = $identifier; |
||
33 | $this->wrappedDefinition = $wrappedDefinition; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Returns the identifier for this object in the container. |
||
38 | * If null, classes consuming this definition should assume the definition must be inlined. |
||
39 | * |
||
40 | * @return string|null |
||
41 | */ |
||
42 | public function getIdentifier() |
||
46 | |||
47 | /** |
||
48 | * Returns an InlineEntryInterface object representing the PHP code necessary to generate |
||
49 | * the container entry. |
||
50 | * |
||
51 | * @param string $containerVariable The name of the variable that allows access to the container instance. For instance: "$container", or "$this->container" |
||
52 | * @param array $usedVariables An array of variables that are already used and that should not be used when generating this code. |
||
53 | * |
||
54 | * @return InlineEntryInterface |
||
55 | */ |
||
56 | public function toPhpCode($containerVariable, array $usedVariables = array()) |
||
66 | } |
||
67 |