X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FDefinition%2FDefinitionRepository.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FDefinition%2FDefinitionRepository.php;h=0000000000000000000000000000000000000000;hp=b1db15ae624cd536869831a360f6c47c053a648c;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionRepository.php b/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionRepository.php deleted file mode 100644 index b1db15ae6..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/DefinitionRepository.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Definition; - -use Behat\Behat\Definition\Exception\RedundantStepException; -use Behat\Testwork\Environment\Environment; -use Behat\Testwork\Environment\EnvironmentManager; - -/** - * Provides step definitions using environment manager. - * - * @author Konstantin Kudryashov - */ -final class DefinitionRepository -{ - /** - * @var EnvironmentManager - */ - private $environmentManager; - - /** - * Initializes repository. - * - * @param EnvironmentManager $environmentManager - */ - public function __construct(EnvironmentManager $environmentManager) - { - $this->environmentManager = $environmentManager; - } - - /** - * Returns all available definitions for a specific environment. - * - * @param Environment $environment - * - * @return Definition[] - * - * @throws RedundantStepException - */ - public function getEnvironmentDefinitions(Environment $environment) - { - $patterns = array(); - $definitions = array(); - - foreach ($this->environmentManager->readEnvironmentCallees($environment) as $callee) { - if (!$callee instanceof Definition) { - continue; - } - - $pattern = $callee->getPattern(); - if (isset($patterns[$pattern])) { - throw new RedundantStepException($callee, $patterns[$pattern]); - } - - $patterns[$pattern] = $callee; - - $definitions[] = $callee; - } - - return $definitions; - } -}