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

Code Sniffer Laravel Package

php-collective/code-sniffer

PHP CodeSniffer rulesets from PhpCollective: PSR-2 compliant with many extra sniffs/fixers (incl. PSR-12) plus a stricter PhpCollectiveStrict standard. Install via Composer, configure phpcs.xml, run phpcs/phpcbf to check and auto-fix code style.

View on GitHub
Deep Wiki
Context7
0.6.2

Improvements

  • Cache class name resolution and skip redundant return-type body scans (#62)
  • O(1) conditions checks + cached arrow-function scopes in ConsistentIndentSniff (#63)
  • Cache UseStatementsTrait::getUseStatements and bound the throw class-name lookup to the current statement (#64)
  • Cache docblock FQCN lookups (parseUseStatements / getNamespace) and dedupe per-doc-block processing (#65)
  • Cache UseStatementSniff::getUseStatements across phpcbf fix iterations (#66)

Combined, these cut composer cs-check wall-clock time roughly in half on large method-heavy codebases. On an 11k-line CakePHP controller the slowest single file went from ~40s to ~6s; on a 1095-file project the whole-codebase scan dropped from ~2m08s to ~30s with parallel=16.

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.6.1...0.6.2

0.6.1

Improvements

  • Extend DocBlockTagOrder to class, interface, and trait docblocks with a new configurable classOrder property (#59)
  • Add opt-in inner-bucket ordering to DocBlockTagOrder via a new innerOrder property and separate InnerOrderInvalid error code, so inner ordering can be enabled and scoped independently of bucket ordering (#60)

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.6.0...0.6.1

0.6.0

Fixes

  • Fix DocBlockParamAllowDefaultValueSniff positional mismatch on partial [@param](https://github.com/param) lists, which could cause an infinite fixer loop with DocBlockParamTypeMismatchSniff (#58)

Improvements

  • Replace internal sniffs with their PHPCSExtra Universal equivalents (supersets): PhpCollective.ControlStructures.DisallowAlternativeControlStructuresUniversal.ControlStructures.DisallowAlternativeSyntax, PhpCollective.WhiteSpace.CommaSpacingUniversal.WhiteSpace.CommaSpacing (#55)
  • Add additional Universal sniffs to the ruleset (#54)
  • Add Universal attribute and whitespace sniffs (#56)
  • Disallow partial uses in ReferenceUsedNamesOnly (#57)

Migration

Partial namespace references (e.g. Mockery\MockInterface when only Mockery is imported) are now flagged and must be imported via a full use statement. To keep the previous behavior, override the property in your project's phpcs.xml:

<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
    <properties>
        <property name="allowPartialUses" value="true"/>
    </properties>
</rule>

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.5.5...0.6.0

0.5.5

Fixes

  • Fix docblock indentation loss when EmptyEnclosingLine sniff interacted with DisallowTabIndent (#52)
  • Fix InlineDocBlockSniff for abstract/interface methods - skip methods without body (#51)
  • Fix NoIsNullSniff calling wrong method for trailing comparisons (#49)
  • Fix EnumCaseCasingSniff multibyte support with proper mb_strtoupper() (#49)

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.5.4...0.5.5

0.5.4

Features

  • DocBlockReturnVoidSniff: Add optional checkReturnTypeHint property to detect invalid : void return type hints on magic methods (__construct, __destruct, __clone)

Fixes

  • DocBlockReturnVoidSniff: Fix hasReturnType() to properly detect return type declarations on interface and abstract methods. Previously, methods with return types but no body (e.g., public function foo(): string;) incorrectly triggered ReturnMissingInInterface errors.

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.5.3...0.5.4

0.5.3

Improvements

UseStatementSniff Enhancements

  • PHP 8+ Attribute Support: FQCNs in attributes are now detected and auto-fixed

    // Before
    #[\Foo\Bar\SomeAttribute]
    class MyClass {}
    
    // After
    use Foo\Bar\SomeAttribute;
    
    #[SomeAttribute]
    class MyClass {}
    
  • PHP 8.1+ Enum Support: Enum implements clauses are now handled

    // Before
    enum Status: string implements \Foo\Bar\SomeInterface {}
    
    // After
    use Foo\Bar\SomeInterface;
    
    enum Status: string implements SomeInterface {}
    

Notes

Only fully qualified names (starting with \) are auto-fixed. Partially qualified names (e.g., Foo\Bar without leading \) are intentionally not auto-fixed right now.

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.5.2...0.5.3

0.5.2

New

Fixes

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.5.1...0.5.2

0.5.1

Fixes

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.5.0...0.5.1

0.5.0

Improvements

The attribute usage is now the same as class usage. This seems to make sense moving forward and to not clash with other sniffer packages - and triggers now the major.

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.4.6...0.5.0

0.4.6

Fixes

  • Fixed use statement sniff regressions

Improvements

  • Added ConsistentIndentSniff
0.4.5

Improvements

  • Added auto fixing to FQCN attribute sniff.
0.4.4

Improvements

  • Added PhpCollective.ControlStructures.ControlSignature sniff

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.4.3...0.4.4

0.4.3

Improvements

  • Aded PhpCollective.ControlStructures.UnneededElse

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.4.2...0.4.3

0.4.2

Fixes

  • Fix up do while loops.
0.4.1

Fixes

  • Add missing sniff ControlStructureEmptyStatement
0.4.0

Improvements

  • Use "squizlabs/php_codesniffer": "^4.0.0" now.
0.3.1

Improvements

  • Improved PhpCollective/Sniffs/Commenting/DocBlockParamSniff to handle params better. Only require them once they are needed (missing type on a param or a random param defined already that cannot be removed).
0.3.0

What's Changed

  • Add more useful sniffs:
    • NormalizedArrays.Arrays.ArrayBraceSpacing
    • Modernize.FunctionCalls.Dirname
    • Generic.Arrays.ArrayIndent
    • Universal.Constants.LowercaseClassResolutionKeyword
    • Universal.Constants.UppercaseMagicConstants
    • Universal.Operators.ConcatPosition
    • Universal.UseStatements.NoUselessAliases
    • Universal.WhiteSpace.PrecisionAlignment
  • ArrayDeclarationSniff has now the ability to format nested arrays, use none/assoc/all (default assoc).

This package now also includes phpcsstandards/phpcsextra dependency for even better sniff experience.

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.2.21...0.3.0

0.2.21

Fixes

  • Fix false positive in DocBlockVarSniff for class aliases.
0.2.20
0.2.19

Fixes

  • Fix DocBlockVarSniff false positives
  • Don't require docblocks for fully typed methods
0.2.18

Fixes

  • Don't require docblock annotations for typed properties/variables.
0.2.17

Fixes

  • Fixed comma spacing sniff
0.2.16

Fixes

  • Fixed up compatibility with latest SlevomatCodingStandard release
0.2.15

Fixes

  • Removed more deprecation usage.
0.2.14

Fixes

  • Fixed up deprecation
0.2.13

Fixes

  • Fixed DocBlockThrow sniff
0.2.12

Improvements

Also added

  • SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing
  • SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment
  • SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses
  • Squiz.PHP.DisallowSizeFunctionsInLoops

Support for Slevomat V8.16 included.

0.2.11

Fixes

  • Fixed property replacement to FQCN for FullyQualifiedClassNameInDocBlock sniff
0.2.10

Fixes

  • Fixed DocBlockParamAllowDefaultValueSniff for PHP 8 language features
0.2.9

Fixes

  • Removed debugging statement.
0.2.8

Fixes

  • Fixed array collection to generics transformation in [@property](https://github.com/property) annotations.

Improvements

  • Added sniff PhpCollective.Commenting.DisallowShorthandNullableTypeHint to replace Nullable ? in docblocks with |null verbosely.

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.2.7...0.2.8

0.2.7

Improvements

  • Added missing SlevomatCodingStandard.Arrays.ArrayAccess sniff
0.2.6

Improvements

  • Added PSR4 namespace check for classes, traits, interfaces. It uses the composer autoload sections to compare this to the namespaces defined in each PHP class.

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.2.5...0.2.6

0.2.5

Improvements

  • Add enum case casing sniff

Full Changelog: https://github.com/php-collective/code-sniffer/compare/0.2.4...0.2.5

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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope