Skip to content

Commit cf92e49

Browse files
committed
:octocat: this was possible all the time???
1 parent 12d0edf commit cf92e49

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

examples/svgWithLogoAndCustomShapes.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ protected function getFinderPatterns():string{
9393
'q0,1 1,1 h3 q1,0 1,-1 v-3 q0,-1 -1,-1z m0,2.5 a1.5,1.5 0 1 0 3,0 a1.5,1.5 0 1 0 -3,0Z';
9494
$finder = [];
9595

96-
foreach($pos as $coord){
97-
[$ix, $iy] = $coord;
98-
$finder[] = sprintf($path, $ix, $iy);
96+
foreach($pos as [$ix, $iy]){
97+
$finder[] = sprintf($path, $ix, $iy);
9998
}
10099

101100
return implode(' ', $finder);

src/Common/ReedSolomonDecoder.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ public function decode(array $rawCodewords):BitBuffer{
5252
$dataBlocks = $this->deinterleaveRawBytes($rawCodewords);
5353
$dataBytes = [];
5454

55-
foreach($dataBlocks as $dataBlock){
56-
[$numDataCodewords, $codewordBytes] = $dataBlock;
57-
55+
foreach($dataBlocks as [$numDataCodewords, $codewordBytes]){
5856
$corrected = $this->correctErrors($codewordBytes, $numDataCodewords);
5957

6058
for($i = 0; $i < $numDataCodewords; $i++){
@@ -81,9 +79,7 @@ private function deinterleaveRawBytes(array $rawCodewords):array{
8179
$result = [];//new DataBlock[$totalBlocks];
8280
$numResultBlocks = 0;
8381

84-
foreach($eccBlocks as $blockData){
85-
[$numEccBlocks, $eccPerBlock] = $blockData;
86-
82+
foreach($eccBlocks as [$numEccBlocks, $eccPerBlock]){
8783
for($i = 0; $i < $numEccBlocks; $i++, $numResultBlocks++){
8884
$result[$numResultBlocks] = [$eccPerBlock, array_fill(0, ($numEccCodewords + $eccPerBlock), 0)];
8985
}

src/Common/ReedSolomonEncoder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ public function interleaveEcBytes(BitBuffer $bitBuffer):array{
5454
$maxEcBytes = 0;
5555
$dataByteOffset = 0;
5656

57-
foreach($rsBlocks as $key => $block){
58-
[$rsBlockTotal, $dataByteCount] = $block;
59-
57+
foreach($rsBlocks as $key => [$rsBlockTotal, $dataByteCount]){
6058
$dataBytes[$key] = [];
6159

6260
for($i = 0; $i < $dataByteCount; $i++){

src/Data/QRMatrix.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,7 @@ public function check(int $x, int $y):bool{
339339
public function checkNeighbours(int $x, int $y, int $M_TYPE = null):int{
340340
$bits = 0;
341341

342-
foreach($this::neighbours as $bit => $coord){
343-
[$ix, $iy] = $coord;
344-
342+
foreach($this::neighbours as $bit => [$ix, $iy]){
345343
$ix += $x;
346344
$iy += $y;
347345

0 commit comments

Comments
 (0)