Exemplo n.º 1
0
 /**
  * Application constructor.
  * @param $argv array CLI arguments
  */
 public function __construct($argv)
 {
     $this->config = new Config(new Parser(), new FileLoader());
     $this->argParser = new ArgvParser($argv);
     $configFile = $this->argParser->get('config');
     if (file_exists($configFile) && is_readable($configFile)) {
         $this->config->loadData($configFile);
     }
 }
Exemplo n.º 2
0
 /** @test */
 public function shouldReplaceArgvOnParseCall()
 {
     $parser = new ArgvParser([]);
     $parser->parse(['--a=b']);
     $this->assertEquals(['a' => 'b'], $parser->all());
 }