Author: Andreas Möller (localheinz)
Committer: GitHub (web-flow)
Pusher: cmb69
Date: 2022-08-22T16:59:10+02:00

Commit: 
https://github.com/php/web-php/commit/cdb83249d347d44242556130545ce8ac35a34bcc
Raw diff: 
https://github.com/php/web-php/commit/cdb83249d347d44242556130545ce8ac35a34bcc.diff

Enhancement: Enable `switch_case_space` fixer

Closes GH-669.

Changed paths:
  M  .php-cs-fixer.php
  M  error.php
  M  include/langchooser.inc


Diff:

diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index 23093302f..4769fa7f7 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -28,6 +28,7 @@
         'ordered_class_elements' => true,
         'single_space_after_construct' => true,
         'strict_param' => true,
+        'switch_case_space' => true,
         'trim_array_spaces' => true,
         'visibility_required' => true,
         'whitespace_after_comma_in_array' => true,
diff --git a/error.php b/error.php
index ce3af870b..7f3a2c8b0 100644
--- a/error.php
+++ b/error.php
@@ -122,9 +122,13 @@
 // Some nice URLs for getting something for download
 if (preg_match("!^get/([^/]+)$!", $URI, $what)) {
     switch ($what[1]) {
-        case "php"           : $URI = "downloads"; break;
-        case "docs"          : // intentional
-        case "documentation" : $URI = "download-docs"; break;
+        case "php":
+            $URI = "downloads";
+            break;
+        case "docs": // intentional
+        case "documentation":
+            $URI = "download-docs";
+            break;
     }
 }
 
diff --git a/include/langchooser.inc b/include/langchooser.inc
index 9b6cd8a0e..8f7fddb99 100644
--- a/include/langchooser.inc
+++ b/include/langchooser.inc
@@ -122,10 +122,18 @@ function language_choose_code()
 
         // Translation table for accept-language codes and phpdoc codes
         switch ($langdata[0]) {
-            case "pt-br" : $langdata[0] = 'pt_br'; break;
-            case "zh-cn" : $langdata[0] = 'zh'; break;
-            case "zh-hk" : $langdata[0] = 'hk'; break;
-            case "zh-tw" : $langdata[0] = 'tw'; break;
+            case "pt-br":
+                $langdata[0] = 'pt_br';
+                break;
+            case "zh-cn":
+                $langdata[0] = 'zh';
+                break;
+            case "zh-hk":
+                $langdata[0] = 'hk';
+                break;
+            case "zh-tw":
+                $langdata[0] = 'tw';
+                break;
         }
 
         // We do not support flavors of languages (except the ones above)

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to