aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php30
1 files changed, 19 insertions, 11 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index 5f10f482..3f3c60d0 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -740,30 +740,38 @@ class ContentProxyTest extends TestCase
740 } 740 }
741 741
742 /** 742 /**
743 * https://stackoverflow.com/a/18506801 743 * https://stackoverflow.com/a/18506801.
744 *
744 * @param $string 745 * @param $string
746 *
745 * @return string 747 * @return string
746 */ 748 */
747 private function strToHex($string){ 749 private function strToHex($string)
750 {
748 $hex = ''; 751 $hex = '';
749 for ($i=0; $i<strlen($string); $i++){ 752 for ($i = 0; $i < \strlen($string); ++$i) {
750 $ord = ord($string[$i]); 753 $ord = \ord($string[$i]);
751 $hexCode = dechex($ord); 754 $hexCode = dechex($ord);
752 $hex .= substr('0'.$hexCode, -2); 755 $hex .= substr('0' . $hexCode, -2);
753 } 756 }
754 return strToUpper($hex); 757
758 return strtoupper($hex);
755 } 759 }
756 760
757 /** 761 /**
758 * https://stackoverflow.com/a/18506801 762 * https://stackoverflow.com/a/18506801.
763 *
759 * @param $hex 764 * @param $hex
765 *
760 * @return string 766 * @return string
761 */ 767 */
762 private function hexToStr($hex){ 768 private function hexToStr($hex)
763 $string=''; 769 {
764 for ($i=0; $i < strlen($hex)-1; $i+=2){ 770 $string = '';
765 $string .= chr(hexdec($hex[$i].$hex[$i+1])); 771 for ($i = 0; $i < \strlen($hex) - 1; $i += 2) {
772 $string .= \chr(hexdec($hex[$i] . $hex[$i + 1]));
766 } 773 }
774
767 return $string; 775 return $string;
768 } 776 }
769 777