File "PatternMatchException.php"

Full Path: /var/www/html/wordpress/wp-content/plugins/wp-optimize/vendor/matthiasmullie/minify/src/Exceptions/PatternMatchException.php
File size: 828 bytes
MIME-type: text/x-php
Charset: utf-8

 
Open Back
<?php

/**
 * Pattern match exception.
 *
 * Please report bugs on https://github.com/matthiasmullie/minify/issues
 *
 * @author Ere Maijala <[email protected]>
 * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
 * @license MIT License
 */

namespace MatthiasMullie\Minify\Exceptions;

/**
 * Pattern Match Exception Class.
 *
 * @author Ere Maijala <[email protected]>
 */
class PatternMatchException extends BasicException
{
    /**
     * Create an exception from preg_last_error.
     *
     * @param string $msg Error message
     */
    public static function fromLastError($msg)
    {
        $msg .= ': Error ' . preg_last_error();
        if (PHP_MAJOR_VERSION >= 8) {
            $msg .= ' - ' . preg_last_error_msg();
        }

        return new PatternMatchException($msg);
    }
}