mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-24 19:47:55 +00:00
:octocat: replace __set() with setters for SettingsContainerInterface
This commit is contained in:
+18
-24
@@ -239,30 +239,6 @@ trait QROptionsTrait{
|
||||
*/
|
||||
protected $moduleValues;
|
||||
|
||||
/**
|
||||
* set/clamp some special values, call the parent setter otherwise
|
||||
*
|
||||
* @param string $property
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __set(string $property, $value):void{
|
||||
|
||||
if($property === 'versionMin'){
|
||||
$this->setMinMaxVersion($value, $this->versionMax);
|
||||
|
||||
return;
|
||||
}
|
||||
elseif($property === 'versionMax'){
|
||||
$this->setMinMaxVersion($this->versionMin, $value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
parent::__set($property, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* clamp min/max version number
|
||||
*
|
||||
@@ -279,6 +255,24 @@ trait QROptionsTrait{
|
||||
$this->versionMax = \max($min, $max);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $version
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function set_versionMin(int $version):void{
|
||||
$this->setMinMaxVersion($version, $this->versionMax);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $version
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function set_versionMax(int $version):void{
|
||||
$this->setMinMaxVersion($this->versionMin, $version);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $eccLevel
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user