3

After installing Composer in windows 10, the result of phpc -i command is:

"The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz and Zend."

After lots of searches I was unable to find any documentation about MySource coding standard, nor for Squiz coding standard.

So what are these two standards? Are there any link to their documentation to see what sniffs they do?

In fact I need to know are there any extra sniffs which these two standard do in comparison with PSR12? (currently I've set only PSR1,PSR12 in my vscode code sniffer extension settings.)

Nico Haase
  • 11,420
  • 35
  • 43
  • 69
IT_man2018
  • 53
  • 7

2 Answers2

3

Squiz Labs is (or was?) the group behind PHP CS. You can see that in the repo URL: https://github.com/squizlabs/PHP_CodeSniffer

From the ruleset definition:

The MySource coding standard builds on the Squiz coding standard. Currently used for MySource Mini development.

Chris Haas
  • 53,986
  • 12
  • 141
  • 274
3

The Squiz coding standard has a lot of useful sniffs in there, and they are used by some of the other included standards. The MySource standard is old and not useful, is deprecated, and already removed in the 4.0 branch.

Greg Sherwood
  • 6,992
  • 2
  • 29
  • 24
  • Thanks a lot Greg for your useful clarification. I'm new in the context of php coding standards and hence i didn't catch something. I don't know what is 4.0 branch at all. I've installed Latest version of composer (2.2.5) and phpcs -i command shows MySource in installed. So should I run any update command to update this libraries and get rid of MySource ? (I mean a way to uninstall MySource from my composer installation). Sorry if these are The trivial questions but i don't know what to search to get answers to such specific questions – IT_man2018 Jan 31 '22 at 04:30
  • Sorry, 4.0 branch refers to version 4 of PHPCS that is currently in development. It's not scheduled for release, but I mentioned it in this context so it's clear that MySource is an old standard and will eventually be removed. You'll need to live with the MySource standard existing in the core until that time. – Greg Sherwood Feb 01 '22 at 05:04