@@ -572,7 +572,7 @@ protected function commandStartingHandler(CommandStarting $event)
572
572
'artisan.command ' ,
573
573
'Starting Artisan command: ' . $ event ->command ,
574
574
[
575
- 'input ' => $ this ->extractCommandInput ($ event ->input ),
575
+ 'input ' => $ this ->extractConsoleCommandInput ($ event ->input ),
576
576
]
577
577
));
578
578
}
@@ -593,21 +593,27 @@ protected function commandFinishedHandler(CommandFinished $event)
593
593
'Finished Artisan command: ' . $ event ->command ,
594
594
[
595
595
'exit ' => $ event ->exitCode ,
596
- 'input ' => $ this ->extractCommandInput ($ event ->input ),
596
+ 'input ' => $ this ->extractConsoleCommandInput ($ event ->input ),
597
597
]
598
598
));
599
599
}
600
600
601
- Integration::configureScope (static function (Scope $ scope ): void {
602
- $ scope ->setTag ('command ' , '' );
603
- });
604
-
605
601
// Flush any and all events that were possibly generated by the command
606
602
Integration::flushEvents ();
603
+
604
+ Integration::configureScope (static function (Scope $ scope ): void {
605
+ $ scope ->removeTag ('command ' );
606
+ });
607
607
}
608
608
609
- /** @return string|null */
610
- private function extractCommandInput (InputInterface $ input )
609
+ /**
610
+ * Extract the command input arguments if possible.
611
+ *
612
+ * @param \Symfony\Component\Console\Input\InputInterface|null $input
613
+ *
614
+ * @return string|null
615
+ */
616
+ private function extractConsoleCommandInput (?InputInterface $ input ): ?string
611
617
{
612
618
if ($ input instanceof ArgvInput) {
613
619
return (string )$ input ;
0 commit comments