From adb1230e10732b2d07eed404e5eab75ec20dd7bf Mon Sep 17 00:00:00 2001 From: codemasher Date: Fri, 9 Aug 2019 18:31:02 +0200 Subject: [PATCH] :octocat: replace __set() with setters for SettingsContainerInterface --- src/QROptionsTrait.php | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/QROptionsTrait.php b/src/QROptionsTrait.php index a1d7fcfe0..a18354968 100644 --- a/src/QROptionsTrait.php +++ b/src/QROptionsTrait.php @@ -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 *