| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class QROutputAbstract |
| 5 |
* |
| 6 |
* @filesource QROutputAbstract.php |
| 7 |
* @created 09.12.2015 |
| 8 |
* @package chillerlan\QRCode\Output |
| 9 |
* @author Smiley <smiley@chillerlan.net> |
| 10 |
* @copyright 2015 Smiley |
| 11 |
* @license MIT |
| 12 |
*/ |
| 13 |
namespace YoastSEO_Vendor\chillerlan\QRCode\Output; |
| 14 |
|
| 15 |
use YoastSEO_Vendor\chillerlan\QRCode\Data\QRMatrix; |
| 16 |
use YoastSEO_Vendor\chillerlan\QRCode\QROptions; |
| 17 |
/** |
| 18 |
* |
| 19 |
*/ |
| 20 |
abstract class QROutputAbstract implements \YoastSEO_Vendor\chillerlan\QRCode\Output\QROutputInterface |
| 21 |
{ |
| 22 |
/** |
| 23 |
* @var int |
| 24 |
*/ |
| 25 |
protected $moduleCount; |
| 26 |
/** |
| 27 |
* @param \chillerlan\QRCode\Data\QRMatrix $matrix |
| 28 |
*/ |
| 29 |
protected $matrix; |
| 30 |
/** |
| 31 |
* @var \chillerlan\QRCode\QROptions |
| 32 |
*/ |
| 33 |
protected $options; |
| 34 |
/** |
| 35 |
* QROutputAbstract constructor. |
| 36 |
* |
| 37 |
* @param \chillerlan\QRCode\QROptions $options |
| 38 |
* @param \chillerlan\QRCode\Data\QRMatrix $matrix |
| 39 |
*/ |
| 40 |
public function __construct(\YoastSEO_Vendor\chillerlan\QRCode\QROptions $options, \YoastSEO_Vendor\chillerlan\QRCode\Data\QRMatrix $matrix) |
| 41 |
{ |
| 42 |
$this->options = $options; |
| 43 |
$this->matrix = $matrix; |
| 44 |
$this->moduleCount = $this->matrix->size(); |
| 45 |
} |
| 46 |
/** |
| 47 |
* @see file_put_contents() |
| 48 |
* |
| 49 |
* @param string $data |
| 50 |
* @return bool|int |
| 51 |
*/ |
| 52 |
protected function saveToFile($data) |
| 53 |
{ |
| 54 |
return \file_put_contents($this->options->cachefile, $data); |
| 55 |
} |
| 56 |
} |
| 57 |
|