:octocat: this was possible all the time???

This commit is contained in:
smiley
2023-06-21 14:11:28 +02:00
parent 12d0edfd53
commit cf92e49958
4 changed files with 6 additions and 15 deletions
+2 -3
View File
@@ -93,9 +93,8 @@ class QRSvgWithLogoAndCustomShapes extends QRMarkupSVG{
'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';
$finder = [];
foreach($pos as $coord){
[$ix, $iy] = $coord;
$finder[] = sprintf($path, $ix, $iy);
foreach($pos as [$ix, $iy]){
$finder[] = sprintf($path, $ix, $iy);
}
return implode(' ', $finder);
+2 -6
View File
@@ -52,9 +52,7 @@ final class ReedSolomonDecoder{
$dataBlocks = $this->deinterleaveRawBytes($rawCodewords);
$dataBytes = [];
foreach($dataBlocks as $dataBlock){
[$numDataCodewords, $codewordBytes] = $dataBlock;
foreach($dataBlocks as [$numDataCodewords, $codewordBytes]){
$corrected = $this->correctErrors($codewordBytes, $numDataCodewords);
for($i = 0; $i < $numDataCodewords; $i++){
@@ -81,9 +79,7 @@ final class ReedSolomonDecoder{
$result = [];//new DataBlock[$totalBlocks];
$numResultBlocks = 0;
foreach($eccBlocks as $blockData){
[$numEccBlocks, $eccPerBlock] = $blockData;
foreach($eccBlocks as [$numEccBlocks, $eccPerBlock]){
for($i = 0; $i < $numEccBlocks; $i++, $numResultBlocks++){
$result[$numResultBlocks] = [$eccPerBlock, array_fill(0, ($numEccCodewords + $eccPerBlock), 0)];
}
+1 -3
View File
@@ -54,9 +54,7 @@ final class ReedSolomonEncoder{
$maxEcBytes = 0;
$dataByteOffset = 0;
foreach($rsBlocks as $key => $block){
[$rsBlockTotal, $dataByteCount] = $block;
foreach($rsBlocks as $key => [$rsBlockTotal, $dataByteCount]){
$dataBytes[$key] = [];
for($i = 0; $i < $dataByteCount; $i++){
+1 -3
View File
@@ -339,9 +339,7 @@ class QRMatrix{
public function checkNeighbours(int $x, int $y, int $M_TYPE = null):int{
$bits = 0;
foreach($this::neighbours as $bit => $coord){
[$ix, $iy] = $coord;
foreach($this::neighbours as $bit => [$ix, $iy]){
$ix += $x;
$iy += $y;