From 52d41e45cae7e30a82eb69e3ff035381bb7b97c5 Mon Sep 17 00:00:00 2001 From: Milana Cap Date: Tue, 6 Jun 2023 09:00:03 +0200 Subject: [PATCH 1/3] Update EvalFile_Command.php 1. Note that arguments are positional. 2. Example is not visible in the docs. Fix formatting. --- src/EvalFile_Command.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/EvalFile_Command.php b/src/EvalFile_Command.php index e5e48947..d52f1fd2 100644 --- a/src/EvalFile_Command.php +++ b/src/EvalFile_Command.php @@ -23,7 +23,7 @@ class EvalFile_Command extends WP_CLI_Command { * : The path to the PHP file to execute. Use '-' to run code from STDIN. * * [...] - * : One or more arguments to pass to the file. They are placed in the $args variable. + * : One or more positional arguments to pass to the file. They are placed in the $args variable. * * [--skip-wordpress] * : Load and execute file without loading WordPress. @@ -35,7 +35,11 @@ class EvalFile_Command extends WP_CLI_Command { * * ## EXAMPLES * - * wp eval-file my-code.php value1 value2 + * # Execute file my-code.php and pass value1 and value2 arguments. + * # Access arguments in $args array ($args[0] = value1, $args[1] = value2). + * $ wp eval-file my-code.php value1 value2 + * + * @package wp-cli */ public function __invoke( $args, $assoc_args ) { $file = array_shift( $args ); From ecd33d9dce25a9bf969abc14704c2cec3274fa96 Mon Sep 17 00:00:00 2001 From: Milana Cap Date: Fri, 9 Jun 2023 11:17:52 +0300 Subject: [PATCH 2/3] Update EvalFile_Command.php --- src/EvalFile_Command.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/EvalFile_Command.php b/src/EvalFile_Command.php index d52f1fd2..bb5f9cc3 100644 --- a/src/EvalFile_Command.php +++ b/src/EvalFile_Command.php @@ -38,8 +38,6 @@ class EvalFile_Command extends WP_CLI_Command { * # Execute file my-code.php and pass value1 and value2 arguments. * # Access arguments in $args array ($args[0] = value1, $args[1] = value2). * $ wp eval-file my-code.php value1 value2 - * - * @package wp-cli */ public function __invoke( $args, $assoc_args ) { $file = array_shift( $args ); From 8efcbe18cd654dd291450c59461e03718c9db353 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Fri, 9 Jun 2023 04:59:44 -0700 Subject: [PATCH 3/3] Fix PHPCS errors --- src/EvalFile_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EvalFile_Command.php b/src/EvalFile_Command.php index bb5f9cc3..192ae8bc 100644 --- a/src/EvalFile_Command.php +++ b/src/EvalFile_Command.php @@ -35,7 +35,7 @@ class EvalFile_Command extends WP_CLI_Command { * * ## EXAMPLES * - * # Execute file my-code.php and pass value1 and value2 arguments. + * # Execute file my-code.php and pass value1 and value2 arguments. * # Access arguments in $args array ($args[0] = value1, $args[1] = value2). * $ wp eval-file my-code.php value1 value2 */