Completed
Push — master ( 7cd0ea...1cc8fa )
by Rob
02:09
created
src/voku/Resources/Attributes.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@
 block discarded – undo
12 12
         $this->_evil_attributes_regex = $evil->regEx();
13 13
     }
14 14
 
15
+    /**
16
+     * @param string $str
17
+     */
15 18
     public function removeEvilAttributes($str)
16 19
     {
17 20
         // replace style-attribute, first (if needed)
Please login to merge, or discard this patch.
src/Handlers/Xss.php 1 patch
Doc Comments   +13 added lines, -3 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     /**
108 108
      * @param StringResource $str
109 109
      *
110
-     * @return mixed
110
+     * @return string
111 111
      */
112 112
     private function _do($str)
113 113
     {
@@ -176,6 +176,9 @@  discard block
 block discarded – undo
176 176
         return $str;
177 177
     }
178 178
 
179
+    /**
180
+     * @param string $str
181
+     */
179 182
     public function decodeString($str)
180 183
     {
181 184
         // init
@@ -184,6 +187,10 @@  discard block
 block discarded – undo
184 187
         if (strpos($str, '<') !== false && preg_match($regExForHtmlTags, $str, $matches) === 1) {
185 188
             $str = (string)preg_replace_callback(
186 189
                 $regExForHtmlTags,
190
+
191
+                /**
192
+                 * @param string $matches
193
+                 */
187 194
                 function ($matches) {
188 195
                     return $this->decodeEntity($matches);
189 196
                 },
@@ -222,7 +229,7 @@  discard block
 block discarded – undo
222 229
     }
223 230
 
224 231
     /**
225
-     * @return null
232
+     * @return null|boolean
226 233
      */
227 234
     public function isXssFound()
228 235
     {
@@ -234,7 +241,7 @@  discard block
 block discarded – undo
234 241
      *
235 242
      * @param StringResource $str
236 243
      *
237
-     * @return StringResource
244
+     * @return string
238 245
      */
239 246
     private function _entity_decode($str)
240 247
     {
@@ -337,6 +344,9 @@  discard block
 block discarded – undo
337 344
         return $str;
338 345
     }
339 346
 
347
+    /**
348
+     * @param string $file
349
+     */
340 350
     private function _get_data($file)
341 351
     {
342 352
         /** @noinspection PhpIncludeInspection */
Please login to merge, or discard this patch.
src/voku/Resources/Html.php 1 patch
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -13,6 +13,9 @@  discard block
 block discarded – undo
13 13
         $this->_evil_html_tags = $evil->html();
14 14
     }
15 15
 
16
+    /**
17
+     * @param string $str
18
+     */
16 19
     public function naughtyHtml($str)
17 20
     {
18 21
         $evil_html_tags = implode('|', $this->_evil_html_tags);
@@ -20,6 +23,10 @@  discard block
 block discarded – undo
20 23
 
21 24
         $str = (string)preg_replace_callback(
22 25
             '#<(?<start>/*\s*)(?<content>' . $evil_html_tags . ')(?<end>[^><]*)(?<rest>[><]*)#ius',
26
+
27
+            /**
28
+             * @param string $matches
29
+             */
23 30
             function ($matches) {
24 31
                 return $this->naughtyHtmlCallback($matches);
25 32
             },
Please login to merge, or discard this patch.
src/voku/Resources/Utf8.php 1 patch
Doc Comments   +38 added lines, -6 removed lines patch added patch discarded remove patch
@@ -236,12 +236,20 @@  discard block
 block discarded – undo
236 236
         return str_replace($BROKEN_UTF8_TO_UTF8_KEYS_CACHE, $BROKEN_UTF8_TO_UTF8_VALUES_CACHE, $str);
237 237
     }
238 238
 
239
+    /**
240
+     * @param string $file
241
+     */
239 242
     private function getData($file)
240 243
     {
241 244
 
242 245
         return include __DIR__ . '/../Data/' . $file . '.php';
243 246
     }
244 247
 
248
+    /**
249
+     * @param integer $flags
250
+     *
251
+     * @return string
252
+     */
245 253
     private function htmlEntityDecode($str, $flags = null, $encoding = 'UTF-8')
246 254
     {
247 255
         if (
@@ -551,6 +559,9 @@  discard block
 block discarded – undo
551 559
         return $buf;
552 560
     }
553 561
 
562
+    /**
563
+     * @param string $input
564
+     */
554 565
     private function toUtf8ConvertHelper($input)
555 566
     {
556 567
         // init
@@ -580,6 +591,9 @@  discard block
 block discarded – undo
580 591
         return $buf;
581 592
     }
582 593
 
594
+    /**
595
+     * @param integer $code_point
596
+     */
583 597
     private function chr($code_point, $encoding = 'UTF-8')
584 598
     {
585 599
         // init
@@ -675,6 +689,9 @@  discard block
 block discarded – undo
675 689
         return $CHAR_CACHE[$cacheKey] = $chr;
676 690
     }
677 691
 
692
+    /**
693
+     * @return string
694
+     */
678 695
     private function encode($toEncoding, $str)
679 696
     {
680 697
         if ($str === '' || $toEncoding === '') {
@@ -842,6 +859,9 @@  discard block
 block discarded – undo
842 859
         return $var;
843 860
     }
844 861
 
862
+    /**
863
+     * @param string $str
864
+     */
845 865
     private function normalize_line_ending($str)
846 866
     {
847 867
         return str_replace(["\r\n", "\r"], "\n", $str);
@@ -898,6 +918,9 @@  discard block
 block discarded – undo
898 918
         );
899 919
     }
900 920
 
921
+    /**
922
+     * @param string $char
923
+     */
901 924
     private function singleChrHtmlEncode($char, $keepAsciiChars = false, $encoding = 'UTF-8')
902 925
     {
903 926
         if ($char === '') {
@@ -1404,6 +1427,9 @@  discard block
 block discarded – undo
1404 1427
         return false;
1405 1428
     }
1406 1429
 
1430
+    /**
1431
+     * @param string $input
1432
+     */
1407 1433
     private function is_binary($input, $strict = false)
1408 1434
     {
1409 1435
         $input = (string)$input;
@@ -1441,6 +1467,9 @@  discard block
 block discarded – undo
1441 1467
         return false;
1442 1468
     }
1443 1469
 
1470
+    /**
1471
+     * @param string $str
1472
+     */
1444 1473
     private function get_file_type(
1445 1474
         $str,
1446 1475
         $fallback = [
@@ -1533,6 +1562,9 @@  discard block
 block discarded – undo
1533 1562
         ];
1534 1563
     }
1535 1564
 
1565
+    /**
1566
+     * @param string $str
1567
+     */
1536 1568
     private function is_utf16($str, $checkIfStringIsBinary = true)
1537 1569
     {
1538 1570
 
@@ -1615,7 +1647,7 @@  discard block
 block discarded – undo
1615 1647
     /**
1616 1648
      * Check if the string is UTF-32.
1617 1649
      *
1618
-     * @param mixed $str <p>The input string.</p>
1650
+     * @param string $str <p>The input string.</p>
1619 1651
      * @param bool $checkIfStringIsBinary
1620 1652
      *
1621 1653
      * @return false|int
@@ -1693,8 +1725,7 @@  discard block
 block discarded – undo
1693 1725
      *
1694 1726
      * @see    http://hsivonen.iki.fi/php-utf8/
1695 1727
      *
1696
-     * @param string|string[] $str <p>The string to be checked.</p>
1697
-     * @param bool $strict <p>Check also if the string is not UTF-16 or UTF-32.</p>
1728
+     * @param string $str <p>The string to be checked.</p>
1698 1729
      *
1699 1730
      * @return bool
1700 1731
      */
@@ -1922,9 +1953,7 @@  discard block
 block discarded – undo
1922 1953
     }
1923 1954
 
1924 1955
     /**
1925
-     * @param $str
1926
-     * @param string $encoding
1927
-     * @param bool $cleanUtf8
1956
+     * @param string $str
1928 1957
      * @return bool|int
1929 1958
      */
1930 1959
     private function stringLength($str)
@@ -1971,6 +2000,9 @@  discard block
 block discarded – undo
1971 2000
         return $returnTmp;
1972 2001
     }
1973 2002
 
2003
+    /**
2004
+     * @param integer $int
2005
+     */
1974 2006
     private function decimalToChr($int)
1975 2007
     {
1976 2008
         return $this->htmlEntityDecode('&#' . $int . ';', \ENT_QUOTES | \ENT_HTML5);
Please login to merge, or discard this patch.