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