1.0.0-alpha1 - 2020-01-23
Pre-release
Pre-release
Initial alpha release containing:
- A
NormalizedArrays
standard which will contain a full set of sniffs to check the formatting of array declarations. - A
Universal
standard which will contain a collection of universal sniffs.
DO NOT INCLUDE THIS AS A STANDARD.
Universal
, like the upstream PHPCSGeneric
standard, contains sniffs which contradict each other.
Include individual sniffs from this standard in a custom project/company ruleset to use them.
This initial alpha release contains the following sniffs:
NormalizedArrays
- 🔧 📊 📚
NormalizedArrays.Arrays.ArrayBraceSpacing
: enforce consistent spacing for the open/close braces of array declarations.
The sniff allows for having different settings for:- Space between the array keyword and the open parenthesis for long arrays via the
keywordSpacing
property.
Accepted values: (int) number of spaces orfalse
to turn this check off. Defaults to0
spaces. - Spaces on the inside of the braces for empty arrays via the
spacesWhenEmpty
property.
Accepted values: (string)newline
, (int) number of spaces orfalse
to turn this check off. Defaults to0
spaces. - Spaces on the inside of the braces for single-line arrays via the
spacesSingleLine
property;
Accepted values: (int) number of spaces orfalse
to turn this check off. Defaults to0
spaces. - Spaces on the inside of the braces for multi-line arrays via the
spacesMultiLine
property.
Accepted values: (string)newline
, (int) number of spaces orfalse
to turn this check off. Defaults tonewline
.
Note: if any of the above properties are set tonewline
, it is recommended to also include an array indentation sniff. This sniff will not handle the indentation.
- Space between the array keyword and the open parenthesis for long arrays via the
- 🔧 📊 📚
NormalizedArrays.Arrays.CommaAfterLast
: enforce/forbid a comma after the last item in an array declaration.
By default, this sniff will:- forbid a comma after the last array item for single-line arrays.
- enforce a comma after the last array item for multi-line arrays.
singleLine
ormultiLine
properties in a custom ruleset. The valid values are:enforce
,forbid
orskip
to not check the comma after the last array item for a particular type of array.
Universal
- 📚
Universal.Arrays.DuplicateArrayKey
: detects duplicate array keys in array declarations. - 📚
Universal.Arrays.MixedArrayKeyTypes
: best practice sniff: don't use a mix of integer and numeric keys for array items. - 📚
Universal.Arrays.MixedKeyedUnkeyedArray
: best practice sniff: don't use a mix of keyed and unkeyed array items. - 🔧 📊 📚
Universal.ControlStructures.IfElseDeclaration
: verify that else(if) statements with braces are on a new line. - 🔧 📊 📚
Universal.Lists.DisallowLongListSyntax
: disallow the use of longlist
s. - 🔧 📊 📚
Universal.Lists.DisallowShortListSyntax
: disallow the use of short lists. - 📊 📚
Universal.Namespaces.DisallowCurlyBraceSyntax
: disallow the use of the alternative namespace declaration syntax using curly braces. - 📊 📚
Universal.Namespaces.EnforceCurlyBraceSyntax
: enforce the use of the alternative namespace syntax using curly braces. - 📚
Universal.Namespaces.OneDeclarationPerFile
: disallow the use of multiple namespaces within a file - 📊 📚
Universal.UseStatements.DisallowUseClass
: forbid using import use statements for classes/traits/interfaces.
Individual sub-types can be allowed by excluding specific error codes. - 📊 📚
Universal.UseStatements.DisallowUseConst
: forbid using import use statements for constants.
Individual sub-types can be allowed by excluding specific error codes. - 📊 📚
Universal.UseStatements.DisallowUseFunction
: forbid using import use statements for functions.
Individual sub-types can be allowed by excluding specific error codes.