mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-22 14:34:14 +00:00
:octocat: QROutputAbstract::setModuleValues() allow setting extra values from options
This commit is contained in:
@@ -94,12 +94,16 @@ abstract class QROutputAbstract implements QROutputInterface{
|
||||
*/
|
||||
protected function setModuleValues():void{
|
||||
|
||||
// first fill the map with the default values
|
||||
foreach($this::DEFAULT_MODULE_VALUES as $M_TYPE => $defaultValue){
|
||||
$value = ($this->options->moduleValues[$M_TYPE] ?? null);
|
||||
$this->moduleValues[$M_TYPE] = $this->getDefaultModuleValue($defaultValue);
|
||||
}
|
||||
|
||||
$this->moduleValues[$M_TYPE] = $this::moduleValueIsValid($value)
|
||||
? $this->prepareModuleValue($value)
|
||||
: $this->getDefaultModuleValue($defaultValue);
|
||||
// now loop over the options values to replace defaults and add extra values
|
||||
foreach($this->options->moduleValues as $M_TYPE => $value){
|
||||
if($this::moduleValueIsValid($value)){
|
||||
$this->moduleValues[$M_TYPE] = $this->prepareModuleValue($value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user