🛀 QRDataModeInterface: validate data on init, test cleanup

This commit is contained in:
codemasher
2021-11-28 18:25:06 +01:00
parent 3d563bfcc0
commit 48b6c21090
12 changed files with 71 additions and 203 deletions
+7
View File
@@ -26,8 +26,15 @@ abstract class QRDataModeAbstract implements QRDataModeInterface{
/**
* QRDataModeAbstract constructor.
*
* @throws \chillerlan\QRCode\Data\QRCodeDataException
*/
public function __construct(string $data){
if(!$this::validateString($data)){
throw new QRCodeDataException('invalid data');
}
$this->data = $data;
}