Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Output / Statistics / HookStat.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\Output\Statistics;
12
13 /**
14  * Represents hook stat.
15  *
16  * @author Konstantin Kudryashov <ever.zet@gmail.com>
17  */
18 final class HookStat
19 {
20     /**
21      * @var string
22      */
23     private $name;
24     /**
25      * @var string
26      */
27     private $path;
28     /**
29      * @var string|null
30      */
31     private $error;
32     /**
33      * @var string|null
34      */
35     private $stdOut;
36
37     /**
38      * Initializes hook stat.
39      *
40      * @param string      $name
41      * @param string      $path
42      * @param null|string $error
43      * @param null|string $stdOut
44      */
45     public function __construct($name, $path, $error = null, $stdOut = null)
46     {
47         $this->name = $name;
48         $this->path = $path;
49         $this->error = $error;
50         $this->stdOut = $stdOut;
51     }
52
53     /**
54      * {@inheritdoc}
55      */
56     public function getName()
57     {
58         return $this->name;
59     }
60
61     /**
62      * {@inheritdoc}
63      */
64     public function isSuccessful()
65     {
66         return null === $this->error;
67     }
68
69     /**
70      * Returns hook standard output (if has some).
71      *
72      * @return null|string
73      */
74     public function getStdOut()
75     {
76         return $this->stdOut;
77     }
78
79     /**
80      * Returns hook exception.
81      *
82      * @return string
83      */
84     public function getError()
85     {
86         return $this->error;
87     }
88
89     /**
90      * Returns hook path.
91      *
92      * @return string
93      */
94     public function getPath()
95     {
96         return $this->path;
97     }
98 }