src/SimpleSoftwareIO/QrCode/BaconQrCodeGenerator.php
public function generate($text, $filename = null)
    {
        $qrCode = $this->writer->writeString($text, $this->encoding, $this->errorCorrection);

        if ($this->imageMerge !== null) {
            $merger = new ImageMerge(new Image($qrCode), new Image($this->imageMerge));
            $qrCode = $merger->merge($this->imagePercentage);
        }

        if ($filename === null) {
            return $qrCode;
        }

        return file_put_contents($filename, $qrCode);
    }
public function generate($text, $filename = null)
    {
        $qrCode = $this->writer->writeString($text, $this->encoding, $this->errorCorrection);

        if ($this->imageMerge !== null) {
            $merger = new ImageMerge(new Image($qrCode), new Image($this->imageMerge));
            $qrCode = $merger->merge($this->imagePercentage);
        }

        if ($filename === null) {
            return $qrCode;
        }

        return file_put_contents($filename, $qrCode);
    }
public function generate ( $ text , $ filename = null ) { $ qrCode = $ this -> writer -> writeString ( $ text , $ this -> encoding , $ this -> errorCorrection ) ; if ( $ this -> imageMerge !== null ) { $ merger = new ImageMerge ( new Image ( $ qrCode ) , new Image ( $ this -> imageMerge ) ) ; $ qrCode = $ merger -> merge ( $ this -> imagePercentage ) ; } if ( $ filename === null ) { return $ qrCode ; } return file_put_contents ( $ filename , $ qrCode ) ; }
Generates a QrCode.

@param string      $text     The text to be converted into a QrCode
@param null|string $filename The filename and path to save the QrCode file

@return string|void Returns a QrCode string depending on the format, or saves to a file.
Generates a QrCode .