Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Call / Exception / CallErrorException.php
1 <?php
2
3 /*
4  * This file is part of the Behat Testwork.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
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 namespace Behat\Testwork\Call\Exception;
12
13 use ErrorException;
14
15 /**
16  * Represents catchable errors raised during call execution.
17  *
18  * @author Konstantin Kudryashov <ever.zet@gmail.com>
19  */
20 final class CallErrorException extends ErrorException
21 {
22     private $levels = array(
23         E_WARNING           => 'Warning',
24         E_NOTICE            => 'Notice',
25         E_USER_ERROR        => 'User Error',
26         E_USER_WARNING      => 'User Warning',
27         E_USER_NOTICE       => 'User Notice',
28         E_STRICT            => 'Runtime Notice',
29         E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
30     );
31
32     /**
33      * Initializes error handler exception.
34      *
35      * @param integer $level   error level
36      * @param string  $message error message
37      * @param string  $file    error file
38      * @param integer $line    error line
39      */
40     public function __construct($level, $message, $file, $line)
41     {
42         parent::__construct(
43             sprintf(
44                 '%s: %s in %s line %d',
45                 isset($this->levels[$level]) ? $this->levels[$level] : $level,
46                 $message,
47                 $file,
48                 $line
49             )
50         );
51     }
52 }