terminus icon indicating copy to clipboard operation
terminus copied to clipboard

error: "continue" targeting switch is equivalent to "break"

Open cjokinen opened this issue 7 years ago • 7 comments
trafficstars

Expected behavior

install of terminus

Actual behavior

[ErrorException] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Steps to reproduce the behavior

I think this is relate to a new version of PHP. After an update I started seeing the above message as a warning in vs code phpcs (the php linter). VS Code gave me the file and lines to fix it by changing "continue" to "continue 2" in a switch statement nested in a foreach loop.

My current system Linux Mint 18.1 Serena PHP 7.3.0RC3 (cli) (built: Oct 15 2018 11:36:28) ( NTS ) composer version 1.4.2

installed cli modules [PHP Modules] bz2 calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv json libxml mbstring memcache mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql Phar posix readline Reflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zlib

[Zend Modules] Zend OPcache

------------------------------------------------ Instructions

~ mkdir terminus ~ $ cd terminus/ ~/terminus $ curl -O https://raw.githubusercontent.com/pantheon-systems/terminus-installer/master/builds/installer.phar && php installer.phar install

------------------------------------------------ output ` % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3198k 100 3198k 0 0 3151k 0 0:00:01 0:00:01 --:--:-- 3154k Installing Terminus... Using version ^1.9 for pantheon-systems/terminus ./composer.json has been created Loading composer repositories with package information Updating dependencies (including require-dev)

Installation failed, deleting ./composer.json.

[ErrorException]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...

Terminus was installed, but the installer was not able to write to your bin dir. To enable the terminus command, add this alias to your .bash_profile (Mac) or .bashrc (Linux) file:

alias terminus=/home/cjokinen/terminus/vendor/bin/terminus

Or you can enable it by adding the directory the executable file is in to your path:

PATH="/home/cjokinen/terminus/vendor/bin:$PATH" `

------------------------------------------- after I checked and now terminus was installed.

cjokinen avatar Oct 19 '18 14:10 cjokinen

I have the same error on Ubuntu 18.10.

Calystod avatar Nov 19 '18 05:11 Calystod

Try: $composer self-update

Thomasvc1 avatar Dec 19 '18 08:12 Thomasvc1

I think this is a PHP 7.3 bug and terminus is not usable there. Seems like a big-ish issue now its GAed.

heddn avatar Dec 20 '18 15:12 heddn

https://git.mtech-llc.com/open-source/drupal-docker/-/jobs/2942 => shows the full log of requiring this on php 7.3. Along with the version of composer, etc.

heddn avatar Dec 20 '18 15:12 heddn

https://github.com/pantheon-systems/terminus-installer/pull/36 seems to fix this.

heddn avatar Dec 20 '18 17:12 heddn

Terminus itself seems to work fine with php 7.3.

greg-1-anderson avatar Dec 22 '18 01:12 greg-1-anderson

Any update on this? I'm not familiar with PHP and am unable to install Terminus due to this. The potential fix above still hasn't been merged. This version of PHP is the default in Homebrew and I imagine other package managers as well.

derelk avatar Jan 24 '19 23:01 derelk