Overview

Namespaces

  • None
  • Peg
    • Cli
      • Commands
    • Config
    • Custom
      • Command
        • Action
          • Generate
          • Parse
      • CommandLine
      • Config
      • Localization
      • Utilities
    • Lib
      • Definitions
        • Element
      • Generator
      • Lexers
      • Plugins
      • Signals
        • Data
          • Definitions
          • Lexers
        • Type
  • PHP

Classes

  • Command
  • ConfigTools
  • Generate
  • Init
  • Scanner
  • Test
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Peg\Cli\Commands;
 4: 
 5: use Symfony\Component\Console\Command\Command;
 6: use Symfony\Component\Console\Input\InputArgument;
 7: use Symfony\Component\Console\Input\InputInterface;
 8: use Symfony\Component\Console\Input\InputOption;
 9: use Symfony\Component\Console\Output\OutputInterface;
10: 
11: class Test extends Command
12: {
13:     protected function configure()
14:     {
15:         $this
16:             ->setName('test')
17:             ->setDescription('pingback for testing purposes')
18:             ->addArgument(
19:                 'text',
20:                 InputArgument::OPTIONAL,
21:                 'text to repeat'
22:             )
23:         ;
24:     }
25: 
26:     protected function execute(InputInterface $input, OutputInterface $output)
27:     {
28:         $text = $input->getArgument('text');
29:         if ($text) {
30:             $output->writeln($text);
31:         } else {
32:             $output->writeln('yo');
33:         }
34:     }
35: }
36: 
PEG Api API documentation generated by ApiGen 2.8.0