����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 13.59.90.172
Web Server : LiteSpeed
System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : gltevjme ( 1095)
PHP Version : 7.0.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gltevjme/bofirm.gltechlimited.com/vendor/nunomaduro/termwind/src/ValueObjects/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/bofirm.gltechlimited.com/vendor/nunomaduro/termwind/src/ValueObjects/Style.php
<?php

declare(strict_types=1);

namespace Termwind\ValueObjects;

use Closure;
use Termwind\Actions\StyleToMethod;
use Termwind\Exceptions\InvalidColor;

/**
 * @internal
 */
final class Style
{
    /**
     * Creates a new value object instance.
     *
     * @param Closure(Styles $styles, string|int ...$argument): Styles  $callback
     */
    public function __construct(private Closure $callback, private string $color = '')
    {
        // ..
    }

    /**
     * Apply the given set of styles to the styles.
     */
    public function apply(string $styles): void
    {
        $callback = clone $this->callback;

        $this->callback = static function (
            Styles $formatter,
            string|int ...$arguments
        ) use ($callback, $styles): Styles {
            $formatter = $callback($formatter, ...$arguments);

            return StyleToMethod::multiple($formatter, $styles);
        };
    }

    /**
     * Sets the color to the style.
     */
    public function color(string $color): void
    {
        if (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $color) < 1) {
            throw new InvalidColor(sprintf('The color %s is invalid.', $color));
        }

        $this->color = $color;
    }

    /**
     * Gets the color.
     */
    public function getColor(): string
    {
        return $this->color;
    }

    /**
     * Styles the given formatter with this style.
     */
    public function __invoke(Styles $styles, string|int ...$arguments): Styles
    {
        return ($this->callback)($styles, ...$arguments);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit