Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Hook / Call / RuntimeFilterableHook.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\Hook\Call;
12
13 use Behat\Testwork\Hook\FilterableHook;
14
15 /**
16  * Represents runtime hook, filterable by filter string.
17  *
18  * @author Konstantin Kudryashov <ever.zet@gmail.com>
19  */
20 abstract class RuntimeFilterableHook extends RuntimeHook implements FilterableHook
21 {
22     /**
23      * @var null|string
24      */
25     private $filterString;
26
27     /**
28      * Initializes hook.
29      *
30      * @param string      $scopeName
31      * @param null|string $filterString
32      * @param callable    $callable
33      * @param null|string $description
34      */
35     public function __construct($scopeName, $filterString, $callable, $description = null)
36     {
37         $this->filterString = $filterString;
38
39         parent::__construct($scopeName, $callable, $description);
40     }
41
42     /**
43      * Returns hook filter string (if has one).
44      *
45      * @return null|string
46      */
47     public function getFilterString()
48     {
49         return $this->filterString;
50     }
51
52     /**
53      * {@inheritdoc}
54      */
55     public function __toString()
56     {
57         return trim($this->getName() . ' ' . $this->getFilterString());
58     }
59 }