11

I spent hours on Google searching for an answer too this before asking, in phpcs I had this error "PHP version not specified", but I couldn't find an answer on Google, eventually I've just came across this "PHP Version 5" which cleared the error up, but I'm baffled as PHP 5 is out of date, I'm on PHP 7.2.10.

If anyone could shed light on this I'd much appreciate it, many thanks.

Edit: I've just added the @ lines at the top, and it breaks the "PHP Version 5" as it's saying "PHP version not specified".

  • @category
  • @package
  • @author
  • @license
  • @link
  • PHP version 5
Have a Laugh
  • 177
  • 1
  • 9
  • Maybe this can help you. https://www.hashbangcode.com/article/php-version-not-specified-warning-codesniffer – ntzz Oct 24 '18 at 07:20
  • thanks, but it didn't fix the issue – Have a Laugh Oct 24 '18 at 07:27
  • you check also with `*PHP Version 5` with uppercase in `v`? – ntzz Oct 24 '18 at 07:30
  • I have yeah, both upper and lowercase – Have a Laugh Oct 24 '18 at 07:57
  • To let the sniffs know what version of PHP you are targeting, the php_version configuration option can be used. `$ phpcs --config-set php_version 50403` check on: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version – ntzz Oct 24 '18 at 08:01

1 Answers1

18

enter image description here

"php version" All letters will be in lower case

* php version 7.2.10

* Must be placed before @tags

Rowf Abd
  • 734
  • 10
  • 21