Completed
Branch dev-v3 (d0b49e)
by Propa
01:27
created
src/Traits/ParsesTypes.php 2 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -7,74 +7,74 @@
 block discarded – undo
7 7
 
8 8
 trait ParsesTypes
9 9
 {
10
-    /**
11
-     * Array of available phone types.
12
-     *
13
-     * @var array
14
-     */
15
-    protected static $types;
10
+	/**
11
+	 * Array of available phone types.
12
+	 *
13
+	 * @var array
14
+	 */
15
+	protected static $types;
16 16
 
17
-    /**
18
-     * Determine whether the given type is valid.
19
-     *
20
-     * @param string $type
21
-     * @return bool
22
-     */
23
-    public static function isValidType($type)
24
-    {
25
-        return ! empty(static::parseTypes($type));
26
-    }
17
+	/**
18
+	 * Determine whether the given type is valid.
19
+	 *
20
+	 * @param string $type
21
+	 * @return bool
22
+	 */
23
+	public static function isValidType($type)
24
+	{
25
+		return ! empty(static::parseTypes($type));
26
+	}
27 27
 
28
-    /**
29
-     * Parse a phone type into constant's value.
30
-     *
31
-     * @param string|array $types
32
-     * @return array
33
-     */
34
-    protected static function parseTypes($types)
35
-    {
36
-        static::loadTypes();
28
+	/**
29
+	 * Parse a phone type into constant's value.
30
+	 *
31
+	 * @param string|array $types
32
+	 * @return array
33
+	 */
34
+	protected static function parseTypes($types)
35
+	{
36
+		static::loadTypes();
37 37
 
38
-        return Collection::make(is_array($types) ? $types : func_get_args())
39
-                         ->map(function ($type) {
40
-                             // If the type equals a constant's value, just return it.
41
-                             if (in_array($type, static::$types, true)) {
42
-                                 return $type;
43
-                             }
38
+		return Collection::make(is_array($types) ? $types : func_get_args())
39
+						 ->map(function ($type) {
40
+							 // If the type equals a constant's value, just return it.
41
+							 if (in_array($type, static::$types, true)) {
42
+								 return $type;
43
+							 }
44 44
 
45
-                             // Otherwise we'll assume the type is the constant's name.
46
-                             return Arr::get(static::$types, strtoupper($type));
47
-                         })
48
-                         ->reject(function ($value) {
49
-                             return is_null($value) || $value === false;
50
-                         })->toArray();
51
-    }
45
+							 // Otherwise we'll assume the type is the constant's name.
46
+							 return Arr::get(static::$types, strtoupper($type));
47
+						 })
48
+						 ->reject(function ($value) {
49
+							 return is_null($value) || $value === false;
50
+						 })->toArray();
51
+	}
52 52
 
53
-    /**
54
-     * Parse a phone type into its string representation.
55
-     *
56
-     * @param string|array $types
57
-     * @return array
58
-     */
59
-    protected static function parseTypesAsStrings($types)
60
-    {
61
-        static::loadTypes();
53
+	/**
54
+	 * Parse a phone type into its string representation.
55
+	 *
56
+	 * @param string|array $types
57
+	 * @return array
58
+	 */
59
+	protected static function parseTypesAsStrings($types)
60
+	{
61
+		static::loadTypes();
62 62
 
63
-        return array_keys(
64
-            array_intersect(
65
-                static::$types,
66
-                static::parseTypes($types)
67
-            )
68
-        );
69
-    }
63
+		return array_keys(
64
+			array_intersect(
65
+				static::$types,
66
+				static::parseTypes($types)
67
+			)
68
+		);
69
+	}
70 70
 
71
-    /**
72
-     * Load all available formats once.
73
-     */
74
-    private static function loadTypes()
75
-    {
76
-        if (! static::$types) {
77
-            static::$types = with(new ReflectionClass(PhoneNumberType::class))->getConstants();
78
-        }
79
-    }
71
+	/**
72
+	 * Load all available formats once.
73
+	 */
74
+	private static function loadTypes()
75
+	{
76
+		if (! static::$types) {
77
+			static::$types = with(new ReflectionClass(PhoneNumberType::class))->getConstants();
78
+		}
79
+	}
80 80
 }
81 81
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public static function isValidType($type)
24 24
     {
25
-        return ! empty(static::parseTypes($type));
25
+        return !empty(static::parseTypes($type));
26 26
     }
