diff vendor/squizlabs/php_codesniffer/tests/bootstrap.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/vendor/squizlabs/php_codesniffer/tests/bootstrap.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/vendor/squizlabs/php_codesniffer/tests/bootstrap.php	Thu May 09 15:34:47 2019 +0100
@@ -52,17 +52,33 @@
  */
 function printPHPCodeSnifferTestOutput()
 {
+    echo PHP_EOL.PHP_EOL;
+
+    $output = 'The test files';
+    $data   = [];
+
     $codeCount = count($GLOBALS['PHP_CODESNIFFER_SNIFF_CODES']);
-    $files     = call_user_func_array('array_merge', $GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES']);
-    $files     = array_unique($files);
-    $fileCount = count($files);
+    if (empty($GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES']) === false) {
+        $files     = call_user_func_array('array_merge', $GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES']);
+        $files     = array_unique($files);
+        $fileCount = count($files);
 
-    echo PHP_EOL.PHP_EOL;
-    echo "$fileCount sniff test files generated $codeCount unique error codes";
+        $output = '%d sniff test files';
+        $data[] = $fileCount;
+    }
+
+    $output .= ' generated %d unique error codes';
+    $data[]  = $codeCount;
+
     if ($codeCount > 0) {
         $fixes   = count($GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES']);
         $percent = round(($fixes / $codeCount * 100), 2);
-        echo "; $fixes were fixable ($percent%)";
+
+        $output .= '; %d were fixable (%d%%)';
+        $data[]  = $fixes;
+        $data[]  = $percent;
     }
 
+    vprintf($output, $data);
+
 }//end printPHPCodeSnifferTestOutput()