Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Context / Snippet / Generator / ContextInterfaceBasedContextIdentifier.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 use Behat\Behat\Context\Environment\ContextEnvironment;
14
15 /**
16  * Identifier that uses context interfaces to guess which one is target.
17  *
18  * @author Konstantin Kudryashov <ever.zet@gmail.com>
19  *
20  * @deprecated in favour of --snippets-for and will be removed in 4.0
21  */
22 final class ContextInterfaceBasedContextIdentifier implements TargetContextIdentifier
23 {
24     /**
25      * {@inheritdoc}
26      */
27     public function guessTargetContextClass(ContextEnvironment $environment)
28     {
29         foreach ($environment->getContextClasses() as $class) {
30             if (in_array('Behat\Behat\Context\SnippetAcceptingContext', class_implements($class))) {
31                 return $class;
32             }
33         }
34
35         return null;
36     }
37 }