Fix bug in style changes for the Use cases on the live site.
[yaffs-website] / vendor / phpunit / phpunit / src / Util / Regex.php
1 <?php
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
11 /**
12  * Error handler that converts PHP errors and warnings to exceptions.
13  *
14  * @since Class available since Release 4.2.0
15  */
16 class PHPUnit_Util_Regex
17 {
18     public static function pregMatchSafe($pattern, $subject, $matches = null, $flags = 0, $offset = 0)
19     {
20         $handler_terminator = PHPUnit_Util_ErrorHandler::handleErrorOnce(E_WARNING);
21         $match              = preg_match($pattern, $subject, $matches, $flags, $offset);
22         $handler_terminator(); // cleaning
23
24         return $match;
25     }
26 }