1
0
Fork 0

Fix PHP <5.6 syntax, fixes #8759, closes #8760

pull/8843/head
Jordi Boggiano 2020-04-10 11:33:06 +02:00
parent eb314c5971
commit b3dbd95332
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 4 additions and 4 deletions

View File

@ -85,7 +85,7 @@ EOT
// switch channel if requested // switch channel if requested
$requestedChannel = null; $requestedChannel = null;
foreach (Versions::CHANNELS as $channel) { foreach (Versions::$channels as $channel) {
if ($input->getOption($channel)) { if ($input->getOption($channel)) {
$requestedChannel = $channel; $requestedChannel = $channel;
$versionsUtil->setChannel($channel); $versionsUtil->setChannel($channel);

View File

@ -21,7 +21,7 @@ use Composer\Json\JsonFile;
*/ */
class Versions class Versions
{ {
const CHANNELS = array('stable', 'preview', 'snapshot', '1', '2'); public static $channels = array('stable', 'preview', 'snapshot', '1', '2');
private $rfs; private $rfs;
private $config; private $config;
@ -52,8 +52,8 @@ class Versions
public function setChannel($channel) public function setChannel($channel)
{ {
if (!in_array($channel, self::CHANNELS, true)) { if (!in_array($channel, self::$channels, true)) {
throw new \InvalidArgumentException('Invalid channel '.$channel.', must be one of: ' . implode(', ', self::CHANNELS)); throw new \InvalidArgumentException('Invalid channel '.$channel.', must be one of: ' . implode(', ', self::$channels));
} }
$channelFile = $this->config->get('home').'/update-channel'; $channelFile = $this->config->get('home').'/update-channel';