2017 © Pedro Peláez
 

library code-sniffs

Code sniffer rules for Clevis coding standard

image

mikulas/code-sniffs

Code sniffer rules for Clevis coding standard

  • Wednesday, October 15, 2014
  • by Mikulas
  • Repository
  • 2 Watchers
  • 3 Stars
  • 1,224 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Custom CodeSniffer rules

Build Status, (*1)

Annotations

ForceMultipleLinesSniff, (*2)

Warn if phpdoc is single line (unless its on variable), (*3)

Disallowed:, (*4)

/** @property-read $bar */
class Foo
{
    /** @var Bar */
    public $bar;
}

Allowed:, (*5)

/**
 * @property-read $bar
 */
class Foo
{
    /**
     * @var Bar
     */
    public $bar;
}

NullFirstSniff, (*6)

Disallowed:, (*7)

/** @property-read Foo|NULL $bar */

Allowed:, (*8)

/** @property-read NULL|Foo $bar */

SeparateInjectSniff, (*9)

@inject must not be on same line as @var., (*10)

ControlStructures

SeparateBracketsSniff, (*11)

force newline before opening curly bracket of if, else, elseif, foreach and for blocks:, (*12)

if (...)
{
    return TRUE;
}

Debug

ClassDebuggerCallSniff, (*13)

Warn if methods dump, barDump, firelog or timer are called on Debugger class., (*14)

DebugFunctionCallSniff, (*15)

Warn if function d, dd, de, dump, var_dump, error_log, or print_r is called., (*16)

Formatting

UseInAlphabeticalOrderSniff, (*17)

UseWithoutStartingSeparator, (*18)

Warn on use \Foo\Bar;, suggest use Foo\Bar instead., (*19)

MVC

AbstractOrFinalPresenterSniff, (*20)

Nette Presenter classes must be either abstract or final., (*21)

Namespaces

UseDeclarationSniff, (*22)

Use declarations must be right after namespace declaration, separated by exactly one empty line. There must be exactly one use per declaration. There must be exactly two empty lines after last use declaration., (*23)

Newlines

NamespaceNewlinesSniff, (*24)

Namespace declaration must be directly under php opening tag, separated by exactly one empty line. There must be exactly one empty line between namespace declaration and first use declaration. If no use declaration follows, there must be two lines after namespace declaration., (*25)

<?php

namespace Foo;

use Bar;


class Quaz {}

UseNewlinesSniff, (*26)

Use declarations must have no empty newlines in between., (*27)

PHP

KeywordCaseSniff, (*28)

Checks that all constructs but logical operators are lowercase. (e.g.: foreach instead of ForEach), (*29)

UpperCaseBooleanConstantSniff UpperCaseNullConstantSniff, (*30)

TRUE && FALSE && NULL;

Strings

ConcatenationSpacingSniff, (*31)

Concatenation operator (.) must be separated by exacly one space on both sides., (*32)

Variables

VariableNameSniff, (*33)

Enforce camelCase and deny leading underscore., (*34)

WhiteSpace

CommaSpacingSniff, (*35)

Ensures there is no whitespaces before and exactly one space after each comma., (*36)

ListSpacingSniff, (*37)

Disallows:, (*38)

list ($a, $b);

Allows, (*39)

list($a, $b);

The Versions

15/10 2014

dev-master

9999999-dev

Code sniffer rules for Clevis coding standard

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mikuláš Dítě

15/10 2014

v1.4.0

1.4.0.0

Code sniffer rules for Clevis coding standard

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mikuláš Dítě

11/07 2014

v1.3.1

1.3.1.0

Code sniffer rules for Clevis coding standard

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mikuláš Dítě

11/07 2014

v1.3.0

1.3.0.0

Code sniffer rules for Clevis coding standard

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mikuláš Dítě

11/07 2014

v1.2.0

1.2.0.0

Code sniffer rules for Clevis coding standard

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mikuláš Dítě

07/07 2014

v1.1.1

1.1.1.0

Code sniffer rules for Clevis coding standard

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mikuláš Dítě

25/06 2014

v1.1.0

1.1.0.0

Code sniffer rules for Clevis coding standard

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mikuláš Dítě

23/06 2014

v1.0.0

1.0.0.0

Code sniffer rules for Clevis coding standard

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Mikuláš Dítě