PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.9
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.9
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
betterdocs / includes / Dependencies / DI / Definition / DecoratorDefinition.php

DecoratorDefinition.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.8.9, at includes/Dependencies/DI/Definition/DecoratorDefinition.php

43 lines 853 B
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 WPDeveloper\BetterDocs\Dependencies\DI\Definition;
6
7 /**
8 * Factory that decorates a sub-definition.
9 *
10 * @since 5.0
11 * @author Matthieu Napoli <matthieu@mnapoli.fr>
12 */
13 class DecoratorDefinition extends FactoryDefinition implements Definition, ExtendsPreviousDefinition
14 {
15 /**
16 * @var Definition|null
17 */
18 private $decorated;
19
20 public function setExtendedDefinition(Definition $definition)
21 {
22 $this->decorated = $definition;
23 }
24
25 /**
26 * @return Definition|null
27 */
28 public function getDecoratedDefinition()
29 {
30 return $this->decorated;
31 }
32
33 public function replaceNestedDefinitions(callable $replacer)
34 {
35 // no nested definitions
36 }
37
38 public function __toString()
39 {
40 return 'Decorate(' . $this->getName() . ')';
41 }
42 }
43