added QRMarkup & cleaned up the output

This commit is contained in:
smiley
2016-12-17 22:22:20 +01:00
parent 8209f30fb4
commit 03d5d92fbe
9 changed files with 258 additions and 150 deletions
+27
View File
@@ -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
*