|
|
@@ -92,11 +92,6 @@ class QRCode{
|
|
|
public function __construct($data, QROutputInterface $output, QROptions $options = null){
|
|
|
$this->qrOutputInterface = $output;
|
|
|
$this->bitBuffer = new BitBuffer;
|
|
|
-
|
|
|
- if(!$options instanceof QROptions){
|
|
|
- $options = new QROptions;
|
|
|
- }
|
|
|
-
|
|
|
$this->setData($data, $options);
|
|
|
}
|
|
|
|
|
|
@@ -107,9 +102,13 @@ class QRCode{
|
|
|
* @return $this
|
|
|
* @throws \chillerlan\QRCode\QRCodeException
|
|
|
*/
|
|
|
- public function setData($data, QROptions $options){
|
|
|
+ public function setData($data, QROptions $options = null){
|
|
|
$data = trim($data);
|
|
|
|
|
|
+ if(!$options instanceof QROptions){
|
|
|
+ $options = new QROptions;
|
|
|
+ }
|
|
|
+
|
|
|
if(empty($data)){
|
|
|
throw new QRCodeException('No data given.');
|
|
|
}
|