vierwd/coding-standard 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

vierwd/coding-standard

最新稳定版本:1.3.0

Composer 安装命令:

composer require vierwd/coding-standard

包简介

Coding standard used by FORWARD MEDIA

README 文档

README

Valid example

<?php

namespace Vierwd;

use Namespace\ClassName;

class Bar {

	public function helloWorld($param1, $param2 = '', $param3 = null) {
		for ($i = 0; $i < 10; $i++) {
			echo 'Iteration ' . $i . "\n";
		}

		if (1 < 10) {
			echo 'If-clause';
		} else if ($param1) {
			echo 'Else-clause';
		}
	}
}

Invalid example

<? // Invalid: Short PHP-Open-Tag used

// Invalid: No Namespace

// Invalid: Use with leading Slash
use \Namespace\ClassName;

// Invalid: keywords need to be lowercase
Class Bar
{ // Invalid: Bracket not on same line as class/if/for/foreach/while

	// Invalid: Incorrect naming of function
	// Invalid: Uppercase NULL
	function HelloWorld($param1, $param2 = '', $param3 = NULL)
	{
		for ($i=0; $i < 10; $i++) {
			// Invalid: Double semicolon
			echo 'Iteration ' . $i . "\n";;
		}

		if (1 < 10) {
			// Invalid: Double-Quotes when not needed
			echo "If-clause";
		} elseif ($param1) {
			// Invalid: elseif instead of else if
			echo 'Else-clause';
			// Invalid: Indenting using spaces
        }
 		// Invalid: Indenting mixed with spaces and tab
	}
}

// Invalid: Two classes in a single file
class Baz {
}

// Invalid: Closing PHP Tag at end of file
// Invalid: No trailing space at end of file
?>```

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-26