4 * This file is part of the Behat Testwork.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Testwork\Hook\Call;
13 use Behat\Testwork\Hook\FilterableHook;
16 * Represents runtime hook, filterable by filter string.
18 * @author Konstantin Kudryashov <ever.zet@gmail.com>
20 abstract class RuntimeFilterableHook extends RuntimeHook implements FilterableHook
25 private $filterString;
30 * @param string $scopeName
31 * @param null|string $filterString
32 * @param callable $callable
33 * @param null|string $description
35 public function __construct($scopeName, $filterString, $callable, $description = null)
37 $this->filterString = $filterString;
39 parent::__construct($scopeName, $callable, $description);
43 * Returns hook filter string (if has one).
47 public function getFilterString()
49 return $this->filterString;
55 public function __toString()
57 return trim($this->getName() . ' ' . $this->getFilterString());