Browse Source

:sparkles: ??=

codemasher 6 years ago
parent
commit
e203a103fb
3 changed files with 3 additions and 3 deletions
  1. 1 1
      src/Output/QRImage.php
  2. 1 1
      src/Output/QRImagick.php
  3. 1 1
      src/Output/QROutputAbstract.php

+ 1 - 1
src/Output/QRImage.php

@@ -115,7 +115,7 @@ class QRImage extends QROutputAbstract{
 	 * @throws \chillerlan\QRCode\Output\QRCodeOutputException
 	 */
 	protected function dumpImage(string $file = null):string{
-		$file = $file ?? $this->options->cachefile;
+		$file ??= $this->options->cachefile;
 
 		\ob_start();
 

+ 1 - 1
src/Output/QRImagick.php

@@ -47,7 +47,7 @@ class QRImagick extends QROutputAbstract{
 	 * @return string
 	 */
 	public function dump(string $file = null):string{
-		$file    = $file ?? $this->options->cachefile;
+		$file ??= $this->options->cachefile;
 		$imagick = new Imagick;
 
 		$imagick->newImage(

+ 1 - 1
src/Output/QROutputAbstract.php

@@ -90,7 +90,7 @@ abstract class QROutputAbstract implements QROutputInterface{
 	 */
 	public function dump(string $file = null){
 		$data = \call_user_func([$this, $this->outputMode ?? $this->defaultMode]);
-		$file = $file ?? $this->options->cachefile;
+		$file ??= $this->options->cachefile;
 
 		if($file !== null){
 			$this->saveToFile($data, $file);