mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-21 17:33:22 +00:00
🛀 QRDataModeInterface: validate data on init, test cleanup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user