diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index 9984f1547..925270ade 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -85,7 +85,7 @@ EOT // switch channel if requested $requestedChannel = null; - foreach (Versions::CHANNELS as $channel) { + foreach (Versions::$channels as $channel) { if ($input->getOption($channel)) { $requestedChannel = $channel; $versionsUtil->setChannel($channel); diff --git a/src/Composer/SelfUpdate/Versions.php b/src/Composer/SelfUpdate/Versions.php index f6f31b249..01d01e7e3 100644 --- a/src/Composer/SelfUpdate/Versions.php +++ b/src/Composer/SelfUpdate/Versions.php @@ -21,7 +21,7 @@ use Composer\Json\JsonFile; */ class Versions { - const CHANNELS = array('stable', 'preview', 'snapshot', '1', '2'); + public static $channels = array('stable', 'preview', 'snapshot', '1', '2'); private $rfs; private $config; @@ -52,8 +52,8 @@ class Versions public function setChannel($channel) { - if (!in_array($channel, self::CHANNELS, true)) { - throw new \InvalidArgumentException('Invalid channel '.$channel.', must be one of: ' . implode(', ', self::CHANNELS)); + if (!in_array($channel, self::$channels, true)) { + throw new \InvalidArgumentException('Invalid channel '.$channel.', must be one of: ' . implode(', ', self::$channels)); } $channelFile = $this->config->get('home').'/update-channel';