@@ -89,24 +89,15 @@ protected function displayResults(): void
8989 if (empty ($ schemaErrors )) {
9090 $ this ->line ('<info> No top-level schema errors found</info> ' );
9191 } else {
92- $ this ->line (sprintf (' <fg=red>Found %s top-level schema errors:</> ' , count ($ schemaErrors )));
93- foreach ($ schemaErrors as $ error ) {
94- $ this ->line (sprintf (' <fg=red>%s</> <comment>%s</comment> ' , self ::CROSS_MARK , $ error ));
95- }
92+ $ this ->displayTopLevelSchemaErrors ($ schemaErrors );
9693 }
9794
9895 $ schemaFields = $ errors ['fields ' ];
9996 if (empty (array_filter ($ schemaFields ))) {
10097 $ this ->line ('<info> No field-level schema errors found</info> ' );
10198 } else {
10299 $ this ->newLine ();
103- $ this ->line (sprintf (' <fg=red>Found errors in %s field definitions:</> ' , count ($ schemaFields )));
104- foreach ($ schemaFields as $ fieldNumber => $ fieldErrors ) {
105- $ this ->line (sprintf (' <fg=cyan>Field #%s:</> ' , $ fieldNumber + 1 ));
106- foreach ($ fieldErrors as $ error ) {
107- $ this ->line (sprintf (' <fg=red>%s</> <comment>%s</comment> ' , self ::CROSS_MARK , $ error ));
108- }
109- }
100+ $ this ->displayFieldDefinitionErrors ($ schemaFields );
110101 }
111102
112103 if (next ($ this ->results )) {
@@ -115,6 +106,25 @@ protected function displayResults(): void
115106 }
116107 }
117108
109+ protected function displayTopLevelSchemaErrors (array $ schemaErrors ): void
110+ {
111+ $ this ->line (sprintf (' <fg=red>Found %s top-level schema errors:</> ' , count ($ schemaErrors )));
112+ foreach ($ schemaErrors as $ error ) {
113+ $ this ->line (sprintf (' <fg=red>%s</> <comment>%s</comment> ' , self ::CROSS_MARK , $ error ));
114+ }
115+ }
116+
117+ protected function displayFieldDefinitionErrors (array $ schemaFields ): void
118+ {
119+ $ this ->line (sprintf (' <fg=red>Found errors in %s field definitions:</> ' , count ($ schemaFields )));
120+ foreach ($ schemaFields as $ fieldNumber => $ fieldErrors ) {
121+ $ this ->line (sprintf (' <fg=cyan>Field #%s:</> ' , $ fieldNumber + 1 ));
122+ foreach ($ fieldErrors as $ error ) {
123+ $ this ->line (sprintf (' <fg=red>%s</> <comment>%s</comment> ' , self ::CROSS_MARK , $ error ));
124+ }
125+ }
126+ }
127+
118128 protected function outputSummary ($ timeStart ): void
119129 {
120130 $ this ->newLine ();
0 commit comments