view src/Replacer.php @ 16:e577dac6c913 development

Simple test
author Luka Sitas <sitas.luka.97@gmail.com>
date Mon, 23 Sep 2024 20:32:05 -0400
parents 6468684362c2
children
line wrap: on
line source

<?php

namespace Wizzard\MagicForger;

use Illuminate\Support\Str;

class Replacer
{
    /**
     * Cached replacements for re-use.
     *
     * @var array
     */
    protected $replacement_cache = [];




    /**
     * The lowest level to show log outputs.
     *
     * @var int
     */
    private $log_level = 1;


    public function __construct()
    {
        /* parent::__construct(); */
    }


    /**
     * Outputs a log for the replacements based on log level.
     */
    public function log(string $str, int $log_level = 1): void
    {

        if($this->log_level <= $log_level) {
            print($str . "\n");
        }

    }
}