@@ -1689,40 +1689,40 @@ discard block |
||
1689 | 1689 | //Convert digits to bars |
1690 | 1690 | $codes = [ |
1691 | 1691 | 'A' => [ // left odd parity |
1692 | - '0' => '0001101', |
|
1693 | - '1' => '0011001', |
|
1694 | - '2' => '0010011', |
|
1695 | - '3' => '0111101', |
|
1696 | - '4' => '0100011', |
|
1697 | - '5' => '0110001', |
|
1698 | - '6' => '0101111', |
|
1699 | - '7' => '0111011', |
|
1700 | - '8' => '0110111', |
|
1701 | - '9' => '0001011' |
|
1692 | + '0' => '0001101', |
|
1693 | + '1' => '0011001', |
|
1694 | + '2' => '0010011', |
|
1695 | + '3' => '0111101', |
|
1696 | + '4' => '0100011', |
|
1697 | + '5' => '0110001', |
|
1698 | + '6' => '0101111', |
|
1699 | + '7' => '0111011', |
|
1700 | + '8' => '0110111', |
|
1701 | + '9' => '0001011' |
|
1702 | 1702 | ], |
1703 | 1703 | 'B' => [ // left even parity |
1704 | - '0' => '0100111', |
|
1705 | - '1' => '0110011', |
|
1706 | - '2' => '0011011', |
|
1707 | - '3' => '0100001', |
|
1708 | - '4' => '0011101', |
|
1709 | - '5' => '0111001', |
|
1710 | - '6' => '0000101', |
|
1711 | - '7' => '0010001', |
|
1712 | - '8' => '0001001', |
|
1713 | - '9' => '0010111' |
|
1704 | + '0' => '0100111', |
|
1705 | + '1' => '0110011', |
|
1706 | + '2' => '0011011', |
|
1707 | + '3' => '0100001', |
|
1708 | + '4' => '0011101', |
|
1709 | + '5' => '0111001', |
|
1710 | + '6' => '0000101', |
|
1711 | + '7' => '0010001', |
|
1712 | + '8' => '0001001', |
|
1713 | + '9' => '0010111' |
|
1714 | 1714 | ], |
1715 | 1715 | 'C' => [ // right |
1716 | - '0' => '1110010', |
|
1717 | - '1' => '1100110', |
|
1718 | - '2' => '1101100', |
|
1719 | - '3' => '1000010', |
|
1720 | - '4' => '1011100', |
|
1721 | - '5' => '1001110', |
|
1722 | - '6' => '1010000', |
|
1723 | - '7' => '1000100', |
|
1724 | - '8' => '1001000', |
|
1725 | - '9' => '1110100' |
|
1716 | + '0' => '1110010', |
|
1717 | + '1' => '1100110', |
|
1718 | + '2' => '1101100', |
|
1719 | + '3' => '1000010', |
|
1720 | + '4' => '1011100', |
|
1721 | + '5' => '1001110', |
|
1722 | + '6' => '1010000', |
|
1723 | + '7' => '1000100', |
|
1724 | + '8' => '1001000', |
|
1725 | + '9' => '1110100' |
|
1726 | 1726 | ] |
1727 | 1727 | ]; |
1728 | 1728 | $parities = [ |
@@ -1851,28 +1851,28 @@ discard block |
||
1851 | 1851 | //Convert digits to bars |
1852 | 1852 | $codes = [ |
1853 | 1853 | 'A' => [ // left odd parity |
1854 | - '0' => '0001101', |
|
1855 | - '1' => '0011001', |
|
1856 | - '2' => '0010011', |
|
1857 | - '3' => '0111101', |
|
1858 | - '4' => '0100011', |
|
1859 | - '5' => '0110001', |
|
1860 | - '6' => '0101111', |
|
1861 | - '7' => '0111011', |
|
1862 | - '8' => '0110111', |
|
1863 | - '9' => '0001011' |
|
1854 | + '0' => '0001101', |
|
1855 | + '1' => '0011001', |
|
1856 | + '2' => '0010011', |
|
1857 | + '3' => '0111101', |
|
1858 | + '4' => '0100011', |
|
1859 | + '5' => '0110001', |
|
1860 | + '6' => '0101111', |
|
1861 | + '7' => '0111011', |
|
1862 | + '8' => '0110111', |
|
1863 | + '9' => '0001011' |
|
1864 | 1864 | ], |
1865 | 1865 | 'B' => [ // left even parity |
1866 | - '0' => '0100111', |
|
1867 | - '1' => '0110011', |
|
1868 | - '2' => '0011011', |
|
1869 | - '3' => '0100001', |
|
1870 | - '4' => '0011101', |
|
1871 | - '5' => '0111001', |
|
1872 | - '6' => '0000101', |
|
1873 | - '7' => '0010001', |
|
1874 | - '8' => '0001001', |
|
1875 | - '9' => '0010111' |
|
1866 | + '0' => '0100111', |
|
1867 | + '1' => '0110011', |
|
1868 | + '2' => '0011011', |
|
1869 | + '3' => '0100001', |
|
1870 | + '4' => '0011101', |
|
1871 | + '5' => '0111001', |
|
1872 | + '6' => '0000101', |
|
1873 | + '7' => '0010001', |
|
1874 | + '8' => '0001001', |
|
1875 | + '9' => '0010111' |
|
1876 | 1876 | ] |
1877 | 1877 | ]; |
1878 | 1878 | $parities = []; |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | for ($i = 0; $i < $clen; ++$i) |
314 | 314 | { |
315 | 315 | $char = $code{$i}; |
316 | - if (!isset($chr[ $char ])) |
|
316 | + if (!isset($chr[$char])) |
|
317 | 317 | { |
318 | 318 | // invalid character |
319 | 319 | return FALSE; |
@@ -327,13 +327,13 @@ discard block |
||
327 | 327 | { |
328 | 328 | $t = FALSE; // space |
329 | 329 | } |
330 | - $w = $chr[ $char ]{$j}; |
|
331 | - $bararray['bcode'][ $k ] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
330 | + $w = $chr[$char]{$j}; |
|
331 | + $bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
332 | 332 | $bararray['maxw'] += $w; |
333 | 333 | ++$k; |
334 | 334 | } |
335 | 335 | // intercharacter gap |
336 | - $bararray['bcode'][ $k ] = ['t' => FALSE, 'w' => 1, 'h' => 1, 'p' => 0]; |
|
336 | + $bararray['bcode'][$k] = ['t' => FALSE, 'w' => 1, 'h' => 1, 'p' => 0]; |
|
337 | 337 | $bararray['maxw'] += 1; |
338 | 338 | ++$k; |
339 | 339 | } |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | */ |
351 | 351 | protected function encode_code39_ext($code) |
352 | 352 | { |
353 | - $encode = [ |
|
353 | + $encode = [ |
|
354 | 354 | chr(0) => '%U', |
355 | 355 | chr(1) => '$A', |
356 | 356 | chr(2) => '$B', |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | { |
489 | 489 | return FALSE; |
490 | 490 | } |
491 | - $code_ext .= $encode[ $code{$i} ]; |
|
491 | + $code_ext .= $encode[$code{$i}]; |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | return $code_ext; |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | } |
558 | 558 | $j = ($sum % 43); |
559 | 559 | |
560 | - return $chars[ $j ]; |
|
560 | + return $chars[$j]; |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | /** |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | { |
759 | 759 | return FALSE; |
760 | 760 | } |
761 | - $code_ext .= $encode[ $code{$i} ]; |
|
761 | + $code_ext .= $encode[$code{$i}]; |
|
762 | 762 | } |
763 | 763 | // checksum |
764 | 764 | $code_ext .= $this->checksum_code93($code_ext); |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | for ($i = 0; $i < $clen; ++$i) |
771 | 771 | { |
772 | 772 | $char = ord($code{$i}); |
773 | - if (!isset($chr[ $char ])) |
|
773 | + if (!isset($chr[$char])) |
|
774 | 774 | { |
775 | 775 | // invalid character |
776 | 776 | return FALSE; |
@@ -784,13 +784,13 @@ discard block |
||
784 | 784 | { |
785 | 785 | $t = FALSE; // space |
786 | 786 | } |
787 | - $w = $chr[ $char ]{$j}; |
|
788 | - $bararray['bcode'][ $k ] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
787 | + $w = $chr[$char]{$j}; |
|
788 | + $bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
789 | 789 | $bararray['maxw'] += $w; |
790 | 790 | ++$k; |
791 | 791 | } |
792 | 792 | } |
793 | - $bararray['bcode'][ $k ] = ['t' => TRUE, 'w' => 1, 'h' => 1, 'p' => 0]; |
|
793 | + $bararray['bcode'][$k] = ['t' => TRUE, 'w' => 1, 'h' => 1, 'p' => 0]; |
|
794 | 794 | $bararray['maxw'] += 1; |
795 | 795 | |
796 | 796 | return $bararray; |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | } |
872 | 872 | } |
873 | 873 | $check %= 47; |
874 | - $c = $chars[ $check ]; |
|
874 | + $c = $chars[$check]; |
|
875 | 875 | $code .= $c; |
876 | 876 | // calculate check digit K |
877 | 877 | $p = 1; |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | } |
888 | 888 | } |
889 | 889 | $check %= 47; |
890 | - $k = $chars[ $check ]; |
|
890 | + $k = $chars[$check]; |
|
891 | 891 | $checksum = $c . $k; |
892 | 892 | // resto respecial characters |
893 | 893 | $checksum = strtr($checksum, '<=>?', chr(128) . chr(131) . chr(129) . chr(130)); |
@@ -979,12 +979,12 @@ discard block |
||
979 | 979 | for ($i = 0; $i < $clen; ++$i) |
980 | 980 | { |
981 | 981 | $digit = $code{$i}; |
982 | - if (!isset($chr[ $digit ])) |
|
982 | + if (!isset($chr[$digit])) |
|
983 | 983 | { |
984 | 984 | // invalid character |
985 | 985 | return FALSE; |
986 | 986 | } |
987 | - $seq .= $chr[ $digit ]; |
|
987 | + $seq .= $chr[$digit]; |
|
988 | 988 | } |
989 | 989 | $seq .= '1001'; // right guard |
990 | 990 | $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => []]; |
@@ -1029,12 +1029,12 @@ discard block |
||
1029 | 1029 | for ($i = 0; $i < $clen; ++$i) |
1030 | 1030 | { |
1031 | 1031 | $digit = $code{$i}; |
1032 | - if (!isset($chr[ $digit ])) |
|
1032 | + if (!isset($chr[$digit])) |
|
1033 | 1033 | { |
1034 | 1034 | // invalid character |
1035 | 1035 | return FALSE; |
1036 | 1036 | } |
1037 | - $seq .= $chr[ $digit ]; |
|
1037 | + $seq .= $chr[$digit]; |
|
1038 | 1038 | } |
1039 | 1039 | $seq .= '1101011'; |
1040 | 1040 | $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => []]; |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | { |
1069 | 1069 | $t = FALSE; // space |
1070 | 1070 | } |
1071 | - $bararray['bcode'][ $k ] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
1071 | + $bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
1072 | 1072 | $bararray['maxw'] += $w; |
1073 | 1073 | ++$k; |
1074 | 1074 | $w = 0; |
@@ -1122,17 +1122,17 @@ discard block |
||
1122 | 1122 | { |
1123 | 1123 | $char_bar = $code{$i}; |
1124 | 1124 | $char_space = $code{$i + 1}; |
1125 | - if ((!isset($chr[ $char_bar ])) OR (!isset($chr[ $char_space ]))) |
|
1125 | + if ((!isset($chr[$char_bar])) OR (!isset($chr[$char_space]))) |
|
1126 | 1126 | { |
1127 | 1127 | // invalid character |
1128 | 1128 | return FALSE; |
1129 | 1129 | } |
1130 | 1130 | // create a bar-space sequence |
1131 | 1131 | $seq = ''; |
1132 | - $chrlen = strlen($chr[ $char_bar ]); |
|
1132 | + $chrlen = strlen($chr[$char_bar]); |
|
1133 | 1133 | for ($s = 0; $s < $chrlen; $s++) |
1134 | 1134 | { |
1135 | - $seq .= $chr[ $char_bar ]{$s} . $chr[ $char_space ]{$s}; |
|
1135 | + $seq .= $chr[$char_bar]{$s} . $chr[$char_space]{$s}; |
|
1136 | 1136 | } |
1137 | 1137 | $seqlen = strlen($seq); |
1138 | 1138 | for ($j = 0; $j < $seqlen; ++$j) |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | $t = FALSE; // space |
1146 | 1146 | } |
1147 | 1147 | $w = $seq{$j}; |
1148 | - $bararray['bcode'][ $k ] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
1148 | + $bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
1149 | 1149 | $bararray['maxw'] += $w; |
1150 | 1150 | ++$k; |
1151 | 1151 | } |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | $char_id = ord($char); |
1302 | 1302 | if (($char_id >= 241) AND ($char_id <= 244)) |
1303 | 1303 | { |
1304 | - $code_data[] = $fnc_a[ $char_id ]; |
|
1304 | + $code_data[] = $fnc_a[$char_id]; |
|
1305 | 1305 | } elseif (($char_id >= 0) AND ($char_id <= 95)) |
1306 | 1306 | { |
1307 | 1307 | $code_data[] = strpos($keys_a, $char); |
@@ -1321,7 +1321,7 @@ discard block |
||
1321 | 1321 | $char_id = ord($char); |
1322 | 1322 | if (($char_id >= 241) AND ($char_id <= 244)) |
1323 | 1323 | { |
1324 | - $code_data[] = $fnc_b[ $char_id ]; |
|
1324 | + $code_data[] = $fnc_b[$char_id]; |
|
1325 | 1325 | } elseif (($char_id >= 32) AND ($char_id <= 127)) |
1326 | 1326 | { |
1327 | 1327 | $code_data[] = strpos($keys_b, $char); |
@@ -1408,15 +1408,15 @@ discard block |
||
1408 | 1408 | if ($key == 0) |
1409 | 1409 | { |
1410 | 1410 | $startid = 103; |
1411 | - } elseif ($sequence[ ($key - 1) ][0] != 'A') |
|
1411 | + } elseif ($sequence[($key - 1)][0] != 'A') |
|
1412 | 1412 | { |
1413 | - if (($seq[2] == 1) AND ($key > 0) AND ($sequence[ ($key - 1) ][0] == 'B') AND (!isset($sequence[ ($key - 1) ][3]))) |
|
1413 | + if (($seq[2] == 1) AND ($key > 0) AND ($sequence[($key - 1)][0] == 'B') AND (!isset($sequence[($key - 1)][3]))) |
|
1414 | 1414 | { |
1415 | 1415 | // single character shift |
1416 | 1416 | $code_data[] = 98; |
1417 | 1417 | // mark shift |
1418 | - $sequence[ $key ][3] = TRUE; |
|
1419 | - } elseif (!isset($sequence[ ($key - 1) ][3])) |
|
1418 | + $sequence[$key][3] = TRUE; |
|
1419 | + } elseif (!isset($sequence[($key - 1)][3])) |
|
1420 | 1420 | { |
1421 | 1421 | $code_data[] = 101; |
1422 | 1422 | } |
@@ -1427,7 +1427,7 @@ discard block |
||
1427 | 1427 | $char_id = ord($char); |
1428 | 1428 | if (($char_id >= 241) AND ($char_id <= 244)) |
1429 | 1429 | { |
1430 | - $code_data[] = $fnc_a[ $char_id ]; |
|
1430 | + $code_data[] = $fnc_a[$char_id]; |
|
1431 | 1431 | } else |
1432 | 1432 | { |
1433 | 1433 | $code_data[] = strpos($keys_a, $char); |
@@ -1440,22 +1440,22 @@ discard block |
||
1440 | 1440 | if ($key == 0) |
1441 | 1441 | { |
1442 | 1442 | $tmpchr = ord($seq[1][0]); |
1443 | - if (($seq[2] == 1) AND ($tmpchr >= 241) AND ($tmpchr <= 244) AND isset($sequence[ ($key + 1) ]) AND ($sequence[ ($key + 1) ][0] != 'B')) |
|
1443 | + if (($seq[2] == 1) AND ($tmpchr >= 241) AND ($tmpchr <= 244) AND isset($sequence[($key + 1)]) AND ($sequence[($key + 1)][0] != 'B')) |
|
1444 | 1444 | { |
1445 | - switch ($sequence[ ($key + 1) ][0]) |
|
1445 | + switch ($sequence[($key + 1)][0]) |
|
1446 | 1446 | { |
1447 | 1447 | case 'A': |
1448 | 1448 | { |
1449 | 1449 | $startid = 103; |
1450 | - $sequence[ $key ][0] = 'A'; |
|
1451 | - $code_data[] = $fnc_a[ $tmpchr ]; |
|
1450 | + $sequence[$key][0] = 'A'; |
|
1451 | + $code_data[] = $fnc_a[$tmpchr]; |
|
1452 | 1452 | break; |
1453 | 1453 | } |
1454 | 1454 | case 'C': |
1455 | 1455 | { |
1456 | 1456 | $startid = 105; |
1457 | - $sequence[ $key ][0] = 'C'; |
|
1458 | - $code_data[] = $fnc_a[ $tmpchr ]; |
|
1457 | + $sequence[$key][0] = 'C'; |
|
1458 | + $code_data[] = $fnc_a[$tmpchr]; |
|
1459 | 1459 | break; |
1460 | 1460 | } |
1461 | 1461 | } |
@@ -1464,15 +1464,15 @@ discard block |
||
1464 | 1464 | { |
1465 | 1465 | $startid = 104; |
1466 | 1466 | } |
1467 | - } elseif ($sequence[ ($key - 1) ][0] != 'B') |
|
1467 | + } elseif ($sequence[($key - 1)][0] != 'B') |
|
1468 | 1468 | { |
1469 | - if (($seq[2] == 1) AND ($key > 0) AND ($sequence[ ($key - 1) ][0] == 'A') AND (!isset($sequence[ ($key - 1) ][3]))) |
|
1469 | + if (($seq[2] == 1) AND ($key > 0) AND ($sequence[($key - 1)][0] == 'A') AND (!isset($sequence[($key - 1)][3]))) |
|
1470 | 1470 | { |
1471 | 1471 | // single character shift |
1472 | 1472 | $code_data[] = 98; |
1473 | 1473 | // mark shift |
1474 | - $sequence[ $key ][3] = TRUE; |
|
1475 | - } elseif (!isset($sequence[ ($key - 1) ][3])) |
|
1474 | + $sequence[$key][3] = TRUE; |
|
1475 | + } elseif (!isset($sequence[($key - 1)][3])) |
|
1476 | 1476 | { |
1477 | 1477 | $code_data[] = 100; |
1478 | 1478 | } |
@@ -1483,7 +1483,7 @@ discard block |
||
1483 | 1483 | $char_id = ord($char); |
1484 | 1484 | if (($char_id >= 241) AND ($char_id <= 244)) |
1485 | 1485 | { |
1486 | - $code_data[] = $fnc_b[ $char_id ]; |
|
1486 | + $code_data[] = $fnc_b[$char_id]; |
|
1487 | 1487 | } else |
1488 | 1488 | { |
1489 | 1489 | $code_data[] = strpos($keys_b, $char); |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | if ($key == 0) |
1497 | 1497 | { |
1498 | 1498 | $startid = 105; |
1499 | - } elseif ($sequence[ ($key - 1) ][0] != 'C') |
|
1499 | + } elseif ($sequence[($key - 1)][0] != 'C') |
|
1500 | 1500 | { |
1501 | 1501 | $code_data[] = 99; |
1502 | 1502 | } |
@@ -1528,7 +1528,7 @@ discard block |
||
1528 | 1528 | $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => []]; |
1529 | 1529 | foreach ($code_data as $val) |
1530 | 1530 | { |
1531 | - $seq = $chr[ $val ]; |
|
1531 | + $seq = $chr[$val]; |
|
1532 | 1532 | for ($j = 0; $j < 6; ++$j) |
1533 | 1533 | { |
1534 | 1534 | if (($j % 2) == 0) |
@@ -1687,8 +1687,8 @@ discard block |
||
1687 | 1687 | } |
1688 | 1688 | } |
1689 | 1689 | //Convert digits to bars |
1690 | - $codes = [ |
|
1691 | - 'A' => [ // left odd parity |
|
1690 | + $codes = [ |
|
1691 | + 'A' => [// left odd parity |
|
1692 | 1692 | '0' => '0001101', |
1693 | 1693 | '1' => '0011001', |
1694 | 1694 | '2' => '0010011', |
@@ -1700,7 +1700,7 @@ discard block |
||
1700 | 1700 | '8' => '0110111', |
1701 | 1701 | '9' => '0001011' |
1702 | 1702 | ], |
1703 | - 'B' => [ // left even parity |
|
1703 | + 'B' => [// left even parity |
|
1704 | 1704 | '0' => '0100111', |
1705 | 1705 | '1' => '0110011', |
1706 | 1706 | '2' => '0011011', |
@@ -1712,7 +1712,7 @@ discard block |
||
1712 | 1712 | '8' => '0001001', |
1713 | 1713 | '9' => '0010111' |
1714 | 1714 | ], |
1715 | - 'C' => [ // right |
|
1715 | + 'C' => [// right |
|
1716 | 1716 | '0' => '1110010', |
1717 | 1717 | '1' => '1100110', |
1718 | 1718 | '2' => '1101100', |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | '9' => '1110100' |
1726 | 1726 | ] |
1727 | 1727 | ]; |
1728 | - $parities = [ |
|
1728 | + $parities = [ |
|
1729 | 1729 | '0' => ['A', 'A', 'A', 'A', 'A', 'A'], |
1730 | 1730 | '1' => ['A', 'A', 'B', 'A', 'B', 'B'], |
1731 | 1731 | '2' => ['A', 'A', 'B', 'B', 'A', 'B'], |
@@ -1767,10 +1767,10 @@ discard block |
||
1767 | 1767 | if ($upce) |
1768 | 1768 | { |
1769 | 1769 | $bararray = ['code' => $upce_code, 'maxw' => 0, 'maxh' => 1, 'bcode' => []]; |
1770 | - $p = $upce_parities[ $code[1] ][ $r ]; |
|
1770 | + $p = $upce_parities[$code[1]][$r]; |
|
1771 | 1771 | for ($i = 0; $i < 6; ++$i) |
1772 | 1772 | { |
1773 | - $seq .= $codes[ $p[ $i ] ][ $upce_code{$i} ]; |
|
1773 | + $seq .= $codes[$p[$i]][$upce_code{$i}]; |
|
1774 | 1774 | } |
1775 | 1775 | $seq .= '010101'; // right guard bar |
1776 | 1776 | } else |
@@ -1781,20 +1781,20 @@ discard block |
||
1781 | 1781 | { |
1782 | 1782 | for ($i = 0; $i < $half_len; ++$i) |
1783 | 1783 | { |
1784 | - $seq .= $codes['A'][ $code{$i} ]; |
|
1784 | + $seq .= $codes['A'][$code{$i}]; |
|
1785 | 1785 | } |
1786 | 1786 | } else |
1787 | 1787 | { |
1788 | - $p = $parities[ $code[0] ]; |
|
1788 | + $p = $parities[$code[0]]; |
|
1789 | 1789 | for ($i = 1; $i < $half_len; ++$i) |
1790 | 1790 | { |
1791 | - $seq .= $codes[ $p[ $i - 1 ] ][ $code{$i} ]; |
|
1791 | + $seq .= $codes[$p[$i - 1]][$code{$i}]; |
|
1792 | 1792 | } |
1793 | 1793 | } |
1794 | 1794 | $seq .= '01010'; // center guard bar |
1795 | 1795 | for ($i = $half_len; $i < $len; ++$i) |
1796 | 1796 | { |
1797 | - $seq .= $codes['C'][ $code{$i} ]; |
|
1797 | + $seq .= $codes['C'][$code{$i}]; |
|
1798 | 1798 | } |
1799 | 1799 | $seq .= '101'; // right guard bar |
1800 | 1800 | } |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | { |
1813 | 1813 | $t = FALSE; // space |
1814 | 1814 | } |
1815 | - $bararray['bcode'][ $k ] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
1815 | + $bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
1816 | 1816 | $bararray['maxw'] += $w; |
1817 | 1817 | ++$k; |
1818 | 1818 | $w = 0; |
@@ -1849,8 +1849,8 @@ discard block |
||
1849 | 1849 | return FALSE; |
1850 | 1850 | } |
1851 | 1851 | //Convert digits to bars |
1852 | - $codes = [ |
|
1853 | - 'A' => [ // left odd parity |
|
1852 | + $codes = [ |
|
1853 | + 'A' => [// left odd parity |
|
1854 | 1854 | '0' => '0001101', |
1855 | 1855 | '1' => '0011001', |
1856 | 1856 | '2' => '0010011', |
@@ -1862,7 +1862,7 @@ discard block |
||
1862 | 1862 | '8' => '0110111', |
1863 | 1863 | '9' => '0001011' |
1864 | 1864 | ], |
1865 | - 'B' => [ // left even parity |
|
1865 | + 'B' => [// left even parity |
|
1866 | 1866 | '0' => '0100111', |
1867 | 1867 | '1' => '0110011', |
1868 | 1868 | '2' => '0011011', |
@@ -1894,13 +1894,13 @@ discard block |
||
1894 | 1894 | '8' => ['A', 'B', 'A', 'A', 'B'], |
1895 | 1895 | '9' => ['A', 'A', 'B', 'A', 'B'] |
1896 | 1896 | ]; |
1897 | - $p = $parities[ $len ][ $r ]; |
|
1897 | + $p = $parities[$len][$r]; |
|
1898 | 1898 | $seq = '1011'; // left guard bar |
1899 | - $seq .= $codes[ $p[0] ][ $code[0] ]; |
|
1899 | + $seq .= $codes[$p[0]][$code[0]]; |
|
1900 | 1900 | for ($i = 1; $i < $len; ++$i) |
1901 | 1901 | { |
1902 | 1902 | $seq .= '01'; // separator |
1903 | - $seq .= $codes[ $p[ $i ] ][ $code{$i} ]; |
|
1903 | + $seq .= $codes[$p[$i]][$code{$i}]; |
|
1904 | 1904 | } |
1905 | 1905 | $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => []]; |
1906 | 1906 | |
@@ -1968,22 +1968,22 @@ discard block |
||
1968 | 1968 | $code .= $chkd; |
1969 | 1969 | $len = strlen($code); |
1970 | 1970 | // start bar |
1971 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
1972 | - $bararray['bcode'][ $k++ ] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
1971 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
1972 | + $bararray['bcode'][$k++] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
1973 | 1973 | $bararray['maxw'] += 2; |
1974 | 1974 | for ($i = 0; $i < $len; ++$i) |
1975 | 1975 | { |
1976 | 1976 | for ($j = 0; $j < 5; ++$j) |
1977 | 1977 | { |
1978 | - $h = $barlen[ $code{$i} ][ $j ]; |
|
1978 | + $h = $barlen[$code{$i}][$j]; |
|
1979 | 1979 | $p = floor(1 / $h); |
1980 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
1981 | - $bararray['bcode'][ $k++ ] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
1980 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
1981 | + $bararray['bcode'][$k++] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
1982 | 1982 | $bararray['maxw'] += 2; |
1983 | 1983 | } |
1984 | 1984 | } |
1985 | 1985 | // end bar |
1986 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
1986 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
1987 | 1987 | $bararray['maxw'] += 1; |
1988 | 1988 | |
1989 | 1989 | return $bararray; |
@@ -2008,7 +2008,7 @@ discard block |
||
2008 | 2008 | // 2 = pos 1, length 3 |
2009 | 2009 | // 3 = pos 2, length 1 |
2010 | 2010 | // 4 = pos 2, length 2 |
2011 | - $barmode = [ |
|
2011 | + $barmode = [ |
|
2012 | 2012 | '0' => [3, 3, 2, 2], |
2013 | 2013 | '1' => [3, 4, 1, 2], |
2014 | 2014 | '2' => [3, 4, 2, 1], |
@@ -2094,8 +2094,8 @@ discard block |
||
2094 | 2094 | $col = 0; |
2095 | 2095 | for ($i = 0; $i < $len; ++$i) |
2096 | 2096 | { |
2097 | - $row += $checktable[ $code{$i} ][0]; |
|
2098 | - $col += $checktable[ $code{$i} ][1]; |
|
2097 | + $row += $checktable[$code{$i}][0]; |
|
2098 | + $col += $checktable[$code{$i}][1]; |
|
2099 | 2099 | } |
2100 | 2100 | $row %= 6; |
2101 | 2101 | $col %= 6; |
@@ -2107,15 +2107,15 @@ discard block |
||
2107 | 2107 | if ($notkix) |
2108 | 2108 | { |
2109 | 2109 | // start bar |
2110 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2111 | - $bararray['bcode'][ $k++ ] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2110 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2111 | + $bararray['bcode'][$k++] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2112 | 2112 | $bararray['maxw'] += 2; |
2113 | 2113 | } |
2114 | 2114 | for ($i = 0; $i < $len; ++$i) |
2115 | 2115 | { |
2116 | 2116 | for ($j = 0; $j < 4; ++$j) |
2117 | 2117 | { |
2118 | - switch ($barmode[ $code{$i} ][ $j ]) |
|
2118 | + switch ($barmode[$code{$i}][$j]) |
|
2119 | 2119 | { |
2120 | 2120 | case 1: |
2121 | 2121 | { |
@@ -2142,15 +2142,15 @@ discard block |
||
2142 | 2142 | break; |
2143 | 2143 | } |
2144 | 2144 | } |
2145 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
2146 | - $bararray['bcode'][ $k++ ] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2145 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
2146 | + $bararray['bcode'][$k++] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2147 | 2147 | $bararray['maxw'] += 2; |
2148 | 2148 | } |
2149 | 2149 | } |
2150 | 2150 | if ($notkix) |
2151 | 2151 | { |
2152 | 2152 | // stop bar |
2153 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => 3, 'p' => 0]; |
|
2153 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => 3, 'p' => 0]; |
|
2154 | 2154 | $bararray['maxw'] += 1; |
2155 | 2155 | } |
2156 | 2156 | |
@@ -2167,7 +2167,7 @@ discard block |
||
2167 | 2167 | */ |
2168 | 2168 | protected function barcode_codabar($code) |
2169 | 2169 | { |
2170 | - $chr = [ |
|
2170 | + $chr = [ |
|
2171 | 2171 | '0' => '11111221', |
2172 | 2172 | '1' => '11112211', |
2173 | 2173 | '2' => '11121121', |
@@ -2197,11 +2197,11 @@ discard block |
||
2197 | 2197 | $len = strlen($code); |
2198 | 2198 | for ($i = 0; $i < $len; ++$i) |
2199 | 2199 | { |
2200 | - if (!isset($chr[ $code{$i} ])) |
|
2200 | + if (!isset($chr[$code{$i}])) |
|
2201 | 2201 | { |
2202 | 2202 | return FALSE; |
2203 | 2203 | } |
2204 | - $seq = $chr[ $code{$i} ]; |
|
2204 | + $seq = $chr[$code{$i}]; |
|
2205 | 2205 | for ($j = 0; $j < 8; ++$j) |
2206 | 2206 | { |
2207 | 2207 | if (($j % 2) == 0) |
@@ -2212,7 +2212,7 @@ discard block |
||
2212 | 2212 | $t = FALSE; // space |
2213 | 2213 | } |
2214 | 2214 | $w = $seq{$j}; |
2215 | - $bararray['bcode'][ $k ] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
2215 | + $bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
2216 | 2216 | $bararray['maxw'] += $w; |
2217 | 2217 | ++$k; |
2218 | 2218 | } |
@@ -2231,7 +2231,7 @@ discard block |
||
2231 | 2231 | */ |
2232 | 2232 | protected function barcode_code11($code) |
2233 | 2233 | { |
2234 | - $chr = [ |
|
2234 | + $chr = [ |
|
2235 | 2235 | '0' => '111121', |
2236 | 2236 | '1' => '211121', |
2237 | 2237 | '2' => '121121', |
@@ -2306,11 +2306,11 @@ discard block |
||
2306 | 2306 | $len += 3; |
2307 | 2307 | for ($i = 0; $i < $len; ++$i) |
2308 | 2308 | { |
2309 | - if (!isset($chr[ $code{$i} ])) |
|
2309 | + if (!isset($chr[$code{$i}])) |
|
2310 | 2310 | { |
2311 | 2311 | return FALSE; |
2312 | 2312 | } |
2313 | - $seq = $chr[ $code{$i} ]; |
|
2313 | + $seq = $chr[$code{$i}]; |
|
2314 | 2314 | for ($j = 0; $j < 6; ++$j) |
2315 | 2315 | { |
2316 | 2316 | if (($j % 2) == 0) |
@@ -2321,7 +2321,7 @@ discard block |
||
2321 | 2321 | $t = FALSE; // space |
2322 | 2322 | } |
2323 | 2323 | $w = $seq{$j}; |
2324 | - $bararray['bcode'][ $k ] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
2324 | + $bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; |
|
2325 | 2325 | $bararray['maxw'] += $w; |
2326 | 2326 | ++$k; |
2327 | 2327 | } |
@@ -2425,11 +2425,11 @@ discard block |
||
2425 | 2425 | break; |
2426 | 2426 | } |
2427 | 2427 | } |
2428 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
2429 | - $bararray['bcode'][ $k++ ] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2428 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
2429 | + $bararray['bcode'][$k++] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2430 | 2430 | $bararray['maxw'] += 2; |
2431 | 2431 | } |
2432 | - unset($bararray['bcode'][ ($k - 1) ]); |
|
2432 | + unset($bararray['bcode'][($k - 1)]); |
|
2433 | 2433 | --$bararray['maxw']; |
2434 | 2434 | |
2435 | 2435 | return $bararray; |
@@ -2464,7 +2464,7 @@ discard block |
||
2464 | 2464 | */ |
2465 | 2465 | protected function barcode_imb($code) |
2466 | 2466 | { |
2467 | - $asc_chr = [ |
|
2467 | + $asc_chr = [ |
|
2468 | 2468 | 4, |
2469 | 2469 | 0, |
2470 | 2470 | 2, |
@@ -2531,7 +2531,7 @@ discard block |
||
2531 | 2531 | 5, |
2532 | 2532 | 8 |
2533 | 2533 | ]; |
2534 | - $dsc_chr = [ |
|
2534 | + $dsc_chr = [ |
|
2535 | 2535 | 7, |
2536 | 2536 | 1, |
2537 | 2537 | 9, |
@@ -2598,7 +2598,7 @@ discard block |
||
2598 | 2598 | 6, |
2599 | 2599 | 3 |
2600 | 2600 | ]; |
2601 | - $asc_pos = [ |
|
2601 | + $asc_pos = [ |
|
2602 | 2602 | 3, |
2603 | 2603 | 0, |
2604 | 2604 | 8, |
@@ -2665,7 +2665,7 @@ discard block |
||
2665 | 2665 | 3, |
2666 | 2666 | 2 |
2667 | 2667 | ]; |
2668 | - $dsc_pos = [ |
|
2668 | + $dsc_pos = [ |
|
2669 | 2669 | 2, |
2670 | 2670 | 10, |
2671 | 2671 | 12, |
@@ -2795,7 +2795,7 @@ discard block |
||
2795 | 2795 | $data = bcdiv($data, 636); |
2796 | 2796 | for ($i = 1; $i < 9; ++$i) |
2797 | 2797 | { |
2798 | - $codewords[ $i ] = bcmod($data, 1365); |
|
2798 | + $codewords[$i] = bcmod($data, 1365); |
|
2799 | 2799 | $data = bcdiv($data, 1365); |
2800 | 2800 | } |
2801 | 2801 | $codewords[9] = $data; |
@@ -2813,10 +2813,10 @@ discard block |
||
2813 | 2813 | { |
2814 | 2814 | if ($val <= 1286) |
2815 | 2815 | { |
2816 | - $chrcode = $table5of13[ $val ]; |
|
2816 | + $chrcode = $table5of13[$val]; |
|
2817 | 2817 | } else |
2818 | 2818 | { |
2819 | - $chrcode = $table2of13[ ($val - 1287) ]; |
|
2819 | + $chrcode = $table2of13[($val - 1287)]; |
|
2820 | 2820 | } |
2821 | 2821 | if (($fcs & $bitmask) > 0) |
2822 | 2822 | { |
@@ -2832,8 +2832,8 @@ discard block |
||
2832 | 2832 | $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 3, 'bcode' => []]; |
2833 | 2833 | for ($i = 0; $i < 65; ++$i) |
2834 | 2834 | { |
2835 | - $asc = (($characters[ $asc_chr[ $i ] ] & pow(2, $asc_pos[ $i ])) > 0); |
|
2836 | - $dsc = (($characters[ $dsc_chr[ $i ] ] & pow(2, $dsc_pos[ $i ])) > 0); |
|
2835 | + $asc = (($characters[$asc_chr[$i]] & pow(2, $asc_pos[$i])) > 0); |
|
2836 | + $dsc = (($characters[$dsc_chr[$i]] & pow(2, $dsc_pos[$i])) > 0); |
|
2837 | 2837 | if ($asc AND $dsc) |
2838 | 2838 | { |
2839 | 2839 | // full bar (F) |
@@ -2855,11 +2855,11 @@ discard block |
||
2855 | 2855 | $p = 1; |
2856 | 2856 | $h = 1; |
2857 | 2857 | } |
2858 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
2859 | - $bararray['bcode'][ $k++ ] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2858 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
2859 | + $bararray['bcode'][$k++] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2860 | 2860 | $bararray['maxw'] += 2; |
2861 | 2861 | } |
2862 | - unset($bararray['bcode'][ ($k - 1) ]); |
|
2862 | + unset($bararray['bcode'][($k - 1)]); |
|
2863 | 2863 | --$bararray['maxw']; |
2864 | 2864 | |
2865 | 2865 | return $bararray; |
@@ -2884,7 +2884,7 @@ discard block |
||
2884 | 2884 | $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 3, 'bcode' => []]; |
2885 | 2885 | for ($i = 0; $i < 65; ++$i) |
2886 | 2886 | { |
2887 | - switch ($characters[ $i ]) |
|
2887 | + switch ($characters[$i]) |
|
2888 | 2888 | { |
2889 | 2889 | case 'f': |
2890 | 2890 | { |
@@ -2915,11 +2915,11 @@ discard block |
||
2915 | 2915 | break; |
2916 | 2916 | } |
2917 | 2917 | } |
2918 | - $bararray['bcode'][ $k++ ] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
2919 | - $bararray['bcode'][ $k++ ] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2918 | + $bararray['bcode'][$k++] = ['t' => 1, 'w' => 1, 'h' => $h, 'p' => $p]; |
|
2919 | + $bararray['bcode'][$k++] = ['t' => 0, 'w' => 1, 'h' => 2, 'p' => 0]; |
|
2920 | 2920 | $bararray['maxw'] += 2; |
2921 | 2921 | } |
2922 | - unset($bararray['bcode'][ ($k - 1) ]); |
|
2922 | + unset($bararray['bcode'][($k - 1)]); |
|
2923 | 2923 | --$bararray['maxw']; |
2924 | 2924 | |
2925 | 2925 | return $bararray; |
@@ -3004,7 +3004,7 @@ discard block |
||
3004 | 3004 | // do rest of bytes |
3005 | 3005 | for ($byte = 1; $byte < 13; ++$byte) |
3006 | 3006 | { |
3007 | - $data = hexdec($code_arr[ $byte ]) << 3; |
|
3007 | + $data = hexdec($code_arr[$byte]) << 3; |
|
3008 | 3008 | for ($bit = 0; $bit < 8; ++$bit) |
3009 | 3009 | { |
3010 | 3010 | if (($fcs ^ $data) & 0x400) |
@@ -3073,13 +3073,13 @@ discard block |
||
3073 | 3073 | // Otherwise, place it at the first free slot from the beginning of the list AND place $reverse ath the next free slot from the beginning of the list |
3074 | 3074 | if ($reverse == $count) |
3075 | 3075 | { |
3076 | - $table[ $lui ] = $count; |
|
3076 | + $table[$lui] = $count; |
|
3077 | 3077 | --$lui; |
3078 | 3078 | } else |
3079 | 3079 | { |
3080 | - $table[ $lli ] = $count; |
|
3080 | + $table[$lli] = $count; |
|
3081 | 3081 | ++$lli; |
3082 | - $table[ $lli ] = $reverse; |
|
3082 | + $table[$lli] = $reverse; |
|
3083 | 3083 | ++$lli; |
3084 | 3084 | } |
3085 | 3085 | } |
@@ -1045,7 +1045,7 @@ discard block |
||
1045 | 1045 | /** |
1046 | 1046 | * Convert binary barcode sequence to TCPDF barcode array. |
1047 | 1047 | * |
1048 | - * @param $seq (string) barcode as binary sequence. |
|
1048 | + * @param string $seq (string) barcode as binary sequence. |
|
1049 | 1049 | * @param $bararray (array) barcode array. |
1050 | 1050 | * òparam array $bararray TCPDF barcode array to fill up |
1051 | 1051 | * @return array barcode representation. |
@@ -2931,7 +2931,7 @@ discard block |
||
2931 | 2931 | * Convert large integer number to hexadecimal representation. |
2932 | 2932 | * (requires PHP bcmath extension) |
2933 | 2933 | * |
2934 | - * @param $number (string) number to convert specified as a string |
|
2934 | + * @param string $number (string) number to convert specified as a string |
|
2935 | 2935 | * @return string hexadecimal representation |
2936 | 2936 | */ |
2937 | 2937 | public function dec_to_hex($number) |
@@ -2961,7 +2961,7 @@ discard block |
||
2961 | 2961 | * Convert large hexadecimal number to decimal representation (string). |
2962 | 2962 | * (requires PHP bcmath extension) |
2963 | 2963 | * |
2964 | - * @param $hex (string) hexadecimal number to convert specified as a string |
|
2964 | + * @param string $hex (string) hexadecimal number to convert specified as a string |
|
2965 | 2965 | * @return string hexadecimal representation |
2966 | 2966 | */ |
2967 | 2967 | public function hex_to_dec($hex) |
@@ -3027,7 +3027,7 @@ discard block |
||
3027 | 3027 | /** |
3028 | 3028 | * Reverse unsigned short value |
3029 | 3029 | * |
3030 | - * @param $num (int) value to reversr |
|
3030 | + * @param integer $num (int) value to reversr |
|
3031 | 3031 | * @return int reversed value |
3032 | 3032 | * @protected |
3033 | 3033 | */ |
@@ -3047,8 +3047,8 @@ discard block |
||
3047 | 3047 | /** |
3048 | 3048 | * generate Nof13 tables used for Intelligent Mail Barcode |
3049 | 3049 | * |
3050 | - * @param $n (int) is the type of table: 2 for 2of13 table, 5 for 5of13table |
|
3051 | - * @param $size (int) size of table (78 for n=2 and 1287 for n=5) |
|
3050 | + * @param integer $n (int) is the type of table: 2 for 2of13 table, 5 for 5of13table |
|
3051 | + * @param integer $size (int) size of table (78 for n=2 and 1287 for n=5) |
|
3052 | 3052 | * @return array requested table |
3053 | 3053 | * @protected |
3054 | 3054 | */ |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | abstract class Boleto implements BoletoInterface |
13 | 13 | { |
14 | - private $atributos_parser = [ |
|
14 | + private $atributos_parser = [ |
|
15 | 15 | ':taxa', |
16 | 16 | ':multa', |
17 | 17 | ':vencimento' |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | 'carteira' => 'SR ou RG', |
71 | 71 | 'especie_moeda' => 'R$', |
72 | 72 | 'valor_documento' => '< R$ 9.999.999,99', |
73 | - 'uso_do_banco' => NULL,//'n�o preencher', |
|
74 | - 'qtde_moeda' => NULL,//'n�o preencher', |
|
75 | - 'xValor' => NULL,//'n�o preencher', |
|
73 | + 'uso_do_banco' => NULL, //'n�o preencher', |
|
74 | + 'qtde_moeda' => NULL, //'n�o preencher', |
|
75 | + 'xValor' => NULL, //'n�o preencher', |
|
76 | 76 | |
77 | 77 | /* --------[F]------- */ |
78 | 78 | // 'instrucoes' => 'Preenchido com array', |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'cidade_estado_cep' => $this->pagador->getCidadeEstadoCep(), |
157 | 157 | 'cpf_cnpj' => $this->pagador->getCpfCnpj(), |
158 | 158 | ]; |
159 | - $this->processed['sacador'] = |
|
159 | + $this->processed['sacador'] = |
|
160 | 160 | [ |
161 | 161 | 'nome' => $this->info->getNomeSacado(), |
162 | 162 | 'cpf_cnpj' => $this->info->getCpfCnpjSacado() |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace CbCaio\Boletos\Models\Boletos\Base; |
3 | 3 | |
4 | -use CbCaio\Boletos\Generators\Barcode; |
|
5 | -use CbCaio\Boletos\Models\Bancos\Contracts\BancoInterface; |
|
6 | -use CbCaio\Boletos\Models\Beneficiario\Contracts\BeneficiarioInterface; |
|
7 | -use CbCaio\Boletos\Models\BoletoInfo\Contracts\BoletoInfoInterface; |
|
8 | -use CbCaio\Boletos\Models\Boletos\Contracts\BoletoInterface; |
|
9 | -use CbCaio\Boletos\Models\Pagador\Contracts\PagadorInterface; |
|
4 | +use CbCaio\Boletos\Generators\Barcode; |
|
5 | +use CbCaio\Boletos\Models\Bancos\Contracts\BancoInterface; |
|
6 | +use CbCaio\Boletos\Models\Beneficiario\Contracts\BeneficiarioInterface; |
|
7 | +use CbCaio\Boletos\Models\BoletoInfo\Contracts\BoletoInfoInterface; |
|
8 | +use CbCaio\Boletos\Models\Boletos\Contracts\BoletoInterface; |
|
9 | +use CbCaio\Boletos\Models\Pagador\Contracts\PagadorInterface; |
|
10 | 10 | |
11 | 11 | abstract class Boleto implements BoletoInterface |
12 | 12 | { |
@@ -188,7 +188,7 @@ |
||
188 | 188 | break; |
189 | 189 | case ":vencimento": |
190 | 190 | $string = preg_replace("/$attribute" . '\b/', |
191 | - $this->info->getDataVencimentoCalculada(), $string); |
|
191 | + $this->info->getDataVencimentoCalculada(), $string); |
|
192 | 192 | break; |
193 | 193 | } |
194 | 194 | } |
@@ -51,19 +51,19 @@ |
||
51 | 51 | private function registerBindings() |
52 | 52 | { |
53 | 53 | $this->app->bind('CbCaio\Boletos\Models\Banco\Contracts\BancoInterface', |
54 | - 'CbCaio\Boletos\Models\Banco\Base\Banco'); |
|
54 | + 'CbCaio\Boletos\Models\Banco\Base\Banco'); |
|
55 | 55 | |
56 | 56 | $this->app->bind('CbCaio\Boletos\Models\Beneficiario\Contracts\BeneficiarioInterface', |
57 | - 'CbCaio\Boletos\Models\Beneficiario\Base\Beneficiario'); |
|
57 | + 'CbCaio\Boletos\Models\Beneficiario\Base\Beneficiario'); |
|
58 | 58 | |
59 | 59 | $this->app->bind('CbCaio\Boletos\Models\Boleto\Contracts\BoletoInterface', |
60 | - 'CbCaio\Boletos\Models\Boleto\Base\Boleto'); |
|
60 | + 'CbCaio\Boletos\Models\Boleto\Base\Boleto'); |
|
61 | 61 | |
62 | 62 | $this->app->bind('CbCaio\Boletos\Models\BoletoInfo\Contracts\BoletoInfoInterface', |
63 | - 'CbCaio\Boletos\Models\BoletoInfo\BoletoInfo'); |
|
63 | + 'CbCaio\Boletos\Models\BoletoInfo\BoletoInfo'); |
|
64 | 64 | |
65 | 65 | $this->app->bind('CbCaio\Boletos\Models\Pagador\Contracts\PagadorInterface', |
66 | - 'CbCaio\Boletos\Models\Pagador\Pagador'); |
|
66 | + 'CbCaio\Boletos\Models\Pagador\Pagador'); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | } |
70 | 70 | \ No newline at end of file |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * seguinte forma: |
9 | 9 | * SE RESULTADO = 0 OU RESULTADO > 9 ENTAO DV = 1 |
10 | 10 | * |
11 | - * @param $numero |
|
11 | + * @param string $numero |
|
12 | 12 | * @return int |
13 | 13 | */ |
14 | 14 | static function calculaModulo11SemDV0($numero) |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $multiplicador = $peso_superior; |
155 | 155 | for ($i = $tamanho_numero_array - 1; $i >= 0; $i--) |
156 | 156 | { |
157 | - $res_multiplicacao = $numero_array[ $i ] * $multiplicador; |
|
157 | + $res_multiplicacao = $numero_array[$i] * $multiplicador; |
|
158 | 158 | |
159 | 159 | if ($res_multiplicacao >= 10) |
160 | 160 | { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $digito_unidade = $resultado_array[1]; |
164 | 164 | $res_multiplicacao = (int)$digito_dezena + (int)$digito_unidade; |
165 | 165 | } |
166 | - $resultado_multiplicacao_array[ $i ] = $res_multiplicacao; |
|
166 | + $resultado_multiplicacao_array[$i] = $res_multiplicacao; |
|
167 | 167 | |
168 | 168 | if ($multiplicador <= $peso_inferior) |
169 | 169 | { |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | $multiplicador = $peso_inferior; |
196 | 196 | for ($i = $tamanho_numero_array - 1; $i >= 0; $i--) |
197 | 197 | { |
198 | - $res_multiplicacao = $numero_array[ $i ] * $multiplicador; |
|
199 | - $resultado_multiplicacao_array[ $i ] = $res_multiplicacao; |
|
198 | + $res_multiplicacao = $numero_array[$i] * $multiplicador; |
|
199 | + $resultado_multiplicacao_array[$i] = $res_multiplicacao; |
|
200 | 200 | if ($multiplicador >= $peso_superior) |
201 | 201 | { |
202 | 202 | $multiplicador = $peso_inferior; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if (isset($this->attributes['data_vencimento'])) |
91 | 91 | { |
92 | 92 | return Carbon::createFromFormat($this->date_format, $this->attributes['data_vencimento']) |
93 | - ->setTime(0, 0, 0); |
|
93 | + ->setTime(0, 0, 0); |
|
94 | 94 | } else |
95 | 95 | { |
96 | 96 | return NULL; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if (isset($this->attributes['data_documento'])) |
106 | 106 | { |
107 | 107 | return Carbon::createFromFormat($this->date_format, $this->attributes['data_documento']) |
108 | - ->setTime(0, 0, 0); |
|
108 | + ->setTime(0, 0, 0); |
|
109 | 109 | } else |
110 | 110 | { |
111 | 111 | return NULL; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if (isset($this->attributes['data_processamento'])) |
122 | 122 | { |
123 | 123 | return Carbon::createFromFormat($this->date_format, $this->attributes['data_processamento']) |
124 | - ->setTime(0, 0, 0); |
|
124 | + ->setTime(0, 0, 0); |
|
125 | 125 | } else |
126 | 126 | { |
127 | 127 | return NULL; |
@@ -232,8 +232,8 @@ |
||
232 | 232 | $multiplicador = $peso_inferior; |
233 | 233 | for ($i = $tamanho_numero_array - 1; $i >= 0; $i--) |
234 | 234 | { |
235 | - $res_multiplicacao = $numero_array[ $i ] * $multiplicador; |
|
236 | - $resultado_multiplicacao_array[ $i ] = $res_multiplicacao; |
|
235 | + $res_multiplicacao = $numero_array[$i] * $multiplicador; |
|
236 | + $resultado_multiplicacao_array[$i] = $res_multiplicacao; |
|
237 | 237 | if ($multiplicador >= $peso_superior) |
238 | 238 | { |
239 | 239 | $multiplicador = $peso_inferior; |