Completed
Push — development ( a3d994...5aaa77 )
by Nils
07:56
created
libraries/Authentication/TwoFactorAuth/Providers/Qr/QRServerProvider.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -51,6 +51,9 @@
 block discarded – undo
51 51
         return $this->getContent($this->getUrl($qrtext, $size));
52 52
     }
53 53
     
54
+    /**
55
+     * @param string $value
56
+     */
54 57
     private function decodeColor($value) 
55 58
     {
56 59
         return vsprintf('%d-%d-%d', sscanf($value, "%02x%02x%02x"));
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 
15 15
     function __construct($verifyssl = false, $errorcorrectionlevel = 'L', $margin = 4, $qzone = 1, $bgcolor = 'ffffff', $color = '000000', $format = 'png') 
16 16
     {
17
-        if (!is_bool($verifyssl))
18
-            throw new QRException('VerifySSL must be bool');
17
+        if (!is_bool($verifyssl)) {
18
+                    throw new QRException('VerifySSL must be bool');
19
+        }
19 20
 
20 21
         $this->verifyssl = $verifyssl;
21 22
         
Please login to merge, or discard this patch.
includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -139,6 +139,7 @@
 block discarded – undo
139 139
 
140 140
     /**
141 141
      * Get data-uri of QRCode
142
+     * @param string $label
142 143
      */
143 144
     public function getQRCodeImageAsDataUri($label, $secret, $size = 200)
144 145
     {
Please login to merge, or discard this patch.
Braces   +49 added lines, -31 removed lines patch added patch discarded remove patch
@@ -26,17 +26,20 @@  discard block
 block discarded – undo
26 26
     function __construct($issuer = null, $digits = 6, $period = 30, $algorithm = 'sha1', IQRCodeProvider $qrcodeprovider = null, IRNGProvider $rngprovider = null, ITimeProvider $timeprovider = null)
27 27
     {
28 28
         $this->issuer = $issuer;
29
-        if (!is_int($digits) || $digits <= 0)
30
-            throw new TwoFactorAuthException('Digits must be int > 0');
29
+        if (!is_int($digits) || $digits <= 0) {
30
+                    throw new TwoFactorAuthException('Digits must be int > 0');
31
+        }
31 32
         $this->digits = $digits;
32 33
 
33
-        if (!is_int($period) || $period <= 0)
34
-            throw new TwoFactorAuthException('Period must be int > 0');
34
+        if (!is_int($period) || $period <= 0) {
35
+                    throw new TwoFactorAuthException('Period must be int > 0');
36
+        }
35 37
         $this->period = $period;
36 38
 
37 39
         $algorithm = strtolower(trim($algorithm));
38
-        if (!in_array($algorithm, self::$_supportedalgos))
39
-            throw new TwoFactorAuthException('Unsupported algorithm: ' . $algorithm);
40
+        if (!in_array($algorithm, self::$_supportedalgos)) {
41
+                    throw new TwoFactorAuthException('Unsupported algorithm: ' . $algorithm);
42
+        }
40 43
         $this->algorithm = $algorithm;
41 44
         $this->qrcodeprovider = $qrcodeprovider;
42 45
         $this->rngprovider = $rngprovider;
@@ -54,11 +57,14 @@  discard block
 block discarded – undo
54 57
         $secret = '';
55 58
         $bytes = ceil($bits / 5);   //We use 5 bits of each byte (since we have a 32-character 'alphabet' / BASE32)
56 59
         $rngprovider = $this->getRngprovider();
57
-        if ($requirecryptosecure && !$rngprovider->isCryptographicallySecure())
58
-            throw new TwoFactorAuthException('RNG provider is not cryptographically secure');
60
+        if ($requirecryptosecure && !$rngprovider->isCryptographicallySecure()) {
61
+                    throw new TwoFactorAuthException('RNG provider is not cryptographically secure');
62
+        }
59 63
         $rnd = $rngprovider->getRandomBytes($bytes);
60
-        for ($i = 0; $i < $bytes; $i++)
61
-            $secret .= self::$_base32[ord($rnd[$i]) & 31];  //Mask out left 3 bits for 0-31 values
64
+        for ($i = 0; $i < $bytes; $i++) {
65
+                    $secret .= self::$_base32[ord($rnd[$i]) & 31];
66
+        }
67
+        //Mask out left 3 bits for 0-31 values
62 68
         return $secret;
63 69
     }
64 70
 
@@ -87,8 +93,9 @@  discard block
 block discarded – undo
87 93
         $timetamp = $this->getTime($time);
88 94
 
89 95
         // To keep safe from timing-attachs we iterate *all* possible codes even though we already may have verified a code is correct
90
-        for ($i = -$discrepancy; $i <= $discrepancy; $i++)
91
-            $result |= $this->codeEquals($this->getCode($secret, $timetamp + ($i * $this->period)), $code);
96
+        for ($i = -$discrepancy; $i <= $discrepancy; $i++) {
97
+                    $result |= $this->codeEquals($this->getCode($secret, $timetamp + ($i * $this->period)), $code);
98
+        }
92 99
 
93 100
         return (bool)$result;
94 101
     }
@@ -104,8 +111,9 @@  discard block
 block discarded – undo
104 111
         // we don't leak information about the difference of the two strings.
105 112
         if (strlen($safe)===strlen($user)) {
106 113
             $result = 0;
107
-            for ($i = 0; $i < strlen($safe); $i++)
108
-                $result |= (ord($safe[$i]) ^ ord($user[$i]));
114
+            for ($i = 0; $i < strlen($safe); $i++) {
115
+                            $result |= (ord($safe[$i]) ^ ord($user[$i]));
116
+            }
109 117
             return $result === 0;
110 118
         }
111 119
         return false;
@@ -116,8 +124,9 @@  discard block
 block discarded – undo
116 124
      */
117 125
     public function getQRCodeImageAsDataUri($label, $secret, $size = 200)
118 126
     {
119
-        if (!is_int($size) || $size <= 0)
120
-            throw new TwoFactorAuthException('Size must be int > 0');
127
+        if (!is_int($size) || $size <= 0) {
128
+                    throw new TwoFactorAuthException('Size must be int > 0');
129
+        }
121 130
 
122 131
         $qrcodeprovider = $this->getQrCodeProvider();
123 132
         return 'data:'
@@ -131,26 +140,30 @@  discard block
 block discarded – undo
131 140
      */
132 141
     public function ensureCorrectTime(array $timeproviders = null, $leniency = 5)
133 142
     {
134
-        if ($timeproviders != null && !is_array($timeproviders))
135
-            throw new TwoFactorAuthException('No timeproviders specified');
143
+        if ($timeproviders != null && !is_array($timeproviders)) {
144
+                    throw new TwoFactorAuthException('No timeproviders specified');
145
+        }
136 146
 
137
-        if ($timeproviders == null)
138
-            $timeproviders = array(
147
+        if ($timeproviders == null) {
148
+                    $timeproviders = array(
139 149
                 new Providers\Time\ConvertUnixTimeDotComTimeProvider(),
140 150
                 new Providers\Time\HttpTimeProvider()
141 151
             );
152
+        }
142 153
 
143 154
         // Get default time provider
144 155
         $timeprovider = $this->getTimeProvider();
145 156
 
146 157
         // Iterate specified time providers
147 158
         foreach ($timeproviders as $t) {
148
-            if (!($t instanceof ITimeProvider))
149
-                throw new TwoFactorAuthException('Object does not implement ITimeProvider');
159
+            if (!($t instanceof ITimeProvider)) {
160
+                            throw new TwoFactorAuthException('Object does not implement ITimeProvider');
161
+            }
150 162
 
151 163
             // Get time from default time provider and compare to specific time provider and throw if time difference is more than specified number of seconds leniency
152
-            if (abs($timeprovider->getTime() - $t->getTime()) > $leniency)
153
-                throw new TwoFactorAuthException(sprintf('Time for timeprovider is off by more than %d seconds when compared to %s', $leniency, get_class($t)));
164
+            if (abs($timeprovider->getTime() - $t->getTime()) > $leniency) {
165
+                            throw new TwoFactorAuthException(sprintf('Time for timeprovider is off by more than %d seconds when compared to %s', $leniency, get_class($t)));
166
+            }
154 167
         }
155 168
     }
156 169
 
@@ -179,23 +192,28 @@  discard block
 block discarded – undo
179 192
 
180 193
     private function base32Decode($value)
181 194
     {
182
-        if (strlen($value)==0) return '';
195
+        if (strlen($value)==0) {
196
+            return '';
197
+        }
183 198
 
184
-        if (preg_match('/[^'.preg_quote(self::$_base32dict).']/', $value) !== 0)
185
-            throw new TwoFactorAuthException('Invalid base32 string');
199
+        if (preg_match('/[^'.preg_quote(self::$_base32dict).']/', $value) !== 0) {
200
+                    throw new TwoFactorAuthException('Invalid base32 string');
201
+        }
186 202
 
187 203
         $buffer = '';
188 204
         foreach (str_split($value) as $char)
189 205
         {
190
-            if ($char !== '=')
191
-                $buffer .= str_pad(decbin(self::$_base32lookup[$char]), 5, 0, STR_PAD_LEFT);
206
+            if ($char !== '=') {
207
+                            $buffer .= str_pad(decbin(self::$_base32lookup[$char]), 5, 0, STR_PAD_LEFT);
208
+            }
192 209
         }
193 210
         $length = strlen($buffer);
194 211
         $blocks = trim(chunk_split(substr($buffer, 0, $length - ($length % 8)), 8, ' '));
195 212
 
196 213
         $output = '';
197
-        foreach (explode(' ', $blocks) as $block)
198
-            $output .= chr(bindec(str_pad($block, 8, 0, STR_PAD_RIGHT)));
214
+        foreach (explode(' ', $blocks) as $block) {
215
+                    $output .= chr(bindec(str_pad($block, 8, 0, STR_PAD_RIGHT)));
216
+        }
199 217
         return $output;
200 218
     }
201 219
 
Please login to merge, or discard this patch.
includes/libraries/Email/Phpmailer/class.pop3.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
      * Connect to a POP3 server.
201 201
      * @access public
202 202
      * @param string $host
203
-     * @param integer|boolean $port
203
+     * @param integer $port
204 204
      * @param integer $tval
205 205
      * @return boolean
206 206
      */
Please login to merge, or discard this patch.
includes/libraries/protect/AntiXSS/AntiXSS.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1912,7 +1912,7 @@
 block discarded – undo
1912 1912
   /**
1913 1913
    * @param string $str
1914 1914
    *
1915
-   * @return mixed
1915
+   * @return string
1916 1916
    */
1917 1917
   private function _do($str)
1918 1918
   {
Please login to merge, or discard this patch.
includes/libraries/protect/AntiXSS/UTF8.php 1 patch
Doc Comments   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2821,7 +2821,7 @@  discard block
 block discarded – undo
2821 2821
   /**
2822 2822
    * Check if the input is binary... (is look like a hack).
2823 2823
    *
2824
-   * @param mixed $input
2824
+   * @param string $input
2825 2825
    *
2826 2826
    * @return bool
2827 2827
    */
@@ -5795,7 +5795,7 @@  discard block
 block discarded – undo
5795 5795
    * @link http://php.net/manual/en/function.mb-strrpos.php
5796 5796
    *
5797 5797
    * @param string     $haystack  <p>The string being checked, for the last occurrence of needle</p>
5798
-   * @param string|int $needle    <p>The string to find in haystack.<br />Or a code point as int.</p>
5798
+   * @param string $needle    <p>The string to find in haystack.<br />Or a code point as int.</p>
5799 5799
    * @param int        $offset    [optional] <p>May be specified to begin searching an arbitrary number of characters
5800 5800
    *                              into the string. Negative values will stop searching at an arbitrary point prior to
5801 5801
    *                              the end of the string.
@@ -6296,7 +6296,7 @@  discard block
 block discarded – undo
6296 6296
    * @param string  $encoding  [optional] <p>Default is UTF-8</p>
6297 6297
    * @param boolean $cleanUtf8 [optional] <p>Remove non UTF-8 chars from the string.</p>
6298 6298
    *
6299
-   * @return string|false <p>The portion of <i>str</i> specified by the <i>offset</i> and
6299
+   * @return string <p>The portion of <i>str</i> specified by the <i>offset</i> and
6300 6300
    *                      <i>length</i> parameters.</p><p>If <i>str</i> is shorter than <i>offset</i>
6301 6301
    *                      characters long, <b>FALSE</b> will be returned.</p>
6302 6302
    */
@@ -6630,16 +6630,16 @@  discard block
 block discarded – undo
6630 6630
    *
6631 6631
    * source: https://gist.github.com/stemar/8287074
6632 6632
    *
6633
-   * @param string|string[] $str              <p>The input string or an array of stings.</p>
6634
-   * @param string|string[] $replacement      <p>The replacement string or an array of stings.</p>
6635
-   * @param int|int[]       $offset           <p>
6633
+   * @param string $str              <p>The input string or an array of stings.</p>
6634
+   * @param string $replacement      <p>The replacement string or an array of stings.</p>
6635
+   * @param integer       $offset           <p>
6636 6636
    *                                          If start is positive, the replacing will begin at the start'th offset
6637 6637
    *                                          into string.
6638 6638
    *                                          <br /><br />
6639 6639
    *                                          If start is negative, the replacing will begin at the start'th character
6640 6640
    *                                          from the end of string.
6641 6641
    *                                          </p>
6642
-   * @param int|int[]|void  $length           [optional] <p>If given and is positive, it represents the length of the
6642
+   * @param integer  $length           [optional] <p>If given and is positive, it represents the length of the
6643 6643
    *                                          portion of string which is to be replaced. If it is negative, it
6644 6644
    *                                          represents the number of characters from the end of string at which to
6645 6645
    *                                          stop replacing. If it is not given, then it will default to strlen(
@@ -7079,7 +7079,7 @@  discard block
 block discarded – undo
7079 7079
    * case.</li>
7080 7080
    * </ul>
7081 7081
    *
7082
-   * @param string|string[] $str                    <p>Any string or array.</p>
7082
+   * @param string $str                    <p>Any string or array.</p>
7083 7083
    * @param bool            $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p>
7084 7084
    *
7085 7085
    * @return string|string[] <p>The UTF-8 encoded string.</p>
Please login to merge, or discard this patch.
install/js/crypt/aes.class.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,6 @@
 block discarded – undo
90 90
     }
91 91
 
92 92
     /**
93
-     * @param integer $Nb
94 93
      */
95 94
     private static function mixColumns($s) {   // combine bytes of each col of state S [é5.1.3]
96 95
     for ($c = 0; $c < 4; $c++) {
Please login to merge, or discard this patch.
includes/libraries/Tree/NestedTree/NestedTree.php 1 patch
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -174,7 +174,6 @@  discard block
 block discarded – undo
174 174
      * Fetch the children of a node, or if no node is specified, fetch the
175 175
      * top level items.
176 176
      *
177
-     * @param int  $id          The ID of the node to fetch child data for.
178 177
      * @param bool $includeSelf Whether or not to include the passed node in the
179 178
      *                                  the results.
180 179
      * @return array The children of the passed node
@@ -441,7 +440,6 @@  discard block
 block discarded – undo
441 440
      *                              be able to update the data in it
442 441
      * @param int     $folder_id    The ID of the current node to process
443 442
      * @param int     $fld_level    The nlevel to assign to the current node
444
-     * @param int     $n_tally      A reference to the running tally for the n-value
445 443
      * @param integer $n
446 444
      */
447 445
     public function generateTreeData(&$arr, $folder_id, $fld_level, &$n_tally)
Please login to merge, or discard this patch.
libraries/Authentication/TwoFactorAuth/Providers/Rng/MCryptRNGProvider.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@
 block discarded – undo
13 13
     
14 14
     public function getRandomBytes($bytecount) {
15 15
         $result = mcrypt_create_iv($bytecount, $this->source);
16
-        if ($result === false)
17
-            throw new \RNGException('mcrypt_create_iv returned an invalid value');
16
+        if ($result === false) {
17
+                    throw new \RNGException('mcrypt_create_iv returned an invalid value');
18
+        }
18 19
         return $result;
19 20
     }
20 21
     
Please login to merge, or discard this patch.
libraries/Authentication/TwoFactorAuth/Providers/Rng/HashRNGProvider.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@
 block discarded – undo
8 8
     
9 9
     function __construct($algorithm = 'sha256' ) {
10 10
         $algos = array_values(hash_algos());
11
-        if (!in_array($algorithm, $algos, true))
12
-            throw new \RNGException('Unsupported algorithm specified');
11
+        if (!in_array($algorithm, $algos, true)) {
12
+                    throw new \RNGException('Unsupported algorithm specified');
13
+        }
13 14
         $this->algorithm = $algorithm;
14 15
     }
15 16
     
Please login to merge, or discard this patch.