Completed
Push — master ( 0d75b5...ea1463 )
by angel
01:10
created
src/Hash.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -41,46 +41,46 @@
 block discarded – undo
41 41
     } //End constructor
42 42
 
43 43
     /**
44
-    * Hash a plain text password.
45
-    *
46
-    * @param string $password 	The plain text password to hash.
47
-    * @return string 			The hashed $password parameter.
48
-    */
44
+     * Hash a plain text password.
45
+     *
46
+     * @param string $password 	The plain text password to hash.
47
+     * @return string 			The hashed $password parameter.
48
+     */
49 49
     public function password($password)
50 50
     {
51 51
         return password_hash($password, $this->algo, ['cost' => $this->cost]);
52 52
     } //End password
53 53
 
54 54
     /**
55
-    * Check a password against it's hash.
56
-    *
57
-    * @param string $password 	Plain text password.
58
-    * @param string $hash 		Hashed password.
59
-    * @return bool 			 	True if they match, false otherwise.
60
-    */
55
+     * Check a password against it's hash.
56
+     *
57
+     * @param string $password 	Plain text password.
58
+     * @param string $hash 		Hashed password.
59
+     * @return bool 			 	True if they match, false otherwise.
60
+     */
61 61
     public function passwordCheck($password, $hash)
62 62
     {
63 63
         return password_verify($password, $hash);
64 64
     } //End password
65 65
 
66 66
     /**
67
-    * Use sha256 to hash an input string.
68
-    *
69
-    * @param string $input 	Plain text string to be hashed.
70
-    * @return string 		The hashed version of the $input string.
71
-    */
67
+     * Use sha256 to hash an input string.
68
+     *
69
+     * @param string $input 	Plain text string to be hashed.
70
+     * @return string 		The hashed version of the $input string.
71
+     */
72 72
     public function hash($input)
73 73
     {
74 74
         return hash('sha256', $input);
75 75
     } //End hash
76 76
 
77 77
     /**
78
-    * Check a hash against another.
79
-    *
80
-    * @param string $know 	 The hash we know is correct.
81
-    * @param string $unknown The hash we want to compare with it.
82
-    * @return bool 			 True if the hashed strings match, false otherwise.
83
-    */
78
+     * Check a hash against another.
79
+     *
80
+     * @param string $know 	 The hash we know is correct.
81
+     * @param string $unknown The hash we want to compare with it.
82
+     * @return bool 			 True if the hashed strings match, false otherwise.
83
+     */
84 84
     public function hashCheck($know, $unknown)
85 85
     {
86 86
         return hash_equals($know, $unknown);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     */
49 49
     public function password($password)
50 50
     {
51
-        return password_hash($password, $this->algo, ['cost' => $this->cost]);
51
+        return password_hash($password, $this->algo, [ 'cost' => $this->cost ]);
52 52
     } //End password
53 53
 
54 54
     /**
Please login to merge, or discard this patch.
src/SeoUrl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
     public static function removeAccent($str)
35 35
     {
36 36
         $first = [
37
-            'À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ø','ù','ú','û','ü','ý','ÿ','Ā','ā','Ă','ă','Ą','ą','Ć','ć','Ĉ','ĉ','Ċ','ċ','Č','č','Ď','ď','Đ','đ','Ē','ē','Ĕ','ĕ','Ė','ė','Ę','ę','Ě','ě','Ĝ','ĝ','Ğ','ğ','Ġ','ġ','Ģ','ģ','Ĥ','ĥ','Ħ','ħ','Ĩ','ĩ','Ī','ī','Ĭ','ĭ','Į','į','İ','ı','IJ','ij','Ĵ','ĵ','Ķ','ķ','Ĺ','ĺ','Ļ','ļ','Ľ','ľ','Ŀ','ŀ','Ł','ł','Ń','ń','Ņ','ņ','Ň','ň','ʼn','Ō','ō','Ŏ','ŏ','Ő','ő','Œ','œ','Ŕ','ŕ','Ŗ','ŗ','Ř','ř','Ś','ś','Ŝ','ŝ','Ş','ş','Š','š','Ţ','ţ','Ť','ť','Ŧ','ŧ','Ũ','ũ','Ū','ū','Ŭ','ŭ','Ů','ů','Ű','ű','Ų','ų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Ŗ', 'ŗ', 'Ř', 'ř', 'Ś', 'ś', 'Ŝ', 'ŝ', 'Ş', 'ş', 'Š', 'š', 'Ţ', 'ţ', 'Ť', 'ť', 'Ŧ', 'ŧ', 'Ũ', 'ũ', 'Ū', 'ū', 'Ŭ', 'ŭ', 'Ů', 'ů', 'Ű', 'ű', 'Ų', 'ų', 'Ŵ', 'ŵ', 'Ŷ', 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'ſ', 'ƒ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ǎ', 'ǎ', 'Ǐ', 'ǐ', 'Ǒ', 'ǒ', 'Ǔ', 'ǔ', 'Ǖ', 'ǖ', 'Ǘ', 'ǘ', 'Ǚ', 'ǚ', 'Ǜ', 'ǜ', 'Ǻ', 'ǻ', 'Ǽ', 'ǽ', 'Ǿ', 'ǿ'
38 38
         ];
39 39
         $second = [
40
-            'A','A','A','A','A','A','AE','C','E','E','E','E','I','I','I','I','D','N','O','O','O','O','O','O','U','U','U','U','Y','s','a','a','a','a','a','a','ae','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','o','u','u','u','u','y','y','A','a','A','a','A','a','C','c','C','c','C','c','C','c','D','d','D','d','E','e','E','e','E','e','E','e','E','e','G','g','G','g','G','g','G','g','H','h','H','h','I','i','I','i','I','i','I','i','I','i','IJ','ij','J','j','K','k','L','l','L','l','L','l','L','l','l','l','N','n','N','n','N','n','n','O','o','O','o','O','o','OE','oe','R','r','R','r','R','r','S','s','S','s','S','s','S','s','T','t','T','t','T','t','U','u','U','u','U','u','U','u','U','u','U','u','W','w','Y','y','Y','Z','z','Z','z','Z','z','s','f','O','o','U','u','A','a','I','i','O','o','U','u','U','u','U','u','U','u','U','u','A','a','AE','ae','O','o'
40
+            'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'D', 'N', 'O', 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'Y', 's', 'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 'y', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'D', 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'IJ', 'ij', 'J', 'j', 'K', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'l', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'O', 'o', 'O', 'o', 'O', 'o', 'OE', 'oe', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 's', 'f', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'A', 'a', 'AE', 'ae', 'O', 'o'
41 41
         ];
42 42
         return str_replace($first, $second, $str);
43 43
     }
@@ -45,6 +45,6 @@  discard block
 block discarded – undo
45 45
     public static function generateSlug($str)
46 46
     {
47 47
         return strtolower(preg_replace(
48
-            ['/[^a-zA-Z0-9 -]/', '/[ -]+/', '/^-|-$/','/[«»""!?,.]+/'], ['', '-', ''], self::removeAccent($str)));
48
+            [ '/[^a-zA-Z0-9 -]/', '/[ -]+/', '/^-|-$/', '/[«»""!?,.]+/' ], [ '', '-', '' ], self::removeAccent($str)));
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
src/Gravatar.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,14 +39,14 @@
 block discarded – undo
39 39
      * @param array $options Optional, additional key/value attributes to include
40 40
      * @return string Link to the user's gravatar image.
41 41
      */
42
-    public static function getAvatarUrl($email, $options = [])
42
+    public static function getAvatarUrl($email, $options = [ ])
43 43
     {
44
-        $size       = isset($options['s']) ? $options['s'] : 80;
45
-        $imageset   = isset($options['d']) ? $options['d'] : 'mm';
46
-        $rating     = isset($options['r']) ? $options['r'] : 'g';
47
-        $secure     = isset($options['secure']) ? self::HTTPS_URL : self::HTTP_URL;
44
+        $size       = isset($options[ 's' ]) ? $options[ 's' ] : 80;
45
+        $imageset   = isset($options[ 'd' ]) ? $options[ 'd' ] : 'mm';
46
+        $rating     = isset($options[ 'r' ]) ? $options[ 'r' ] : 'g';
47
+        $secure     = isset($options[ 'secure' ]) ? self::HTTPS_URL : self::HTTP_URL;
48 48
 
49
-        return $secure . md5(strtolower(trim($email))) . '?s=' . $size .'&d=' . $imageset . '&r=' . $rating;
49
+        return $secure . md5(strtolower(trim($email))) . '?s=' . $size . '&d=' . $imageset . '&r=' . $rating;
50 50
     }  
51 51
 }
