PHP Classes

File: src/Interfaces/HighlightInterface.php

Recommend this page to a friend!
  Classes of Rodolfo Berrios Arce   Var-Dump   src/Interfaces/HighlightInterface.php   Download  
File: src/Interfaces/HighlightInterface.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Var-Dump
Show the value of a variable in colored way
Author: By
Last change:
Date: 19 days ago
Size: 1,570 bytes
 

Contents

Class file image Download
<?php

/*
 * This file is part of Chevere.
 *
 * (c) Rodolfo Berrios <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace
Chevere\VarDump\Interfaces;

use
Chevere\Parameter\Interfaces\TypeInterface;

/**
 * Describes the component in charge of highlight the var dump strings.
 */
interface HighlightInterface
{
    public const
KEYS = [
       
TypeInterface::STRING,
       
TypeInterface::FLOAT,
       
TypeInterface::INT,
       
TypeInterface::BOOL,
       
TypeInterface::NULL,
       
TypeInterface::OBJECT,
       
TypeInterface::ARRAY,
       
TypeInterface::RESOURCE,
       
VarDumperInterface::FILE,
       
VarDumperInterface::CLASS_REG,
       
VarDumperInterface::OPERATOR,
       
VarDumperInterface::FUNCTION,
       
VarDumperInterface::MODIFIER,
       
VarDumperInterface::VARIABLE,
       
VarDumperInterface::EMPHASIS,
    ];

   
/**
     * Constructs a highlight instance specified by `$key`.
     *
     * @see `VarDumpHighlightInterface::KEYS`
     */
   
public function __construct(string $key);

   
/**
     * Highlights `$string`.
     */
   
public function highlight(string $string): string;

   
/**
     * Provide access to the color palette.
     *
     * ```php
     * return [
     * 'string' => '<color_for_string>',
     * 'float' => '<color_for_float>',
     * ];
     * ```
     * @return array<string, string|array<string>>
     */
   
public static function palette(): array;
}