Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Coding Standard Laravel Package

spaze/coding-standard

spaze/coding-standard provides PHP_CodeSniffer rule sets to enforce consistent PHP coding style and quality across projects. Install via Composer as a dev dependency and run PHPCS with the included standards; CI workflows validate XML and rules.

View on GitHub
Deep Wiki
Context7
v1.9.1
  • Replace PSR12.Files.FileHeader.SpacingAfterBlock with all the new modular rules, previously, just some were excluded (#31)
v1.9.0

Support and requires PHP_CodeSniffer 4.0 (#29, #30)

v1.8.1
  • Require recent-ish slevomat/coding-standard (#27)
v1.8.0

Checks for missing constant typehints (#26) docs

v1.7.2
  • Allow tabs in nowdoc and heredoc (#25)
v1.7.1
  • Bump actions/checkout from 3 to 4 (#23)
  • Don't set installed_paths config in ruleset file (#24)
v1.7.0

Report useless:

v1.5.0
  • Disallow duplicate whitespaces (#18)

Internal changes:

  • Check rules are sorted (#19)
  • Export-ignore files that are not needed (#20)
v1.4.0
  • Requires slevomat/coding-standard 8.9+
  • Added new rules:
    • Disallow variable variables (#14)
    • Disallow trailing multiline ternary operator (#15)
    • Yoda comparison disallow you must (#16)
  • XML-lint the rules file (#17)
v1.3.1
  • 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)
v1.2.0

Requires slevomat/coding-standard 8.1 (#11)

v1.1.0
  • 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
v1.0.0

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

v0.0.13

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

v0.0.12

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.

v0.0.11

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;

}
v0.0.10

Use int instead of integer and bool instead of boolean

v0.0.8
  • 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.

v0.0.7

slevomat/coding-standard 7.0.0 renames some DeclareStrictTypes options and changes their meaning: previously newlines were counted, now just lines are counted. Where there was one newline between the opening tag and the declare statement, there's now no line (but still one newline).

v0.0.6

Add rule to check order of classes structure, i.e. use first, then constants, properties, abstract methods, constructor, other methods.

v0.0.5
v0.0.4

Can now be used for PHP 8 projects too (#1, thanks @xificurk)

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor