Releases: MessageCloud/messagecloud-coding-standard
Releases · MessageCloud/messagecloud-coding-standard
3.0.2
3.0.1
3.0.0
- Forbid PHP 4 constructors
- Forbid deprecated functions
- Forbid comments starting with #
- Disallow else if in favour of elseif
- Forbid dead code
- Forbid assignments in conditions
- Require new instances with parentheses
- Forbid usage of conditions when a simple return can be used
- Forbid usage of boolean-only ternary operator usage (e.g. $foo ? true : false)
- Require using Throwable instead of Exception
- Require use statements to be alphabetically sorted
- Forbid weak comparisons
- Require no spacing after spread operator
- Forbid useless parentheses
- Require ? when default value is null
- Forbid uses of multiple traits separated by comma
- Require no spaces before trait use, between trait uses and one space after trait uses
- Forbid
AND
andOR
, require&&
and||
- Forbid
global
- Forbid functions inside functions
- Require PHP function calls in lowercase
- Forbid dead code
- Forbid class being in a file with different name
- Force whitespace before and after concatenation
- Forbid strings in
"
unless necessary - Forbid braces around string in
echo
- Forbid spaces in type casts
- Forbid blank line after function opening brace
- Require 1 line before and after function, except at the top and bottom
- Require space after language constructs
- Require space around logical operators
- Forbid spaces before semicolon
;
- Forbid spaces around
->
operator - Forbid useless alias for classes, constants and functions
- Require /* @var type $foo */ and similar simple inline annotations to be replaced by assert()
2.0.0
Additions
- Force whitespace after a type cast
- Forbid short open tag
- Require comma after last element in multi-line array
- Require presence of constant visibility
- Require usage of null coalesce operator when possible
- Forbid useless unreachable catch blocks
- Forbid unused use statements
- Forbid superfluous leading backslash in use statements
- Require empty newlines before and after uses
- Forbid using absolute class name references (except global ones)
- Require presence of declare(strict_types=1)
- Require one space between typehint and variable, require no space between nullability sign and typehint
1.0.0
🎉 Initial release of the MessageCloud coding standard, to be used in conjunction with PHP Code Sniffer.