Test Failed
Push — master ( db6a84...9ff342 )
by Marcio
04:27 queued 12s
created
src/Ballybran/Helpers/Utility/Ucfirst.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -93,10 +93,10 @@
 block discarded – undo
93 93
     }
94 94
 
95 95
     /**
96
-    * example removeAccentsIstring( "Õ") output "O"
97
-    * @param string $string
98
-    * @return string
99
-	*/
96
+     * example removeAccentsIstring( "Õ") output "O"
97
+     * @param string $string
98
+     * @return string
99
+     */
100 100
     public static function removeAccentsIstring($string) : string
101 101
     {
102 102
         return preg_replace(array("/(á|à|ã|â|ä)/", "/(Á|À|Ã|Â|Ä)/", "/(é|è|ê|ë)/", "/(É|È|Ê|Ë)/", "/(í|ì|î|ï)/", "/(Í|Ì|Î|Ï)/", "/(ó|ò|õ|ô|ö)/", "/(Ó|Ò|Õ|Ô|Ö)/", "/(ú|ù|û|ü)/", "/(Ú|Ù|Û|Ü)/", "/(ñ)/", "/(Ñ)/", "/(ç)/", "/(Ç)/"), explode(" ", "a A e E i I o O u U n N c C"), $string);
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,17 +73,22 @@
 block discarded – undo
73 73
         $characterDeficit = 0; //Gets incremented when an uppercase letter is encountered before $targetCharsPerWord characters have been collected since the last UC char.
74 74
         $wordIndex = $targetWordLength; //HACK: keeps track of how many characters have been carried into the abbreviation since the last UC char
75 75
         while ($stringIndex < strlen($strString)) {  //Process the whole input string...
76
-            if ($abbrevLength >= $targetLength)              //...unless the abbreviation has hit the target length cap
76
+            if ($abbrevLength >= $targetLength) {
77
+                //...unless the abbreviation has hit the target length cap
77 78
                 break;
79
+            }
78 80
             $currentChar = $strString[$stringIndex++]; //Grab a character from the string, advance the string cursor
79 81
             if (in_array($currentChar, $ucLetters)) {           //If handling a UC char, consider it a new word
80 82
                 $characterDeficit += $targetWordLength - $wordIndex; //If UC chars are closer together than targetWordLength, keeps track of how many extra characters are required to fit the target length of the abbreviation
81 83
                 $wordIndex = 0; //Set the wordIndex to reflect a new word
82 84
             } else if ($wordIndex >= $targetWordLength) {
83
-                if ($characterDeficit == 0)                //If the word is full and we're not short any characters, ignore the character
85
+                if ($characterDeficit == 0) {
86
+                    //If the word is full and we're not short any characters, ignore the character
84 87
                     continue;
85
-                else
86
-                    $characterDeficit--; //If we are short some characters, decrement the defecit and carry on with adding the character to the abbreviation
88
+                } else {
89
+                                    $characterDeficit--;
90
+                }
91
+                //If we are short some characters, decrement the defecit and carry on with adding the character to the abbreviation
87 92
             }
88 93
             $abbreviation .= $currentChar; //Add the character to the abbreviation
89 94
             $abbrevLength++; //Increment abbreviation length
Please login to merge, or discard this patch.