mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-09-05 06:57:39 +00:00
:octocat: fall back to defaults if nothing is given
This commit is contained in:
@@ -42,7 +42,7 @@ class QRMarkup extends QROutputAbstract{
|
||||
$html .= '<div>';
|
||||
|
||||
foreach($row as $pixel){
|
||||
$html .= '<span style="background: '.($this->options->moduleValues[$pixel] ?? 'lightgrey').';"></span>';
|
||||
$html .= '<span style="background: '.($this->options->moduleValues[$pixel] ?: 'lightgrey').';"></span>';
|
||||
}
|
||||
|
||||
$html .= '</div>';
|
||||
@@ -73,6 +73,11 @@ class QRMarkup extends QROutputAbstract{
|
||||
// @todo: optimize -> see https://github.com/alexeyten/qr-image/blob/master/lib/vector.js
|
||||
foreach($this->options->moduleValues as $key => $value){
|
||||
|
||||
// fallback
|
||||
if(is_bool($value)){
|
||||
$value = $value ? '#000' : '#fff';
|
||||
}
|
||||
|
||||
// svg body
|
||||
foreach($this->matrix->matrix() as $y => $row){
|
||||
//we'll combine active blocks within a single row as a lightweight compression technique
|
||||
|
||||
Reference in New Issue
Block a user