16a54f92f7520ca5c50a49e64619640a868b6975
[yaffs-website] / vendor / drupal / console / src / Command / Config / PrintConfigValidationTrait.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\Console\Command\Config\PrintConfigValidationTrait.
6  */
7
8 namespace Drupal\Console\Command\Config;
9
10 use Drupal\Console\Core\Style\DrupalStyle;
11
12 trait PrintConfigValidationTrait
13 {
14     protected function printResults($valid, DrupalStyle $io)
15     {
16         if ($valid === true) {
17             $io->info($this->trans('commands.config.validate.messages.success'));
18             return 0;
19         }
20
21         foreach ($valid as $key => $error) {
22             $io->warning($key . ': ' . $error);
23         }
24         return 1;
25     }
26 }