File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -120,14 +120,19 @@ public static function wait(callable $logHandler = null)
120120 * @param null $argv <p>
121121 * Be sure to import $argv[1] to get the parameters of script execution.
122122 * </p>
123- * @return mixed| null
123+ * @return mixed if key is null or sth can found in params | null if no args input | false If there is no corresponding key here
124124 */
125- public static function getArgs ($ argv = null )
125+ public static function getArgs ($ argv = null , $ key = null )
126126 {
127127 if ($ argv == null ) {
128128 return null ;
129129 }
130- return json_decode (base64_decode ($ argv ), 1 );
130+ $ params = json_decode (base64_decode ($ argv ), 1 );
131+ if ($ key == null ) {
132+ return $ params ;
133+ }
134+ return isset ($ params [$ key ]) ? $ params [$ key ] : false ;
135+
131136 }
132137
133138 public static function getReturn ($ return )
You can’t perform that action at this time.
0 commit comments