PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.2
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
← All changes | includes/Dependencies/DI/functions.php +5 -2 3.3.44.9.2 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +// phpcs:ignoreFile -- Bundled third-party (Mozart) dependency; exempt from plugin coding standards.
2 3
3 4 declare(strict_types=1);
4 5
5 6 namespace WPDeveloper\BetterDocs\Dependencies\DI;
@@ -12,8 +13,10 @@
12 13 use WPDeveloper\BetterDocs\Dependencies\DI\Definition\Reference;
13 14 use WPDeveloper\BetterDocs\Dependencies\DI\Definition\StringDefinition;
14 15 use WPDeveloper\BetterDocs\Dependencies\DI\Definition\ValueDefinition;
15 16
17 +if ( ! defined( 'ABSPATH' ) ) { exit; } // Prevent direct file access.
18 +
16 19 if (! function_exists('WPDeveloper\BetterDocs\Dependencies\DI\value')) {
17 20 /**
18 21 * Helper for defining a value.
19 22 *
@@ -31,9 +34,9 @@
31 34 *
32 35 * @param string|null $className Class name of the object.
33 36 * If null, the name of the entry (in the container) will be used as class name.
34 37 */
35 - function create(string $className = null) : CreateDefinitionHelper
38 + function create(?string $className = null) : CreateDefinitionHelper
36 39 {
37 40 return new CreateDefinitionHelper($className);
38 41 }
39 42 }
@@ -44,9 +47,9 @@
44 47 *
45 48 * @param string|null $className Class name of the object.
46 49 * If null, the name of the entry (in the container) will be used as class name.
47 50 */
48 - function autowire(string $className = null) : AutowireDefinitionHelper
51 + function autowire(?string $className = null) : AutowireDefinitionHelper
49 52 {
50 53 return new AutowireDefinitionHelper($className);
51 54 }
52 55 }