Test Failed
Push — master ( 749776...d0ccd8 )
by Derek Stephen
02:24
created
src/Command/RouterTreeCommand.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $this->setDescription('Display all routes in a tree display');
40 40
         $this->setHelp('List all routes in a hierarchical tree');
41
-        $this->addOption('space', 's', InputOption::VALUE_NONE,'display with more space');
41
+        $this->addOption('space', 's', InputOption::VALUE_NONE, 'display with more space');
42 42
     }
43 43
 
44 44
     public function execute(InputInterface $input, OutputInterface $output): int
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         }
54 54
 
55 55
         $routes = $this->router->getRoutes();
56
-        $sort = function (Route $a, Route $b) {
56
+        $sort = function(Route $a, Route $b) {
57 57
             return $a->getPath() <=> $b->getPath();
58 58
         };
59 59
         usort($routes, $sort);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
         foreach ($paths as $method => $methodPaths) {
67 67
 
68
-            $io->info($method . ' paths:');
68
+            $io->info($method.' paths:');
69 69
             $tree = $this->buildTree($methodPaths);
70 70
             $method === 'GET' ? array_shift($tree) : null;
71 71
             $output->writeln('/');
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
         $totalKeys = count($keys);
101 101
 
102 102
         foreach ($keys as $index => $key) {
103
-            if ($index === 0  && $this->spacing === true) {
104
-                $output->writeln($indent . '|');
103
+            if ($index === 0 && $this->spacing === true) {
104
+                $output->writeln($indent.'|');
105 105
             }
106 106
 
107
-            $output->write($indent . '|_ ' . $key);
107
+            $output->write($indent.'|_ '.$key);
108 108
 
109 109
             // Check if this node has only one child, in which case we collapse it
110 110
             $useChild = false;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             if (count($tree[$key]) == 1) {
113 113
                 // Find the only child node and print it directly without further recursion
114 114
                 $child = array_keys($tree[$key])[0];
115
-                $output->write( '/' . $child);
115
+                $output->write('/'.$child);
116 116
                 $useChild = true;
117 117
             }
118 118
 
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
 
122 122
             // Recursively print the subtree, adjusting the indentation
123 123
             if (!empty($node) && count($node) > 1) {
124
-                $newIndent = $index + 1 === $totalKeys ? $indent . '   ' : $indent . '|  ';
124
+                $newIndent = $index + 1 === $totalKeys ? $indent.'   ' : $indent.'|  ';
125 125
                 $this->printTree($node, $output, $newIndent);
126 126
             }
127 127
 
128 128
             // If there's another sibling node, print '|'
129 129
             if ($index < $totalKeys - 1 && $this->spacing === true) {
130
-                $output->write($indent . '| ' . "\n");  // Adjusts the visual output with proper spacing
130
+                $output->write($indent.'| '."\n"); // Adjusts the visual output with proper spacing
131 131
             }
132 132
         }
133 133
     }
Please login to merge, or discard this patch.