:octocat: replace __set() with setters for SettingsContainerInterface

This commit is contained in:
codemasher
2019-08-09 18:31:02 +02:00
parent 9b0018524b
commit adb1230e10
+18 -24
View File
@@ -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
*