Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of PHPUnit.
4
 *
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PHPUnit\Util;
11
 
12
use function preg_match;
13
 
14
/**
15
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
16
 */
17
final class RegularExpression
18
{
19
    /**
20
     * @return false|int
21
     */
22
    public static function safeMatch(string $pattern, string $subject)
23
    {
24
        return ErrorHandler::invokeIgnoringWarnings(
25
            static function () use ($pattern, $subject)
26
            {
27
                return preg_match($pattern, $subject);
28
            }
29
        );
30
    }
31
}