X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FGherkin%2FCli%2FSyntaxController.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FGherkin%2FCli%2FSyntaxController.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=a3e3f6cfcbe34d2b8a68264671ccdd9ea7fef439;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/SyntaxController.php b/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/SyntaxController.php deleted file mode 100644 index a3e3f6cfc..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/SyntaxController.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Gherkin\Cli; - -use Behat\Gherkin\Keywords\KeywordsDumper; -use Behat\Testwork\Cli\Controller; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Translation\TranslatorInterface; - -/** - * Prints example of the feature to present all available syntax keywords. - * - * @author Konstantin Kudryashov - */ -final class SyntaxController implements Controller -{ - /** - * @var KeywordsDumper - */ - private $keywordsDumper; - /** - * @var TranslatorInterface - */ - private $translator; - - /** - * Initializes controller. - * - * @param KeywordsDumper $dumper - * @param TranslatorInterface $translator - */ - public function __construct(KeywordsDumper $dumper, TranslatorInterface $translator) - { - $dumper->setKeywordsDumperFunction(array($this, 'dumpKeywords')); - $this->keywordsDumper = $dumper; - $this->translator = $translator; - } - - /** - * Configures command to be executable by the controller. - * - * @param Command $command - */ - public function configure(Command $command) - { - $command - ->addOption( - '--story-syntax', null, InputOption::VALUE_NONE, - "Print *.feature example." . PHP_EOL . - "Use --lang to see specific language." - ); - } - - /** - * Executes controller. - * - * @param InputInterface $input - * @param OutputInterface $output - * - * @return null|integer - */ - public function execute(InputInterface $input, OutputInterface $output) - { - if (!$input->getOption('story-syntax')) { - return null; - } - - $output->getFormatter()->setStyle('gherkin_keyword', new OutputFormatterStyle('green', null, array('bold'))); - $output->getFormatter()->setStyle('gherkin_comment', new OutputFormatterStyle('yellow')); - - $story = $this->keywordsDumper->dump($this->translator->getLocale()); - $story = preg_replace('/^\#.*/', '$0', $story); - $output->writeln($story); - $output->writeln(''); - - return 0; - } - - /** - * Keywords dumper. - * - * @param array $keywords keywords list - * - * @return string - */ - public function dumpKeywords(array $keywords) - { - $dump = '' . implode('|', $keywords) . ''; - - if (1 < count($keywords)) { - return '[' . $dump . ']'; - } - - return $dump; - } -}