PHP Classes

File: src/Contracts/Managers/OutputManagerInterface.php

Recommend this page to a friend!
  Packages of Amirreza Ebrahimi   HeroQR Powerful PHP QR Code Library to generate PNG, SVG, PDF, Logos Ready to Use with Laravel   src/Contracts/Managers/OutputManagerInterface.php   Download  
File: src/Contracts/Managers/OutputManagerInterface.php
Role: Class source
Content type: text/plain
Description: Class source
Class: HeroQR Powerful PHP QR Code Library to generate PNG, SVG, PDF, Logos Ready to Use with Laravel
Generate QR code images in several formats
Author: By
Last change: Update of src/Contracts/Managers/OutputManagerInterface.php
Date: 6 months ago
Size: 1,553 bytes
 

Contents

Class file image Download
<?php

namespace HeroQR\Contracts\Managers;

use
Endroid\QrCode\{Matrix\Matrix,Writer\Result\ResultInterface};

/**
 * Interface OutputManagerInterface
 *
 * This interface defines methods for managing QR Code output operations, including
 * saving the QR code to a file, retrieving its data URI, and getting the matrix
 * representation of the QR code.
 *
 * @package HeroQR\Contracts\Managers
 */
interface OutputManagerInterface
{
   
/**
     * Save the QR Code output to a file
     *
     * @param ResultInterface $builder
     * @param string $path
     * @return bool
     * @throws \InvalidArgumentException if the format is unsupported or saving fails
     */
   
public function saveTo(ResultInterface $builder, string $path): bool;

   
/**
     * Return the data URI for the QR Code
     *
     * @param ResultInterface $builder
     * @return string
     */
   
public function getDataUri(ResultInterface $builder): string;

   
/**
     * Convert the QR Code matrix to a two-dimensional array
     *
     * @param ResultInterface $builder
     * @return array
     */
   
public function getMatrixAsArray(ResultInterface $builder): array;

   
/**
     * Return the QR Code matrix as a Matrix object
     *
     * @param ResultInterface $builder
     * @return Matrix
     */
   
public function getMatrix(ResultInterface $builder): Matrix;

   
/**
     * Return the QR Code output as a string
     *
     * @param ResultInterface $builder
     * @return string
     */
   
public function getString(ResultInterface $builder): string;
}