-2

I'm trying to dockerise an app that was handed down to me from other company and am running into the problem described here: Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

I figured the first thing I should ensure is to have the correct version of composer. If I am wrong I will wholeheartedly welcome an advise.

yivi
  • 42,438
  • 18
  • 116
  • 138
Vulwsztyn
  • 2,140
  • 1
  • 12
  • 20
  • 1
    What makes you think that this is a problem of Composer? Usually, such a warning is thrown if the PHP version does not match – Nico Haase Dec 19 '21 at 10:29
  • 2
    The error is completely unrelated to the Composer's version. Also, there is usually zero reasons to check which version of composer was used to generate the original `composer.lock` file. If your version of composer is not compatible, you'd get an error to that effect (not the one you mention in your question, but one complaining about the `plugin-api-version`. – yivi Dec 19 '21 at 11:34

1 Answers1

1

I can think of two methods.

#1 If the composer.lock file exists, there is a mention of Composer version, for example at very end should be something like:

    "plugin-api-version": "2.2.0"
}

(Which means Composer 2.2.0 obviously.)

#2 If Composer-API is used as dependency, another way would be checking composer.json file, simply search for composer mentions there.

yivi
  • 42,438
  • 18
  • 116
  • 138
Top-Master
  • 7,611
  • 5
  • 39
  • 71