<?php

namespace Blazemedia\Affiliation\Rendering\Utils;

class RandomClassGenerator {
    private static $instance;

    private string $class;

    private function __construct() {
        $this->class = $this->generate();
    }

    private function __clone(){}
    public function __wakeup(){}

    public static function getInstance() {
        if (!self::$instance) {
            self::$instance = new self();
        }

        return self::$instance;
    }



    protected function generate() : string {

        return implode( '', array_map( function( ) { return chr( rand(65,85) ); }, range(0,10) ));
    }

    public function getRandomClass(){
        return $this->class;
    }

}