Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Environment / Call / EnvironmentCall.php
1 <?php
2
3 /*
4  * This file is part of the Behat Testwork.
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\Testwork\Environment\Call;
12
13 use Behat\Testwork\Call\Call;
14 use Behat\Testwork\Call\Callee;
15 use Behat\Testwork\Environment\Environment;
16
17 /**
18  * Represents environment-based call.
19  *
20  * @author Konstantin Kudryashov <ever.zet@gmail.com>
21  */
22 class EnvironmentCall implements Call
23 {
24     /**
25      * @var Environment
26      */
27     private $environment;
28     /**
29      * @var Callee
30      */
31     private $callee;
32     /**
33      * @var array
34      */
35     private $arguments;
36     /**
37      * @var null|integer
38      */
39     private $errorReportingLevel;
40
41     /**
42      * Initializes call.
43      *
44      * @param Environment  $environment
45      * @param Callee       $callee
46      * @param array        $arguments
47      * @param null|integer $errorReportingLevel
48      */
49     public function __construct(
50         Environment $environment,
51         Callee $callee,
52         array $arguments,
53         $errorReportingLevel = null
54     ) {
55         $this->environment = $environment;
56         $this->callee = $callee;
57         $this->arguments = $arguments;
58         $this->errorReportingLevel = $errorReportingLevel;
59     }
60
61     /**
62      * Returns environment this call is executed from.
63      *
64      * @return Environment
65      */
66     final public function getEnvironment()
67     {
68         return $this->environment;
69     }
70
71     /**
72      * {@inheritdoc}
73      */
74     final public function getCallee()
75     {
76         return $this->callee;
77     }
78
79     /**
80      * {@inheritdoc}
81      */
82     final public function getBoundCallable()
83     {
84         return $this->environment->bindCallee($this->callee);
85     }
86
87     /**
88      * {@inheritdoc}
89      */
90     final public function getArguments()
91     {
92         return $this->arguments;
93     }
94
95     /**
96      * {@inheritdoc}
97      */
98     final public function getErrorReportingLevel()
99     {
100         return $this->errorReportingLevel;
101     }
102 }