mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-15 16:26:23 +00:00
added QRMarkup & cleaned up the output
This commit is contained in:
@@ -17,6 +17,16 @@ namespace chillerlan\QRCode\Output;
|
||||
*/
|
||||
abstract class QROutputAbstract implements QROutputInterface{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $optionsInterface;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $types;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@@ -32,6 +42,23 @@ abstract class QROutputAbstract implements QROutputInterface{
|
||||
*/
|
||||
protected $options;
|
||||
|
||||
/**
|
||||
* @var \chillerlan\QRCode\Output\QROutputOptionsAbstract $outputOptions
|
||||
* @throws \chillerlan\QRCode\Output\QRCodeOutputException
|
||||
*/
|
||||
public function __construct(QROutputOptionsAbstract $outputOptions = null){
|
||||
$this->options = $outputOptions;
|
||||
|
||||
if($this->optionsInterface && !$this->options instanceof $this->optionsInterface){
|
||||
$this->options = new $this->optionsInterface;
|
||||
}
|
||||
|
||||
if(is_array($this->types) && !in_array($this->options->type, $this->types , true)){
|
||||
throw new QRCodeOutputException('Invalid output type!');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $matrix
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user