/**
  * Returns update channel.
  *
  * @return string
  */
 protected function getUpdateChannel()
 {
     if ($this->io->getOption('stable')) {
         $this->_configEditor->set('update-channel', Stability::STABLE);
     }
     if ($this->io->getOption('snapshot')) {
         $this->_configEditor->set('update-channel', Stability::SNAPSHOT);
     }
     if ($this->io->getOption('preview')) {
         $this->_configEditor->set('update-channel', Stability::PREVIEW);
     }
     return $this->_configEditor->get('update-channel');
 }
 /**
  * @dataProvider setValueWithInheritanceDataProvider
  */
 public function testSetValueWithInheritanceFromGlobal($wc_value, $global_value)
 {
     $this->configEditor->set('global-settings.name', $this->convertToStorage($wc_value));
     $config_setting = $this->createConfigSetting(AbstractConfigSetting::SCOPE_WORKING_COPY, $global_value);
     $config_setting->setWorkingCopyUrl('url');
     $config_setting->setValue($wc_value);
     $this->assertNull($this->configEditor->get('path-settings[url].name'), 'Inherited value isn\'t stored');
 }
 /**
  * Changes setting value.
  *
  * @param mixed   $value     Value.
  * @param integer $scope_bit Scope bit.
  *
  * @return void
  * @throws \LogicException When no matching scope was found.
  */
 public function setValue($value, $scope_bit = null)
 {
     $this->assertUsage(__METHOD__, $scope_bit);
     if ($value !== null) {
         $value = $this->normalizeValue($value);
         $this->validate($value);
         $value = $this->convertToStorageFormat($value);
     }
     if (!isset($scope_bit)) {
         if ($this->isWithinScope(self::SCOPE_WORKING_COPY)) {
             $scope_bit = self::SCOPE_WORKING_COPY;
         } else {
             $scope_bit = self::SCOPE_GLOBAL;
         }
     }
     // Don't store inherited value.
     if ($value === $this->_getInheritedValue(__METHOD__, $scope_bit)) {
         $value = null;
     }
     $this->_editor->set($this->_getScopedName(__METHOD__, $scope_bit), $value);
 }