From 9e3b62263f9fdfa84fbdc58dcd42dedb8a81b587 Mon Sep 17 00:00:00 2001 From: Norman <3585653+normanlolx@users.noreply.github.com> Date: Wed, 9 Apr 2025 11:51:15 +0200 Subject: [PATCH] Double escape \n in doc string Noticed `\Drupal ode\Entity\Node::load(1);` on https://www.drush.org/latest/commands/php_eval/ --- src/Commands/core/PhpCommands.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/core/PhpCommands.php b/src/Commands/core/PhpCommands.php index 4ea8a0390f..e62cc9bbbf 100644 --- a/src/Commands/core/PhpCommands.php +++ b/src/Commands/core/PhpCommands.php @@ -24,7 +24,7 @@ final class PhpCommands extends DrushCommands implements StdinAwareInterface */ #[CLI\Command(name: self::EVAL, aliases: ['eval', 'ev', 'php-eval'])] #[CLI\Argument(name: 'code', description: 'PHP code. If shell escaping gets too tedious, consider using the php:script command.')] - #[CLI\Usage(name: "drush php:eval '\$node = \Drupal\node\Entity\Node::load(1); print \$node->getTitle();'", description: 'Loads node with nid 1 and then prints its title.')] + #[CLI\Usage(name: "drush php:eval '\$node = \Drupal\\node\Entity\Node::load(1); print \$node->getTitle();'", description: 'Loads node with nid 1 and then prints its title.')] #[CLI\Usage(name: 'drush php:eval "\Drupal::service(\'file_system\')->copy(\'$HOME/Pictures/image.jpg\', \'public://image.jpg\');"', description: 'Copies a file whose path is determined by an environment\'s variable. Use of double quotes so the variable $HOME gets replaced by its value.')] #[CLI\Usage(name: 'drush php:eval "node_access_rebuild();"', description: 'Rebuild node access permissions.')] #[CLI\Bootstrap(level: DrupalBootLevels::MAX)]