Architecture

The following insights are in organised in differents metrics :

  • NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Classes Architecture\Classes
  • NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Composer Architecture\Composer
  • NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Constants Architecture\Constants
  • NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Files Architecture\Files
  • NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Functions Architecture\Functions
  • NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Interfaces Architecture\Interfaces
  • NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Namespaces Architecture\Namespaces
  • NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Traits Architecture\Traits

Forbidden normal classes ^1.0 Architecture\Classes

This insight disallow usage of normal class. Class must be abstract or final.

Insight Class: NunoMaduro\PhpInsights\Domain\Insights\ForbiddenNormalClasses

Valid class name ^1.0 Architecture\Classes

This sniff ensures classes are in camel caps, and the first letter is capitalised.

Insight Class: PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff

Class declaration ^1.0 Architecture\Classes

This sniff checks if the declaration of the class is correct

Insight Class: PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff

Class trait and interface length ^1.0 Architecture\Classes configurable

This sniff checks the size of your classes/traits/interface

Insight Class: ObjectCalisthenics\Sniffs\Files\ClassTraitAndInterfaceLengthSniff

Configuration
\ObjectCalisthenics\Sniffs\Files\ClassTraitAndInterfaceLengthSniff::class => [
    'maxLength' => 200,
]

Method per class limit ^1.0 Architecture\Classes configurable

This sniff checks if the number of method per class is under a limit.

Insight Class: ObjectCalisthenics\Sniffs\Metrics\MethodPerClassLimitSniff

Configuration
\ObjectCalisthenics\Sniffs\Metrics\MethodPerClassLimitSniff::class => [
    'maxCount' => 10,
]

Property per class limit ^1.0 Architecture\Classes configurable

This sniff checks if the number of property per class is under a limit.

Insight Class: ObjectCalisthenics\Sniffs\Metrics\PropertyPerClassLimitSniff

Configuration
\ObjectCalisthenics\Sniffs\Metrics\PropertyPerClassLimitSniff::class => [
    'maxCount' => 10,
]

One class per file ^1.0 Architecture\Classes

This sniff checks that only one class is declared per file.

Insight Class: PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff

Superfluous interface naming ^1.0 Architecture\Classes

This sniff reports use of superfluous prefix or suffix "Interface" for interfaces.

Insight Class: SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff

Superfluous abstract class naming ^1.0 Architecture\Classes

This sniff reports use of superfluous prefix or suffix "Abstract" for abstract class.

Insight Class: SlevomatCodingStandard\Sniffs\Classes\SuperfluousAbstractClassNamingSniff

composer.json must exist ^1.0 Architecture\Composer

This insight verifies there is composer.json.

Insight Class: NunoMaduro\PhpInsights\Domain\Insights\Composer\ComposerMustExist

The name property in the composer.json ^1.0 Architecture\Composer

This insight checks if the name section in composer.json don't contains default values (e.g. laravel/laravel or symfony/symfony).

Insight Class: NunoMaduro\PhpInsights\Domain\Insights\Composer\ComposerMustContainName

Composer.json must be valid ^1.7 Architecture\Composer

This insight checks if the composer.json is valid.

Insight Class: NunoMaduro\PhpInsights\Domain\Insights\Composer\ComposerMustBeValid

Composer.lock must be fresh ^1.7 Architecture\Composer

This insight verifies that the composer.lock is not outdated.

Insight Class: NunoMaduro\PhpInsights\Domain\Insights\Composer\ComposerLockMustBeFresh

Define globals is prohibited ^1.0 Architecture\Constants

This insight disallow defining globals.

Insight Class: NunoMaduro\PhpInsights\Domain\Insights\ForbiddenDefineGlobalConstants

Superfluous Exception Naming ^1.0 Architecture\Files

This sniff reports use of superfluous prefix or suffix "Exception" for exceptions.

Insight Class: SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff

Function length ^1.0 Architecture\Functions configurable

This sniff checks size of functions

Insight Class: ObjectCalisthenics\Sniffs\Files\FunctionLengthSniff

Configuration
\ObjectCalisthenics\Sniffs\Files\FunctionLengthSniff::class => [
    'maxLength' => 20,
]

One interface per file ^1.0 Architecture\Interfaces

This sniff checks that only one interface is declared per file.

Insight Class: PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneInterfacePerFileSniff

Namespace declaration ^1.0 Architecture\Namespaces

This sniff enforces one space after namespace, disallows content between namespace name and semicolon and disallows use of bracketed syntax.

Insight Class: SlevomatCodingStandard\Sniffs\Namespaces\NamespaceDeclarationSniff

Useless Alias ^1.0 Architecture\Namespaces

This sniff looks for use alias that is same as unqualified name.

Insight Class: SlevomatCodingStandard\Sniffs\Namespaces\UselessAliasSniff

Compound namespace depth ^1.0 Architecture\Namespaces

This sniff verifies that compound namespaces are not defined too deep.

Insight Class: PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces\CompoundNamespaceDepthSniff

Forbidden traits ^1.0 Architecture\Traits

This insight disallow traits usage.

Insight Class: NunoMaduro\PhpInsights\Domain\Insights\ForbiddenTraits

One trait per file ^1.0 Architecture\Traits

This sniff checks that only one trait is declared per file

Insight Class: PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneTraitPerFileSniff

Superfluous trait naming ^1.0 Architecture\Traits

This sniff reports use of superfluous prefix or suffix "Trait" for traits.

Insight Class: SlevomatCodingStandard\Sniffs\Classes\SuperfluousTraitNamingSniff