PHP 8.2.31
Preview: Warn.php Size: 1.94 KB
/home/nshryvcy/himaltourism.com/wp-content/plugins/megamenu/classes/scss/1.11.1/src/Warn.php

<?php

/**
 * SCSSPHP
 *
 * @copyright 2012-2020 Leaf Corcoran
 *
 * @license http://opensource.org/licenses/MIT MIT
 *
 * @link http://scssphp.github.io/scssphp
 */

namespace ScssPhp\ScssPhp;

final class Warn
{
    /**
     * @var callable|null
     * @phpstan-var (callable(string, bool): void)|null
     */
    private static $callback;

    /**
     * Prints a warning message associated with the current `@import` or function call.
     *
     * This may only be called within a custom function or importer callback.
     *
     * @param string $message
     *
     * @return void
     */
    public static function warning($message)
    {
        self::reportWarning($message, false);
    }

    /**
     * Prints a deprecation warning message associated with the current `@import` or function call.
     *
     * This may only be called within a custom function or importer callback.
     *
     * @param string $message
     *
     * @return void
     */
    public static function deprecation($message)
    {
        self::reportWarning($message, true);
    }

    /**
     * @param callable|null $callback
     *
     * @return callable|null The previous warn callback
     *
     * @phpstan-param (callable(string, bool): void)|null $callback
     *
     * @phpstan-return (callable(string, bool): void)|null
     *
     * @internal
     */
    public static function setCallback(callable $callback = null)
    {
        $previousCallback = self::$callback;
        self::$callback = $callback;

        return $previousCallback;
    }

    /**
     * @param string $message
     * @param bool   $deprecation
     *
     * @return void
     */
    private static function reportWarning($message, $deprecation)
    {
        if (self::$callback === null) {
            throw new \BadMethodCallException('The warning Reporter may only be called within a custom function or importer callback.');
        }

        \call_user_func(self::$callback, $message, $deprecation);
    }
}

Directory Contents

Dirs: 9 × Files: 14

Name Size Perms Modified Actions
Base DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
Block DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
Compiler DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
Exception DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
Formatter DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
Logger DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
Node DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
SourceMap DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
Util DIR
- drwxr-xr-x 2025-01-05 05:34:13
Edit Download
887 B lrw-r--r-- 2025-01-05 05:34:13
Edit Download
6.68 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
7.63 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
1.11 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
306.27 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
8.55 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
543 B lrw-r--r-- 2025-01-05 05:34:13
Edit Download
133 B lrw-r--r-- 2025-01-05 05:34:13
Edit Download
112.36 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
3.38 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
5.02 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
2.28 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download
317 B lrw-r--r-- 2025-01-05 05:34:13
Edit Download
1.94 KB lrw-r--r-- 2025-01-05 05:34:13
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).