52 52
 
Please login to merge, or discard this patch.
src/Money.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
      * @throws Exception
41 41
      */
42 42
 
43
-    public static function generaFormato($valor = 0,  $options = [])
43
+    public static function generaFormato($valor = 0, $options = [ ])
44 44
     {
45 45
 
46
-        $simbolo  = isset($options['s']) ? $options['s'] : 'BsF';
47
-        $decimal  = isset($options['d']) ? $options['d'] : 2;  
46
+        $simbolo  = isset($options[ 's' ]) ? $options[ 's' ] : 'BsF';
47
+        $decimal  = isset($options[ 'd' ]) ? $options[ 'd' ] : 2;  
48 48
         
49 49
         if (!is_numeric($valor))
50 50
             throw new Exception("{$valor} debe indicar un número que sea válido");
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
      * @param array $options additional key/value attributes to include
61 61
      * @return float
62 62
      */
63
-    public static function quitarFormato($str, $options = [])
63
+    public static function quitarFormato($str, $options = [ ])
64 64
     {
65
-        $simbolo  = isset($options['s']) ? $options['s'] : 'BsF';
66
-        $decimal  = isset($options['d']) ? $options['d'] : 2;
65
+        $simbolo  = isset($options[ 's' ]) ? $options[ 's' ] : 'BsF';
66
+        $decimal  = isset($options[ 'd' ]) ? $options[ 'd' ] : 2;
67 67
         
68 68
         return number_format(str_replace($simbolo, '', $str), $decimal, '.', '');
69 69
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,10 +46,12 @@
 block discarded – undo
46 46
         $simbolo  = isset($options['s']) ? $options['s'] : 'BsF';
47 47
         $decimal  = isset($options['d']) ? $options['d'] : 2;  
48 48
         
49
-        if (!is_numeric($valor))
50
-            throw new Exception("{$valor} debe indicar un número que sea válido");
51
-        if (!is_int($decimal))
52
-            throw new Exception("El valor {$decimal} no es válido");          
49
+        if (!is_numeric($valor)) {
50
+                    throw new Exception("{$valor} debe indicar un número que sea válido");
51
+        }
52
+        if (!is_int($decimal)) {
53
+                    throw new Exception("El valor {$decimal} no es válido");
54
+        }
53 55
 
54 56
         return $simbolo . ' ' . number_format($valor, $decimal, '.', '');
55 57
     }
Please login to merge, or discard this patch.
src/TimeFormat.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
31 31
 
32 32
 class TimeFormat
33 33
 {    
34
-   /**
35
-    * TimeFormat
36
-    * 
37
-    * @param string $date
38
-    * @return string
39
-    */
34
+    /**
35
+     * TimeFormat
36
+     * 
37
+     * @param string $date
38
+     * @return string
39
+     */
40 40
     public static function timeAgo($date) {
41 41
 
42 42
         $time_og    = strtotime($date);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             'decade',
52 52
         ];
53 53
 
54
-        $intervals  = [
54
+        $intervals = [
55 55
             '60',
56 56
             '60',
57 57
             '24',
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 
66 66
         $difference = $now - $time_og;
67 67
 
68
-        for($j = 0; $difference >= $intervals[$j] && $j < count($intervals)-1; $j++) {
69
-            $difference /= $intervals[$j];
68
+        for ($j = 0; $difference >= $intervals[ $j ] && $j < count($intervals) - 1; $j++) {
69
+            $difference /= $intervals[ $j ];
70 70
         }
71 71
 
72 72
         $difference = round($difference);
73 73
 
74
-        if($difference != 1) {
75
-            $units[$j].= 's';
74
+        if ($difference != 1) {
75
+            $units[ $j ] .= 's';
76 76
         }
77 77
 
78
-        $ago = $difference .''. $units[$j] .'ago';
78
+        $ago = $difference . '' . $units[ $j ] . 'ago';
79 79
 
80 80
         return $ago;
81 81
     }
Please login to merge, or discard this patch.