4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Behat\Definition;
14 * Step definition search result.
16 * @author Konstantin Kudryashov <ever.zet@gmail.com>
18 final class SearchResult
21 * @var null|Definition
34 * Registers search match.
36 * @param null|Definition $definition
37 * @param null|string $matchedText
38 * @param null|array $arguments
40 public function __construct(Definition $definition = null, $matchedText = null, array $arguments = null)
42 $this->definition = $definition;
43 $this->matchedText = $matchedText;
44 $this->arguments = $arguments;
48 * Checks if result contains a match.
52 public function hasMatch()
54 return null !== $this->definition;
58 * Returns matched definition.
60 * @return null|Definition
62 public function getMatchedDefinition()
64 return $this->definition;
68 * Returns matched text.
72 public function getMatchedText()
74 return $this->matchedText;
78 * Returns matched definition arguments.
82 public function getMatchedArguments()
84 return $this->arguments;