Add function for getting the current numeric shell verbosity

by @Saggre

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

curl https://fabbot.io/patch/symfony/symfony/48942/6f883aaa0e4a40461a15cc7f569b4595dd8893d3/cs.diff | patch -p0
diff -ru src/Symfony/Component/Console/Application.php src/Symfony/Component/Console/Application.php
--- src/Symfony/Component/Console/Application.php	2023-02-07 12:24:53.779960797 +0000
+++ src/Symfony/Component/Console/Application.php	2023-02-07 12:25:05.306388047 +0000
@@ -918,7 +918,7 @@
             return 1;
         }
 
-        return (int)getenv('SHELL_VERBOSITY');
+        return (int) getenv('SHELL_VERBOSITY');
     }
 
     /**
diff -ru src/Symfony/Component/Console/Tests/ApplicationTest.php src/Symfony/Component/Console/Tests/ApplicationTest.php
--- src/Symfony/Component/Console/Tests/ApplicationTest.php	2023-02-07 12:24:54.240977886 +0000
+++ src/Symfony/Component/Console/Tests/ApplicationTest.php	2023-02-07 12:25:23.065046305 +0000
@@ -510,12 +510,12 @@
         $tester = new ApplicationTester($application);
         $tester->run(['command' => 'foos:bar1'], ['decorated' => false]);
         $this->assertSame('
-                                                          
-  There are no commands defined in the "foos" namespace.  
-                                                          
-  Did you mean this?                                      
-      foo                                                 
-                                                          
+
+  There are no commands defined in the "foos" namespace.
+
+  Did you mean this?
+      foo
+
 
 ', $tester->getDisplay(true));
     }
@@ -1818,7 +1818,7 @@
     public function testGetShellVerbosity($expected, $input)
     {
         $application = new Application();
-        $input = is_callable($input) ? $input() : $input;
+        $input = \is_callable($input) ? $input() : $input;
         $this->assertSame($expected, $application->getShellVerbosity(new ArrayInput($input)));
     }
 

0
Common Typos

0
License Headers

0
Pull Request Contributor Headers

0
File Permissions

0
Merge Commits

0
Exception Messages Formatting

0
Usage of void in test files

0
Use ::class whenever possible

0
Deprecation Messages