/**
  *
  */
 public function execute()
 {
     if ($this->config->installGlobally()) {
         $targetDirectory = dirname($this->environment->getBinaryName());
     } else {
         $targetDirectory = $this->config->getWorkingDirectory();
     }
     foreach ($this->config->getRequestedPhars() as $requestedPhar) {
         $this->pharService->install($requestedPhar, $targetDirectory);
         if ($this->config->doNotAddToPhiveXml()) {
             continue;
         }
         $this->phiveXmlConfig->addPhar($requestedPhar);
     }
 }
 /**
  * @dataProvider boolProvider
  *
  * @param $switch
  */
 public function testInstallGlobally($switch)
 {
     $options = $this->getOptionsMock();
     $options->expects($this->once())->method('isSwitch')->with('global')->willReturn($switch);
     $commandConfig = new InstallCommandConfig($options, $this->getConfigMock(), $this->getPhiveXmlConfigMock());
     $this->assertSame($switch, $commandConfig->installGlobally());
 }