Completed
Push — master ( 50e3b5...fbe966 )
by Josh
02:25
created
src/Input/Utf8.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -11,52 +11,52 @@
 block discarded – undo
11 11
 
12 12
 class Utf8 implements InputInterface
13 13
 {
14
-	/**
15
-	* {@inheritdoc}
16
-	*/
17
-	public function split($string)
18
-	{
19
-		if (preg_match_all('(.)us', $string, $matches) === false)
20
-		{
21
-			throw new InvalidArgumentException('Invalid UTF-8 string');
22
-		}
14
+    /**
15
+     * {@inheritdoc}
16
+     */
17
+    public function split($string)
18
+    {
19
+        if (preg_match_all('(.)us', $string, $matches) === false)
20
+        {
21
+            throw new InvalidArgumentException('Invalid UTF-8 string');
22
+        }
23 23
 
24
-		return $this->charsToCodepoints($matches[0]);
25
-	}
24
+        return $this->charsToCodepoints($matches[0]);
25
+    }
26 26
 
27
-	/**
28
-	* Convert a list of UTF-8 characters to a list of Unicode codepoint
29
-	*
30
-	* @param  string[]  $chars
31
-	* @return integer[]
32
-	*/
33
-	protected function charsToCodepoints(array $chars)
34
-	{
35
-		return array_map([$this, 'cp'], $chars);
36
-	}
27
+    /**
28
+     * Convert a list of UTF-8 characters to a list of Unicode codepoint
29
+     *
30
+     * @param  string[]  $chars
31
+     * @return integer[]
32
+     */
33
+    protected function charsToCodepoints(array $chars)
34
+    {
35
+        return array_map([$this, 'cp'], $chars);
36
+    }
37 37
 
38
-	/**
39
-	* Compute and return the Unicode codepoint for given UTF-8 char
40
-	*
41
-	* @param  string  $char UTF-8 char
42
-	* @return integer
43
-	*/
44
-	protected function cp($char)
45
-	{
46
-		$cp = ord($char[0]);
47
-		if ($cp >= 0xF0)
48
-		{
49
-			$cp = ($cp << 18) + (ord($char[1]) << 12) + (ord($char[2]) << 6) + ord($char[3]) - 0x3C82080;
50
-		}
51
-		elseif ($cp >= 0xE0)
52
-		{
53
-			$cp = ($cp << 12) + (ord($char[1]) << 6) + ord($char[2]) - 0xE2080;
54
-		}
55
-		elseif ($cp >= 0xC0)
56
-		{
57
-			$cp = ($cp << 6) + ord($char[1]) - 0x3080;
58
-		}
38
+    /**
39
+     * Compute and return the Unicode codepoint for given UTF-8 char
40
+     *
41
+     * @param  string  $char UTF-8 char
42
+     * @return integer
43
+     */
44
+    protected function cp($char)
45
+    {
46
+        $cp = ord($char[0]);
47
+        if ($cp >= 0xF0)
48
+        {
49
+            $cp = ($cp << 18) + (ord($char[1]) << 12) + (ord($char[2]) << 6) + ord($char[3]) - 0x3C82080;
50
+        }
51
+        elseif ($cp >= 0xE0)
52
+        {
53
+            $cp = ($cp << 12) + (ord($char[1]) << 6) + ord($char[2]) - 0xE2080;
54
+        }
55
+        elseif ($cp >= 0xC0)
56
+        {
57
+            $cp = ($cp << 6) + ord($char[1]) - 0x3080;
58
+        }
59 59
 
60
-		return $cp;
61
-	}
60
+        return $cp;
61
+    }
62 62
 }
63 63
\ No newline at end of file
Please login to merge, or discard this patch.