Skip to content

Commit

Permalink
Fix phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
casperbakker committed Sep 18, 2024
1 parent e6059cc commit e9d3968
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Types/TypeCode128.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function getBarcodeData(string $code): Barcode
// get numeric sequences (if any)
$numseq = [];
preg_match_all('/([0-9]{4,})/', $code, $numseq, PREG_OFFSET_CAPTURE);
if (isset($numseq[1]) AND ! empty($numseq[1])) {
if (! empty($numseq[1])) {
$end_offset = 0;
foreach ($numseq[1] as $val) {
$offset = $val[1];
Expand Down Expand Up @@ -390,7 +390,7 @@ protected function get128ABsequence($code)
// get A sequences (if any)
$numseq = [];
preg_match_all('/([\x00-\x1f])/', $code, $numseq, PREG_OFFSET_CAPTURE);
if (isset($numseq[1]) AND ! empty($numseq[1])) {
if (empty($numseq[1])) {
$end_offset = 0;
foreach ($numseq[1] as $val) {
$offset = $val[1];
Expand Down
2 changes: 1 addition & 1 deletion src/Types/TypeUpcExtension2.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getBarcodeData(string $code): Barcode

// Calculate check digit
if ($len == 2) {
$r = $code % 4;
$r = (int)$code % 4;
} elseif ($len == 5) {
$r = (3 * intval($code[0] . $code[2] . $code[4])) + (9 * intval($code[1] . $code[3]));
$r %= 10;
Expand Down

0 comments on commit e9d3968

Please sign in to comment.