Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Context / Snippet / Generator / ContextInterfaceBasedPatternIdentifier.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\Behat\Context\Snippet\Generator;
12
13 /**
14  * Identifier that uses context interfaces to guess the pattern type.
15  *
16  * @author Konstantin Kudryashov <ever.zet@gmail.com>
17  *
18  * @deprecated in favour of --snippet-type and will be removed in 4.0
19  */
20 final class ContextInterfaceBasedPatternIdentifier implements PatternIdentifier
21 {
22     /**
23      * {@inheritdoc}
24      */
25     public function guessPatternType($contextClass)
26     {
27         if (!in_array('Behat\Behat\Context\CustomSnippetAcceptingContext', class_implements($contextClass))) {
28             return null;
29         }
30
31         return $contextClass::getAcceptedSnippetType();
32     }
33 }