Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Hook / Scope / BeforeFeatureScope.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\Hook\Scope;
12
13 use Behat\Gherkin\Node\FeatureNode;
14 use Behat\Testwork\Environment\Environment;
15 use Behat\Testwork\Suite\Suite;
16
17 /**
18  * Represents a BeforeFeature hook scope.
19  *
20  * @author Konstantin Kudryashov <ever.zet@gmail.com>
21  */
22 final class BeforeFeatureScope implements FeatureScope
23 {
24     /**
25      * @var Environment
26      */
27     private $environment;
28     /**
29      * @var FeatureNode
30      */
31     private $feature;
32
33     /**
34      * Initializes scope.
35      *
36      * @param Environment $env
37      * @param FeatureNode $feature
38      */
39     public function __construct(Environment $env, FeatureNode $feature)
40     {
41         $this->environment = $env;
42         $this->feature = $feature;
43     }
44
45     /**
46      * Returns hook scope name.
47      *
48      * @return string
49      */
50     public function getName()
51     {
52         return self::BEFORE;
53     }
54
55     /**
56      * Returns hook suite.
57      *
58      * @return Suite
59      */
60     public function getSuite()
61     {
62         return $this->environment->getSuite();
63     }
64
65     /**
66      * Returns hook environment.
67      *
68      * @return Environment
69      */
70     public function getEnvironment()
71     {
72         return $this->environment;
73     }
74
75     /**
76      * Returns scope feature.
77      *
78      * @return FeatureNode
79      */
80     public function getFeature()
81     {
82         return $this->feature;
83     }
84 }