@@ -112,44 +112,6 @@ public static function table(BenchResult $result): string
112112 return \implode ("\n" , $ lines ) . self ::recommendations ($ result );
113113 }
114114
115- private static function recommendations (BenchResult $ result ): string
116- {
117- $ dangers = [];
118- $ warnings = [];
119- $ notices = [];
120-
121- foreach ($ result ->lines as $ line ) {
122- foreach ($ line ->reports as $ report ) {
123- match ($ report ->severity ) {
124- Severity::Danger => $ dangers [$ report ->reason ] = $ report ->advice ,
125- Severity::Warning => $ warnings [$ report ->reason ] = $ report ->advice ,
126- Severity::Notice => $ notices [$ report ->reason ] = $ report ->advice ,
127- default => null ,
128- };
129- }
130- }
131-
132- if ($ dangers === [] && $ warnings === [] && $ notices === []) {
133- return '' ;
134- }
135-
136- $ lines = ['' , 'Recommendations: ' ];
137-
138- foreach ($ dangers as $ reason => $ advice ) {
139- $ lines [] = " ✗ {$ reason }: {$ advice }" ;
140- }
141-
142- foreach ($ warnings as $ reason => $ advice ) {
143- $ lines [] = " ⚠ {$ reason }: {$ advice }" ;
144- }
145-
146- foreach ($ notices as $ reason => $ advice ) {
147- $ lines [] = " ℹ {$ reason }: {$ advice }" ;
148- }
149-
150- return \implode ("\n" , $ lines );
151- }
152-
153115 public static function rounds (BenchResult $ result ): string
154116 {
155117 if ($ result ->cases === []) {
@@ -190,6 +152,44 @@ public static function rounds(BenchResult $result): string
190152 return \implode ("\n" , $ lines );
191153 }
192154
155+ private static function recommendations (BenchResult $ result ): string
156+ {
157+ $ dangers = [];
158+ $ warnings = [];
159+ $ notices = [];
160+
161+ foreach ($ result ->lines as $ line ) {
162+ foreach ($ line ->reports as $ report ) {
163+ match ($ report ->severity ) {
164+ Severity::Danger => $ dangers [$ report ->reason ] = $ report ->advice ,
165+ Severity::Warning => $ warnings [$ report ->reason ] = $ report ->advice ,
166+ Severity::Notice => $ notices [$ report ->reason ] = $ report ->advice ,
167+ default => null ,
168+ };
169+ }
170+ }
171+
172+ if ($ dangers === [] && $ warnings === [] && $ notices === []) {
173+ return '' ;
174+ }
175+
176+ $ lines = ['' , 'Recommendations: ' ];
177+
178+ foreach ($ dangers as $ reason => $ advice ) {
179+ $ lines [] = " ✗ {$ reason }: {$ advice }" ;
180+ }
181+
182+ foreach ($ warnings as $ reason => $ advice ) {
183+ $ lines [] = " ⚠ {$ reason }: {$ advice }" ;
184+ }
185+
186+ foreach ($ notices as $ reason => $ advice ) {
187+ $ lines [] = " ℹ {$ reason }: {$ advice }" ;
188+ }
189+
190+ return \implode ("\n" , $ lines );
191+ }
192+
193193 private static function formatMemory (float $ bytes ): string
194194 {
195195 if ($ bytes === 0.0 ) {
0 commit comments