PHP Classes

File: src/Customs/ShapePaths.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/Customs/ShapePaths.php   Download  
File: src/Customs/ShapePaths.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/Customs/ShapePaths.php
Date: 6 months ago
Size: 823 bytes
 

Contents

Class file image Download
<?php

namespace HeroQR\Customs;

use
HeroQR\Contracts\Customs\AbstractCustomPaths;

/**
 * A class that manages paths for marker images, providing methods to retrieve paths,
 * validate keys, and get the specific path for a marker based on its key
 *
 * @package HeroQR\Customs
 */
class ShapePaths extends AbstractCustomPaths
{
    public const
S1 = 'drawSquare';
    public const
S2 = 'drawCircle';
    public const
S3 = 'drawStar';
    public const
S4 = 'drawDiamond';

   
/**
     * Retrieves all marker paths as an associative array
     */
   
public static function getAllPaths(): array
    {
       
$reflection = new \ReflectionClass(static::class);
       
$constants = $reflection->getConstants();

        return
array_filter($constants, fn($key) => str_starts_with($key, 'S'), ARRAY_FILTER_USE_KEY);
    }
}