PHP Classes

File: src/Contracts/Managers/AbstractWriterManager.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/AbstractWriterManager.php   Download  
File: src/Contracts/Managers/AbstractWriterManager.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/AbstractWriterManager.php
Date: 6 months ago
Size: 1,557 bytes
 

Contents

Class file image Download
<?php

namespace HeroQR\Contracts\Managers;

use
Endroid\QrCode\Writer\WriterInterface;

/**
 * Abstract Class AbstractWriterManager
 *
 * Provides a foundational structure for managing QR code writers within the HeroQR library.
 * This class enforces consistent implementation of writer management logic for different formats
 * and offers utility methods for validation and customization handling.
 *
 * @package HeroQR\Contracts\Managers
 */
abstract class AbstractWriterManager
{
   
/**
     * Returns a custom writer based on format and custom settings.
     *
     * @param string $format The desired output format.
     * @param array $customs Custom settings for the writer.
     * @return WriterInterface A custom writer for the specified format and settings.
     */
   
abstract protected function getCustomWriter(string $format, array $customs): WriterInterface;

   
/**
     * Returns a standard writer based on the format.
     *
     * @param string $format The desired output format.
     * @return WriterInterface A standard writer for the specified format.
     */
   
abstract protected function getStandardWriter(string $format): WriterInterface;

   
/**
     * Returns a writer based on format and custom settings.
     *
     * @param string $format The desired output format.
     * @param array $customs (Optional) Custom settings for the writer.
     * @return WriterInterface A writer for the specified format and settings.
     */
   
abstract public function getWriter(string $format, array $customs = []): WriterInterface;
}