Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Definition / SearchResult.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\Definition;
12
13 /**
14  * Step definition search result.
15  *
16  * @author Konstantin Kudryashov <ever.zet@gmail.com>
17  */
18 final class SearchResult
19 {
20     /**
21      * @var null|Definition
22      */
23     private $definition;
24     /**
25      * @var null|string
26      */
27     private $matchedText;
28     /**
29      * @var null|array
30      */
31     private $arguments;
32
33     /**
34      * Registers search match.
35      *
36      * @param null|Definition $definition
37      * @param null|string     $matchedText
38      * @param null|array      $arguments
39      */
40     public function __construct(Definition $definition = null, $matchedText = null, array $arguments = null)
41     {
42         $this->definition = $definition;
43         $this->matchedText = $matchedText;
44         $this->arguments = $arguments;
45     }
46
47     /**
48      * Checks if result contains a match.
49      *
50      * @return Boolean
51      */
52     public function hasMatch()
53     {
54         return null !== $this->definition;
55     }
56
57     /**
58      * Returns matched definition.
59      *
60      * @return null|Definition
61      */
62     public function getMatchedDefinition()
63     {
64         return $this->definition;
65     }
66
67     /**
68      * Returns matched text.
69      *
70      * @return null|string
71      */
72     public function getMatchedText()
73     {
74         return $this->matchedText;
75     }
76
77     /**
78      * Returns matched definition arguments.
79      *
80      * @return null|array
81      */
82     public function getMatchedArguments()
83     {
84         return $this->arguments;
85     }
86 }