定制 mikulas/code-sniffs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mikulas/code-sniffs

最新稳定版本:v1.4.0

Composer 安装命令:

composer require mikulas/code-sniffs

包简介

Code sniffer rules for Clevis coding standard

README 文档

README

Build Status

Annotations

ForceMultipleLinesSniff

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

Disallowed:

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

Allowed:

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

NullFirstSniff

Disallowed:

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

Allowed:

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

SeparateInjectSniff

@inject must not be on same line as @var.

ControlStructures

SeparateBracketsSniff

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

if (...)
{
 	return TRUE;
}

Debug

ClassDebuggerCallSniff

Warn if methods dump, barDump, firelog or timer are called on Debugger class.

DebugFunctionCallSniff

Warn if function d, dd, de, dump, var_dump, error_log, or print_r is called.

Formatting

UseInAlphabeticalOrderSniff

UseWithoutStartingSeparator

Warn on use \Foo\Bar;, suggest use Foo\Bar instead.

MVC

AbstractOrFinalPresenterSniff

Nette Presenter classes must be either abstract or final.

Namespaces

UseDeclarationSniff

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.

Newlines

NamespaceNewlinesSniff

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.

<?php

namespace Foo;

use Bar;


class Quaz {}

UseNewlinesSniff

Use declarations must have no empty newlines in between.

PHP

KeywordCaseSniff

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

UpperCaseBooleanConstantSniff UpperCaseNullConstantSniff

TRUE && FALSE && NULL;

Strings

ConcatenationSpacingSniff

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

Variables

VariableNameSniff

Enforce camelCase and deny leading underscore.

WhiteSpace

CommaSpacingSniff

Ensures there is no whitespaces before and exactly one space after each comma.

ListSpacingSniff

Disallows:

list ($a, $b);

Allows

list($a, $b);

统计信息

  • 总下载量: 1.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固