PHP Classes

File: src/Customs/MarkerPaths.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/MarkerPaths.php   Download  
File: src/Customs/MarkerPaths.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/MarkerPaths.php
Date: 6 months ago
Size: 1,101 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 MarkerPaths extends AbstractCustomPaths
{
    public const
M1 = __DIR__ . '/../../assets/Markers/Marker-1.png';
    public const
M2 = __DIR__ . '/../../assets/Markers/Marker-2.png';
    public const
M3 = __DIR__ . '/../../assets/Markers/Marker-3.png';
    public const
M4 = __DIR__ . '/../../assets/Markers/Marker-4.png';
    public const
M5 = __DIR__ . '/../../assets/Markers/Marker-5.png';
    public const
M6 = __DIR__ . '/../../assets/Markers/Marker-6.png';

   
/**
     * 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, 'M'), ARRAY_FILTER_USE_KEY);
    }
}