@@ -27,7 +27,7 @@ |
||
27 | 27 | $imgData = str_repeat("\0", $imgHeight * $imgWidth); |
28 | 28 | for ($y = 0; $y < $imgHeight; $y++) { |
29 | 29 | for ($x = 0; $x < $imgWidth; $x++) { |
30 | - $imgData[$y * $imgWidth + $x] = $image -> getPixel($x, $y) == 0 ? 0: 1; |
|
30 | + $imgData[$y * $imgWidth + $x] = $image -> getPixel($x, $y) == 0 ? 0 : 1; |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | $this -> setImgWidth($imgWidth); |
@@ -434,11 +434,11 @@ discard block |
||
434 | 434 | if (!$this -> profile -> getSupportsBarcodeB()) { |
435 | 435 | // A simpler barcode command which supports fewer codes |
436 | 436 | self::validateInteger($type, 65, 71, __FUNCTION__); |
437 | - $this -> connector -> write(self::GS . "k" . chr($type - 65) . $content . self::NUL); |
|
437 | + $this -> connector -> write(self::GS."k".chr($type - 65).$content.self::NUL); |
|
438 | 438 | return; |
439 | 439 | } |
440 | 440 | // More advanced function B, used in preference |
441 | - $this -> connector -> write(self::GS . "k" . chr($type) . chr(strlen($content)) . $content); |
|
441 | + $this -> connector -> write(self::GS."k".chr($type).chr(strlen($content)).$content); |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | self::validateInteger($size, 0, 3, __FUNCTION__); |
459 | 459 | $rasterData = $img -> toRasterFormat(); |
460 | 460 | $header = Printer::dataHeader([$img -> getWidthBytes(), $img -> getHeight()], true); |
461 | - $this -> connector -> write(self::GS . "v0" . chr($size) . $header); |
|
461 | + $this -> connector -> write(self::GS."v0".chr($size).$header); |
|
462 | 462 | $this -> connector -> write($rasterData); |
463 | 463 | } |
464 | 464 | |
@@ -475,8 +475,8 @@ discard block |
||
475 | 475 | */ |
476 | 476 | public function bitImageColumnFormat(EscposImage $img, int $size = Printer::IMG_DEFAULT) |
477 | 477 | { |
478 | - $highDensityVertical = ! (($size & self::IMG_DOUBLE_HEIGHT) == Printer::IMG_DOUBLE_HEIGHT); |
|
479 | - $highDensityHorizontal = ! (($size & self::IMG_DOUBLE_WIDTH) == Printer::IMG_DOUBLE_WIDTH); |
|
478 | + $highDensityVertical = !(($size & self::IMG_DOUBLE_HEIGHT) == Printer::IMG_DOUBLE_HEIGHT); |
|
479 | + $highDensityHorizontal = !(($size & self::IMG_DOUBLE_WIDTH) == Printer::IMG_DOUBLE_WIDTH); |
|
480 | 480 | // Experimental column format printing |
481 | 481 | // This feature is not yet complete and may produce unpredictable results. |
482 | 482 | $this -> setLineSpacing(16); // 16-dot line spacing. This is the correct value on both TM-T20 and TM-U220 |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $header = Printer::dataHeader([$img -> getWidth()], true); |
487 | 487 | foreach ($colFormatData as $line) { |
488 | 488 | // Print each line, double density etc for printing are set here also |
489 | - $this -> connector -> write(self::ESC . "*" . chr($densityCode) . $header . $line); |
|
489 | + $this -> connector -> write(self::ESC."*".chr($densityCode).$header.$line); |
|
490 | 490 | $this -> feed(); |
491 | 491 | // sleep(0.1); // Reduces the amount of trouble that a TM-U220 has keeping up with large images |
492 | 492 | } |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | public function cut(int $mode = Printer::CUT_FULL, int $lines = 3) |
512 | 512 | { |
513 | 513 | // TODO validation on cut() inputs |
514 | - $this -> connector -> write(self::GS . "V" . chr($mode) . chr($lines)); |
|
514 | + $this -> connector -> write(self::GS."V".chr($mode).chr($lines)); |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | /** |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | if ($lines <= 1) { |
526 | 526 | $this -> connector -> write(self::LF); |
527 | 527 | } else { |
528 | - $this -> connector -> write(self::ESC . "d" . chr($lines)); |
|
528 | + $this -> connector -> write(self::ESC."d".chr($lines)); |
|
529 | 529 | } |
530 | 530 | } |
531 | 531 | |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | */ |
544 | 544 | public function release() |
545 | 545 | { |
546 | - $this -> connector -> write(self::ESC . chr(113)); |
|
546 | + $this -> connector -> write(self::ESC.chr(113)); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | /** |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | public function feedReverse(int $lines = 1) |
555 | 555 | { |
556 | 556 | self::validateInteger($lines, 1, 255, __FUNCTION__); |
557 | - $this -> connector -> write(self::ESC . "e" . chr($lines)); |
|
557 | + $this -> connector -> write(self::ESC."e".chr($lines)); |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | /** |
@@ -617,8 +617,8 @@ discard block |
||
617 | 617 | $colors = '1'; |
618 | 618 | $xm = (($size & self::IMG_DOUBLE_WIDTH) == Printer::IMG_DOUBLE_WIDTH) ? chr(2) : chr(1); |
619 | 619 | $ym = (($size & self::IMG_DOUBLE_HEIGHT) == Printer::IMG_DOUBLE_HEIGHT) ? chr(2) : chr(1); |
620 | - $header = $tone . $xm . $ym . $colors . $imgHeader; |
|
621 | - $this -> wrapperSendGraphicsData('0', 'p', $header . $rasterData); |
|
620 | + $header = $tone.$xm.$ym.$colors.$imgHeader; |
|
621 | + $this -> wrapperSendGraphicsData('0', 'p', $header.$rasterData); |
|
622 | 622 | $this -> wrapperSendGraphicsData('0', '2'); |
623 | 623 | } |
624 | 624 | |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | */ |
628 | 628 | public function initialize() |
629 | 629 | { |
630 | - $this -> connector -> write(self::ESC . "@"); |
|
630 | + $this -> connector -> write(self::ESC."@"); |
|
631 | 631 | $this -> characterTable = 0; |
632 | 632 | } |
633 | 633 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | $this -> wrapperSend2dCodeData(chr(67), $cn, chr($width)); |
671 | 671 | $this -> wrapperSend2dCodeData(chr(68), $cn, chr($heightMultiplier)); |
672 | 672 | // Set error correction ratio: 1% to 400% |
673 | - $ec_int = (int)ceil(floatval($ec) * 10); |
|
673 | + $ec_int = (int) ceil(floatval($ec) * 10); |
|
674 | 674 | $this -> wrapperSend2dCodeData(chr(69), $cn, chr($ec_int), '1'); |
675 | 675 | // Send content & print |
676 | 676 | $this -> wrapperSend2dCodeData(chr(80), $cn, $content, '0'); |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | self::validateInteger($pin, 0, 1, __FUNCTION__); |
691 | 691 | self::validateInteger($on_ms, 1, 511, __FUNCTION__); |
692 | 692 | self::validateInteger($off_ms, 1, 511, __FUNCTION__); |
693 | - $this -> connector -> write(self::ESC . "p" . chr($pin + 48) . chr($on_ms / 2) . chr($off_ms / 2)); |
|
693 | + $this -> connector -> write(self::ESC."p".chr($pin + 48).chr($on_ms / 2).chr($off_ms / 2)); |
|
694 | 694 | } |
695 | 695 | |
696 | 696 | /** |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | } |
716 | 716 | $cn = '1'; // Code type for QR code |
717 | 717 | // Select model: 1, 2 or micro. |
718 | - $this -> wrapperSend2dCodeData(chr(65), $cn, chr(48 + $model) . chr(0)); |
|
718 | + $this -> wrapperSend2dCodeData(chr(65), $cn, chr(48 + $model).chr(0)); |
|
719 | 719 | // Set dot size. |
720 | 720 | $this -> wrapperSend2dCodeData(chr(67), $cn, chr($size)); |
721 | 721 | // Set error correction level: L, M, Q, or H |
@@ -741,10 +741,10 @@ discard block |
||
741 | 741 | $this -> characterTable = $table; |
742 | 742 | if ($this -> profile -> getSupportsStarCommands()) { |
743 | 743 | /* Not an ESC/POS command: STAR printers stash all the extra code pages under a different command. */ |
744 | - $this -> connector -> write(self::ESC . self::GS . "t" . chr($table)); |
|
744 | + $this -> connector -> write(self::ESC.self::GS."t".chr($table)); |
|
745 | 745 | return; |
746 | 746 | } |
747 | - $this -> connector -> write(self::ESC . "t" . chr($table)); |
|
747 | + $this -> connector -> write(self::ESC."t".chr($table)); |
|
748 | 748 | } |
749 | 749 | |
750 | 750 | /** |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | throw new InvalidArgumentException("Invalid mode"); |
768 | 768 | } |
769 | 769 | |
770 | - $this -> connector -> write(self::ESC . "!" . chr($mode)); |
|
770 | + $this -> connector -> write(self::ESC."!".chr($mode)); |
|
771 | 771 | } |
772 | 772 | |
773 | 773 | /** |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | */ |
778 | 778 | public function selectUserDefinedCharacterSet($on = true) |
779 | 779 | { |
780 | - $this -> connector -> write(self::ESC . "%". ($on ? chr(1) : chr(0))); |
|
780 | + $this -> connector -> write(self::ESC."%".($on ? chr(1) : chr(0))); |
|
781 | 781 | } |
782 | 782 | |
783 | 783 | /** |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | public function setBarcodeHeight(int $height = 8) |
789 | 789 | { |
790 | 790 | self::validateInteger($height, 1, 255, __FUNCTION__); |
791 | - $this -> connector -> write(self::GS . "h" . chr($height)); |
|
791 | + $this -> connector -> write(self::GS."h".chr($height)); |
|
792 | 792 | } |
793 | 793 | |
794 | 794 | /** |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | public function setBarcodeWidth(int $width = 3) |
801 | 801 | { |
802 | 802 | self::validateInteger($width, 1, 255, __FUNCTION__); |
803 | - $this -> connector -> write(self::GS . "w" . chr($width)); |
|
803 | + $this -> connector -> write(self::GS."w".chr($width)); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | /** |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | public function setBarcodeTextPosition(int $position = Printer::BARCODE_TEXT_NONE) |
814 | 814 | { |
815 | 815 | self::validateInteger($position, 0, 3, __FUNCTION__, "Barcode text position"); |
816 | - $this -> connector -> write(self::GS . "H" . chr($position)); |
|
816 | + $this -> connector -> write(self::GS."H".chr($position)); |
|
817 | 817 | } |
818 | 818 | |
819 | 819 | /** |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | public function setDoubleStrike(bool $on = true) |
825 | 825 | { |
826 | 826 | self::validateBoolean($on, __FUNCTION__); |
827 | - $this -> connector -> write(self::ESC . "G". ($on ? chr(1) : chr(0))); |
|
827 | + $this -> connector -> write(self::ESC."G".($on ? chr(1) : chr(0))); |
|
828 | 828 | } |
829 | 829 | |
830 | 830 | /** |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | public function setColor(int $color = Printer::COLOR_1) |
836 | 836 | { |
837 | 837 | self::validateInteger($color, 0, 1, __FUNCTION__, "Color"); |
838 | - $this -> connector -> write(self::ESC . "r" . chr($color)); |
|
838 | + $this -> connector -> write(self::ESC."r".chr($color)); |
|
839 | 839 | } |
840 | 840 | |
841 | 841 | /** |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | public function setEmphasis(bool $on = true) |
847 | 847 | { |
848 | 848 | self::validateBoolean($on, __FUNCTION__); |
849 | - $this -> connector -> write(self::ESC . "E". ($on ? chr(1) : chr(0))); |
|
849 | + $this -> connector -> write(self::ESC."E".($on ? chr(1) : chr(0))); |
|
850 | 850 | } |
851 | 851 | |
852 | 852 | /** |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | public function setFont(int $font = Printer::FONT_A) |
858 | 858 | { |
859 | 859 | self::validateInteger($font, 0, 2, __FUNCTION__); |
860 | - $this -> connector -> write(self::ESC . "M" . chr($font)); |
|
860 | + $this -> connector -> write(self::ESC."M".chr($font)); |
|
861 | 861 | } |
862 | 862 | |
863 | 863 | /** |
@@ -868,7 +868,7 @@ discard block |
||
868 | 868 | public function setJustification(int $justification = Printer::JUSTIFY_LEFT) |
869 | 869 | { |
870 | 870 | self::validateInteger($justification, 0, 2, __FUNCTION__); |
871 | - $this -> connector -> write(self::ESC . "a" . chr($justification)); |
|
871 | + $this -> connector -> write(self::ESC."a".chr($justification)); |
|
872 | 872 | } |
873 | 873 | |
874 | 874 | /** |
@@ -883,11 +883,11 @@ discard block |
||
883 | 883 | { |
884 | 884 | if ($height === null) { |
885 | 885 | // Reset to default |
886 | - $this -> connector -> write(self::ESC . "2"); // Revert to default line spacing |
|
886 | + $this -> connector -> write(self::ESC."2"); // Revert to default line spacing |
|
887 | 887 | return; |
888 | 888 | } |
889 | 889 | self::validateInteger($height, 1, 255, __FUNCTION__); |
890 | - $this -> connector -> write(self::ESC . "3" . chr($height)); |
|
890 | + $this -> connector -> write(self::ESC."3".chr($height)); |
|
891 | 891 | } |
892 | 892 | |
893 | 893 | /** |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | public function setPrintLeftMargin(int $margin = 0) |
899 | 899 | { |
900 | 900 | self::validateInteger($margin, 0, 65535, __FUNCTION__); |
901 | - $this -> connector -> write(Printer::GS . 'L' . self::intLowHigh($margin, 2)); |
|
901 | + $this -> connector -> write(Printer::GS.'L'.self::intLowHigh($margin, 2)); |
|
902 | 902 | } |
903 | 903 | |
904 | 904 | /** |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | public function setPrintWidth(int $width = 512) |
911 | 911 | { |
912 | 912 | self::validateInteger($width, 1, 65535, __FUNCTION__); |
913 | - $this -> connector -> write(Printer::GS . 'W' . self::intLowHigh($width, 2)); |
|
913 | + $this -> connector -> write(Printer::GS.'W'.self::intLowHigh($width, 2)); |
|
914 | 914 | } |
915 | 915 | |
916 | 916 | /** |
@@ -942,7 +942,7 @@ discard block |
||
942 | 942 | public function setReverseColors(bool $on = true) |
943 | 943 | { |
944 | 944 | self::validateBoolean($on, __FUNCTION__); |
945 | - $this -> connector -> write(self::GS . "B" . ($on ? chr(1) : chr(0))); |
|
945 | + $this -> connector -> write(self::GS."B".($on ? chr(1) : chr(0))); |
|
946 | 946 | } |
947 | 947 | |
948 | 948 | /** |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | self::validateInteger($widthMultiplier, 1, 8, __FUNCTION__); |
957 | 957 | self::validateInteger($heightMultiplier, 1, 8, __FUNCTION__); |
958 | 958 | $c = (2 << 3) * ($widthMultiplier - 1) + ($heightMultiplier - 1); |
959 | - $this -> connector -> write(self::GS . "!" . chr($c)); |
|
959 | + $this -> connector -> write(self::GS."!".chr($c)); |
|
960 | 960 | } |
961 | 961 | |
962 | 962 | /** |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | { |
969 | 969 | /* Set the underline */ |
970 | 970 | self::validateInteger($underline, 0, 2, __FUNCTION__); |
971 | - $this -> connector -> write(self::ESC . "-" . chr($underline)); |
|
971 | + $this -> connector -> write(self::ESC."-".chr($underline)); |
|
972 | 972 | } |
973 | 973 | |
974 | 974 | /** |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | */ |
979 | 979 | public function setUpsideDown(bool $on = true) |
980 | 980 | { |
981 | - $this -> connector -> write(self::ESC . "{" . ($on ? chr(1) : chr(0))); |
|
981 | + $this -> connector -> write(self::ESC."{".($on ? chr(1) : chr(0))); |
|
982 | 982 | } |
983 | 983 | |
984 | 984 | /** |
@@ -991,7 +991,7 @@ discard block |
||
991 | 991 | */ |
992 | 992 | public function text(string $str) |
993 | 993 | { |
994 | - $this -> buffer -> writeText((string)$str); |
|
994 | + $this -> buffer -> writeText((string) $str); |
|
995 | 995 | } |
996 | 996 | |
997 | 997 | /** |
@@ -1004,10 +1004,10 @@ discard block |
||
1004 | 1004 | */ |
1005 | 1005 | public function textChinese(string $str = "") |
1006 | 1006 | { |
1007 | - $this -> connector -> write(self::FS . "&"); |
|
1007 | + $this -> connector -> write(self::FS."&"); |
|
1008 | 1008 | $str = \UConverter::transcode($str, "GBK", "UTF-8"); |
1009 | - $this -> buffer -> writeTextRaw((string)$str); |
|
1010 | - $this -> connector -> write(self::FS . "."); |
|
1009 | + $this -> buffer -> writeTextRaw((string) $str); |
|
1010 | + $this -> connector -> write(self::FS."."); |
|
1011 | 1011 | } |
1012 | 1012 | |
1013 | 1013 | /** |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | */ |
1021 | 1021 | public function textRaw(string $str = "") |
1022 | 1022 | { |
1023 | - $this -> buffer -> writeTextRaw((string)$str); |
|
1023 | + $this -> buffer -> writeTextRaw((string) $str); |
|
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | /** |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | throw new InvalidArgumentException("wrapperSend2dCodeData: cn and fn must be one character each."); |
1039 | 1039 | } |
1040 | 1040 | $header = $this -> intLowHigh(strlen($data) + strlen($m) + 2, 2); |
1041 | - $this -> connector -> write(self::GS . "(k" . $header . $cn . $fn . $m . $data); |
|
1041 | + $this -> connector -> write(self::GS."(k".$header.$cn.$fn.$m.$data); |
|
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | /** |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | throw new InvalidArgumentException("wrapperSendGraphicsData: m and fn must be one character each."); |
1056 | 1056 | } |
1057 | 1057 | $header = $this -> intLowHigh(strlen($data) + 2, 2); |
1058 | - $this -> connector -> write(self::GS . "(L" . $header . $m . $fn . $data); |
|
1058 | + $this -> connector -> write(self::GS."(L".$header.$m.$fn.$data); |
|
1059 | 1059 | } |
1060 | 1060 | |
1061 | 1061 | /** |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | $outp = ""; |
1094 | 1094 | for ($i = 0; $i < $length; $i++) { |
1095 | 1095 | $outp .= chr($input % 256); |
1096 | - $input = (int)($input / 256); |
|
1096 | + $input = (int) ($input / 256); |
|
1097 | 1097 | } |
1098 | 1098 | return $outp; |
1099 | 1099 | } |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | // Put together a good error "range 1-2 or 4-6" |
1167 | 1167 | $rangeStr = "range "; |
1168 | 1168 | for ($i = 0; $i < count($ranges); $i++) { |
1169 | - $rangeStr .= $ranges[$i][0] . "-" . $ranges[$i][1]; |
|
1169 | + $rangeStr .= $ranges[$i][0]."-".$ranges[$i][1]; |
|
1170 | 1170 | if ($i == count($ranges) - 1) { |
1171 | 1171 | continue; |
1172 | 1172 | } elseif ($i == count($ranges) - 2) { |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | namespace OAuth; |
8 | 8 | |
9 | -require_once __DIR__ . '/Common/AutoLoader.php'; |
|
9 | +require_once __DIR__.'/Common/AutoLoader.php'; |
|
10 | 10 | |
11 | 11 | $autoloader = new Common\AutoLoader(__NAMESPACE__, dirname(__DIR__)); |
12 | 12 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | $path = substr($path, 1); |
72 | 72 | } |
73 | 73 | |
74 | - $uri->setPath($uri->getPath() . $path); |
|
74 | + $uri->setPath($uri->getPath().$path); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $uri; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function __construct($namespace, $path) |
29 | 29 | { |
30 | 30 | $this->namespace = ltrim($namespace, '\\'); |
31 | - $this->path = rtrim($path, '/\\') . DIRECTORY_SEPARATOR; |
|
31 | + $this->path = rtrim($path, '/\\').DIRECTORY_SEPARATOR; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $nsparts = explode('\\', $class); |
47 | 47 | $class = array_pop($nsparts); |
48 | 48 | $nsparts[] = ''; |
49 | - $path = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts); |
|
50 | - $path .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; |
|
49 | + $path = $this->path.implode(DIRECTORY_SEPARATOR, $nsparts); |
|
50 | + $path .= str_replace('_', DIRECTORY_SEPARATOR, $class).'.php'; |
|
51 | 51 | |
52 | 52 | if (file_exists($path)) { |
53 | 53 | require $path; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | // pipeline for performance |
121 | 121 | $this->redis->pipeline( |
122 | - function ($pipe) use ($keys, $me) { |
|
122 | + function($pipe) use ($keys, $me) { |
|
123 | 123 | foreach ($keys as $k) { |
124 | 124 | $pipe->hdel($me->getKey(), $k); |
125 | 125 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | |
202 | 202 | // pipeline for performance |
203 | 203 | $this->redis->pipeline( |
204 | - function ($pipe) use ($keys, $me) { |
|
204 | + function($pipe) use ($keys, $me) { |
|
205 | 205 | foreach ($keys as $k) { |
206 | 206 | $pipe->hdel($me->getKey(), $k); |
207 | 207 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $userInfo .= $uriParts['user']; |
115 | 115 | } |
116 | 116 | if ($userInfo && !empty($uriParts['pass'])) { |
117 | - $userInfo .= ':' . $uriParts['pass']; |
|
117 | + $userInfo .= ':'.$uriParts['pass']; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | $this->setUserInfo($userInfo); |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | // after the first colon (":") character found within a userinfo |
135 | 135 | // subcomponent unless the data after the colon is the empty string |
136 | 136 | // (indicating no password)" |
137 | - if ($colonPos !== false && strlen($rawUserInfo)-1 > $colonPos) { |
|
138 | - return substr($rawUserInfo, 0, $colonPos) . ':********'; |
|
137 | + if ($colonPos !== false && strlen($rawUserInfo) - 1 > $colonPos) { |
|
138 | + return substr($rawUserInfo, 0, $colonPos).':********'; |
|
139 | 139 | } else { |
140 | 140 | return $rawUserInfo; |
141 | 141 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | */ |
244 | 244 | public function getAbsoluteUri() |
245 | 245 | { |
246 | - $uri = $this->scheme . '://' . $this->getRawAuthority(); |
|
246 | + $uri = $this->scheme.'://'.$this->getRawAuthority(); |
|
247 | 247 | |
248 | 248 | if ('/' === $this->path) { |
249 | 249 | $uri .= $this->explicitTrailingHostSlash ? '/' : ''; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | */ |
287 | 287 | public function __toString() |
288 | 288 | { |
289 | - $uri = $this->scheme . '://' . $this->getAuthority(); |
|
289 | + $uri = $this->scheme.'://'.$this->getAuthority(); |
|
290 | 290 | |
291 | 291 | if ('/' === $this->path) { |
292 | 292 | $uri .= $this->explicitTrailingHostSlash ? '/' : ''; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ksort($signatureData); |
66 | 66 | |
67 | 67 | // determine base uri |
68 | - $baseUri = $uri->getScheme() . '://' . $uri->getRawAuthority(); |
|
68 | + $baseUri = $uri->getScheme().'://'.$uri->getRawAuthority(); |
|
69 | 69 | |
70 | 70 | if ('/' === $uri->getPath()) { |
71 | 71 | $baseUri .= $uri->hasExplicitTrailingHostSlash() ? '/' : ''; |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | $baseUri .= $uri->getPath(); |
74 | 74 | } |
75 | 75 | |
76 | - $baseString = strtoupper($method) . '&'; |
|
77 | - $baseString .= rawurlencode($baseUri) . '&'; |
|
76 | + $baseString = strtoupper($method).'&'; |
|
77 | + $baseString .= rawurlencode($baseUri).'&'; |
|
78 | 78 | $baseString .= rawurlencode($this->buildSignatureDataString($signatureData)); |
79 | 79 | |
80 | 80 | return base64_encode($this->hash($baseString)); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $signatureString = ''; |
91 | 91 | $delimiter = ''; |
92 | 92 | foreach ($signatureData as $key => $value) { |
93 | - $signatureString .= $delimiter . $key . '=' . $value; |
|
93 | + $signatureString .= $delimiter.$key.'='.$value; |
|
94 | 94 | |
95 | 95 | $delimiter = '&'; |
96 | 96 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | protected function getSigningKey() |
105 | 105 | { |
106 | - $signingKey = rawurlencode($this->credentials->getConsumerSecret()) . '&'; |
|
106 | + $signingKey = rawurlencode($this->credentials->getConsumerSecret()).'&'; |
|
107 | 107 | if ($this->tokenSecret !== null) { |
108 | 108 | $signingKey .= rawurlencode($this->tokenSecret); |
109 | 109 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return hash_hmac('sha1', $data, $this->getSigningKey(), true); |
126 | 126 | default: |
127 | 127 | throw new UnsupportedHashAlgorithmException( |
128 | - 'Unsupported hashing algorithm (' . $this->algorithm . ') used.' |
|
128 | + 'Unsupported hashing algorithm ('.$this->algorithm.') used.' |
|
129 | 129 | ); |
130 | 130 | } |
131 | 131 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function getRequestTokenEndpoint() |
34 | 34 | { |
35 | - return new Uri($this->baseApiUri->getAbsoluteUri() . '/request_token'); |
|
35 | + return new Uri($this->baseApiUri->getAbsoluteUri().'/request_token'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getAuthorizationEndpoint() |
42 | 42 | { |
43 | - return new Uri($this->baseApiUri->getAbsoluteUri() . '/authorize'); |
|
43 | + return new Uri($this->baseApiUri->getAbsoluteUri().'/authorize'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function getAccessTokenEndpoint() |
50 | 50 | { |
51 | - return new Uri($this->baseApiUri->getAbsoluteUri() . '/access_token'); |
|
51 | + return new Uri($this->baseApiUri->getAbsoluteUri().'/access_token'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (null === $data || !is_array($data)) { |
78 | 78 | throw new TokenResponseException('Unable to parse response.'); |
79 | 79 | } elseif (isset($data['error'])) { |
80 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
80 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $token = new StdOAuth1Token(); |