File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public static function create(array $props): ConfigPropsInterface
2323 }
2424
2525 if (!class_exists ($ name )) {
26- return self ::resolver ();
26+ return self ::resolver ($ props );
2727 }
2828
2929 return new $ name ($ props );
Original file line number Diff line number Diff line change 1818use MaplePHP \Emitron \Configs \ConfigPropsFactory ;
1919use MaplePHP \Emitron \Contracts \ConfigPropsInterface ;
2020use MaplePHP \Emitron \Contracts \DispatchConfigInterface ;
21- use MaplePHP \Unitary \Config \ConfigProps ;
2221use MaplePHP \Unitary \Interfaces \RouterDispatchInterface ;
2322use MaplePHP \Unitary \Interfaces \RouterInterface ;
24- use MaplePHP \Unitary \Support \Helpers ;
2523
2624class DispatchConfig implements DispatchConfigInterface
2725{
@@ -40,6 +38,28 @@ public function __construct(string|null|ConfigPropsInterface $props = null)
4038 }
4139 }
4240
41+ /**
42+ * Get config value
43+ *
44+ * @param string $key
45+ * @return mixed
46+ */
47+ public function get (string $ key ): mixed
48+ {
49+ return $ this ->props ->{$ key };
50+ }
51+
52+ /**
53+ * Check if config prop exists
54+ *
55+ * @param string $key
56+ * @return bool
57+ */
58+ public function has (string $ key ): bool
59+ {
60+ return isset ($ this ->props ->{$ key });
61+ }
62+
4363 /**
4464 * Get instance of ConfigProps
4565 *
You can’t perform that action at this time.
0 commit comments