Przeglądaj źródła

:octocat: replace __set() with setters for SettingsContainerInterface

codemasher 6 lat temu
rodzic
commit
adb1230e10
1 zmienionych plików z 18 dodań i 24 usunięć
  1. 18 24
      src/QROptionsTrait.php

+ 18 - 24
src/QROptionsTrait.php

@@ -239,30 +239,6 @@ trait QROptionsTrait{
 	 */
 	 */
 	protected $moduleValues;
 	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
 	 * clamp min/max version number
 	 *
 	 *
@@ -279,6 +255,24 @@ trait QROptionsTrait{
 		$this->versionMax = \max($min, $max);
 		$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
 	 * @param int $eccLevel
 	 *
 	 *