Mercurial > packages > magicforger
view src/Replacer.php @ 12:4bb4daa9e3f1 development
Working with the new FileModifier
| author | luka |
|---|---|
| date | Wed, 24 Apr 2024 19:52:35 -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"); } } }
