Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Exception / Stringer / TestworkExceptionStringer.php
1 <?php
2
3 /*
4  * This file is part of the Behat.
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\Exception\Stringer;
12
13 use Behat\Testwork\Call\Exception\CallErrorException;
14 use Behat\Testwork\Exception\TestworkException;
15 use Exception;
16
17 /**
18  * Strings Testwork exceptions.
19  *
20  * @author Konstantin Kudryashov <ever.zet@gmail.com>
21  */
22 final class TestworkExceptionStringer implements ExceptionStringer
23 {
24     /**
25      * {@inheritdoc}
26      */
27     public function supportsException(Exception $exception)
28     {
29         return $exception instanceof TestworkException || $exception instanceof CallErrorException;
30     }
31
32     /**
33      * {@inheritdoc}
34      */
35     public function stringException(Exception $exception, $verbosity)
36     {
37         return trim($exception->getMessage());
38     }
39 }