27 27
 
28 28
     /**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         static::loadTypes();
37 37
 
38 38
         return Collection::make(is_array($types) ? $types : func_get_args())
39
-                         ->map(function ($type) {
39
+                         ->map(function($type) {
40 40
                              // If the type equals a constant's value, just return it.
41 41
                              if (in_array($type, static::$types, true)) {
42 42
                                  return $type;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                              // Otherwise we'll assume the type is the constant's name.
46 46
                              return Arr::get(static::$types, strtoupper($type));
47 47
                          })
48
-                         ->reject(function ($value) {
48
+                         ->reject(function($value) {
49 49
                              return is_null($value) || $value === false;
50 50
                          })->toArray();
51 51
     }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     private static function loadTypes()
75 75
     {
76
-        if (! static::$types) {
76
+        if (!static::$types) {
77 77
             static::$types = with(new ReflectionClass(PhoneNumberType::class))->getConstants();
78 78
         }
79 79
     }
Please login to merge, or discard this patch.
src/Traits/ParsesFormats.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -6,50 +6,50 @@
 block discarded – undo
6 6
 
7 7
 trait ParsesFormats
8 8
 {
9
-    /**
10
-     * Array of available phone formats.
11
-     *
12
-     * @var array
13
-     */
14
-    protected static $formats;
9
+	/**
10
+	 * Array of available phone formats.
11
+	 *
12
+	 * @var array
13
+	 */
14
+	protected static $formats;
15 15
 
16
-    /**
17
-     * Determine whether the given format is valid.
18
-     *
19
-     * @param string $format
20
-     * @return bool
21
-     */
22
-    public static function isValidFormat($format)
23
-    {
24
-        return ! is_null(static::parseFormat($format));
25
-    }
16
+	/**
17
+	 * Determine whether the given format is valid.
18
+	 *
19
+	 * @param string $format
20
+	 * @return bool
21
+	 */
22
+	public static function isValidFormat($format)
23
+	{
24
+		return ! is_null(static::parseFormat($format));
25
+	}
26 26
 
27
-    /**
28
-     * Parse a phone format.
29
-     *
30
-     * @param string $format
31
-     * @return string
32
-     */
33
-    protected static function parseFormat($format)
34
-    {
35
-        static::loadFormats();
27
+	/**
28
+	 * Parse a phone format.
29
+	 *
30
+	 * @param string $format
31
+	 * @return string
32
+	 */
33
+	protected static function parseFormat($format)
34
+	{
35
+		static::loadFormats();
36 36
 
37
-        // If the format equals a constant's value, just return it.
38
-        if (in_array($format, static::$formats, true)) {
39
-            return $format;
40
-        }
37
+		// If the format equals a constant's value, just return it.
38
+		if (in_array($format, static::$formats, true)) {
39
+			return $format;
40
+		}
41 41
 
42
-        // Otherwise we'll assume the format is the constant's name.
43
-        return Arr::get(static::$formats, strtoupper($format));
44
-    }
42
+		// Otherwise we'll assume the format is the constant's name.
43
+		return Arr::get(static::$formats, strtoupper($format));
44
+	}
45 45
 
46
-    /**
47
-     * Load all available formats once.
48
-     */
49
-    private static function loadFormats()
50
-    {
51
-        if (! static::$formats) {
52
-            static::$formats = with(new ReflectionClass(PhoneNumberFormat::class))->getConstants();
53
-        }
54
-    }
46
+	/**
47
+	 * Load all available formats once.
48
+	 */
49
+	private static function loadFormats()
50
+	{
51
+		if (! static::$formats) {
52
+			static::$formats = with(new ReflectionClass(PhoneNumberFormat::class))->getConstants();
53
+		}
54
+	}
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public static function isValidFormat($format)
23 23
     {
24
-        return ! is_null(static::parseFormat($format));
24
+        return !is_null(static::parseFormat($format));
25 25
     }
26 26
 
27 27
     /**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     private static function loadFormats()
50 50
     {
51
-        if (! static::$formats) {
51
+        if (!static::$formats) {
52 52
             static::$formats = with(new ReflectionClass(PhoneNumberFormat::class))->getConstants();
53 53
         }
54 54
     }
Please login to merge, or discard this patch.