4 * This file is part of the Behat.
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\Behat\Definition\Pattern\Policy;
13 use Behat\Behat\Definition\Pattern\Pattern;
14 use Behat\Behat\Definition\Pattern\PatternTransformer;
17 * Defines a way to handle custom definition patterns.
19 * @see PatternTransformer
21 * @author Konstantin Kudryashov <ever.zet@gmail.com>
23 interface PatternPolicy
26 * Checks if policy supports pattern type.
32 public function supportsPatternType($type);
35 * Generates pattern for step text.
37 * @param string $stepText
41 public function generatePattern($stepText);
44 * Checks if policy supports pattern.
46 * @param string $pattern
50 public function supportsPattern($pattern);
53 * Transforms pattern string to regex.
55 * @param string $pattern
59 public function transformPatternToRegex($pattern);