Skip to content

Releases: spaze/coding-standard

Suggest adding to require-dev

09 Oct 21:44
498c4ea

Choose a tag to compare

  • If running composer require without the --dev option, prompt users if they would like to add these packages to require-dev instead of require (#13)

Add BackedEnumTypeSpacing sniff

08 Jul 16:34
70cca80

Choose a tag to compare

Check property declarations more thoroughly

26 Jun 18:16
604c63f

Choose a tag to compare

Requires slevomat/coding-standard 8.1 (#11)

Constructor property promotion & short arrays

18 Jun 02:22
b2f1a75

Choose a tag to compare

  • Short arrays [] required (#8)
  • Constructor property promotion required (#7), code targeting PHP 7.x can exclude the rule, see the PR
  • Require slevomat/coding-standard 8.0 for the fullestest PHP 8.1 support (#6)
  • enum cases must be below use Traits and above constants in a class (#9), slevomat/coding-standard requires it to be specified

Fully support PHP 8.1

18 Jun 02:19

Choose a tag to compare

Require latest code sniffer and Slevomat's coding standard to fully support PHP 8.1

Opening brace is required before first method

14 Dec 00:37
092dcf6

Choose a tag to compare

Exclude PSR12.Classes.OpeningBraceSpace.Found (#5) because an opening brace is required before first method and the new rule contradicts the existing one.

Trailing comma rules,

27 Nov 18:44
9baec4d

Choose a tag to compare

Add trailing comma rules requiring a trailing comma in the following situations:

  • SlevomatCodingStandard.Arrays.TrailingArrayComma
    This sniff enforces trailing commas in multi-line arrays and requires short array syntax [].

  • SlevomatCodingStandard.Functions.RequireTrailingCommaInCall
    This sniff enforces trailing commas in multi-line calls.

  • SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration
    This sniff enforces trailing commas in multi-line declarations.

No newlines between trait uses

03 Nov 00:56
805c356

Choose a tag to compare

Because types are not specified in docblocks but directly in code, which is even more true with PHP 8 and union types.

Because

class Waldo
{

    use Something;

    use SomethingElse;

    private Foo $foo;
    private Bar $bar;

}

looks better when written like

class Waldo
{

    use Something;
    use SomethingElse;

    private Foo $foo;
    private Bar $bar;

}

Use shorthand scalar typehint variants

27 Sep 00:57

Choose a tag to compare

Use int instead of integer and bool instead of boolean

Adding a few more `use` rules

11 Apr 04:22

Choose a tag to compare

  • TraitUseDeclaration
    Prohibits multiple traits separated by commas in one use statement.

  • UnusedUses
    Looks for unused imports from other namespaces.

  • UselessAlias
    Looks for use alias that is same as unqualified name.