This repository was archived by the owner on Aug 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,6 +88,22 @@ public function fusionPath(AbstractFusionObject $fusionObject): string
8888 return $ pathReflectionProperty ->getValue ($ fusionObject );
8989 }
9090
91+ /**
92+ * @return void
93+ */
94+ public function exit (): void
95+ {
96+ exit ($ this ->buffer );
97+ }
98+
99+ /**
100+ * @return void
101+ */
102+ public function die (): void
103+ {
104+ die ($ this ->buffer );
105+ }
106+
91107 /**
92108 * @return string
93109 */
Original file line number Diff line number Diff line change 22
33> Provides simple methods to debug stuff in Fusion
44
5+ This package allows you to debug values in fusion as simple as:
6+
7+ ``` fusion
8+ debug = ${Debug.var_dump(node).var_dump(request).die()}
9+ ```
510
611## ⚠⚠⚠ Still under development ⚠⚠⚠
712
@@ -107,6 +112,24 @@ fusionPath = ${Debug.var_dump(Debug.fusionPath(this))}
107112
108113* ** $fusionObject : AbstractFusionObject** - The fusion object to get the fusion path from (when in doubt, use ` this ` )
109114
115+ ## Interrupting program execution
116+
117+ ### exit
118+
119+ You can use ` Debug.exit() ` to stop execution of the PHP Script entirely (just as with the ` exit ` function of the PHP standard library).
120+
121+ ` Debug.exit() ` takes no parameters.
122+
123+ ` Debug.exit() ` can be used in any chain of ` Debug.var_dump(...) ` , ` Debug.print_r(...) ` , ` Debug.var_export(...) ` or ` Debug.xdebug_var_dump(...) ` calls:
124+
125+ ``` fusion
126+ debug = ${Debug.var_dump(node).var_dump(request).die()}
127+ ```
128+
129+ ### die
130+
131+ ` Debug.die() ` is an alias for ` Debug.exit() ` .
132+
110133## Contribution
111134
112135We will gladly accept contributions. Please send us pull requests.
You can’t perform that action at this time.
0 commit comments