承接 pragmaticweb/php-coding-standards 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

pragmaticweb/php-coding-standards

Composer 安装命令:

composer require pragmaticweb/php-coding-standards

包简介

Style guide for writing consistent PHP code for WordPress projects.

README 文档

README

A project by Pragmatic.

Version 0.0.1 License: GPL 3.0 only

Style guide for writing consistent PHP code for WordPress projects.

Installation

Our PHP coding standards are enforced via php_codesniffer and can be installed using the PHP package manager composer.

$ composer require pragmaticweb/php-coding-standards --dev

Usage

Basic usage

When installed using composer, our coding standards are ready to be used by running:

$ vendor/bin/phpcs --standard="Pragmatic" ./my-plugin ./my-file.php

Configuration file

In order to make it easier to modify our standards to better fit your project, you can create a phpcs.xml.dist file which could contain something like this:

	<?xml version="1.0"?>
	<ruleset name="MyProjectCodingStandard">

		<description>My Project coding standard.</description>

		<file>./my-plugin</file>
		<file>./my-file.php</file>

		<config name="text_domain" value="my-project"/>

		<rule ref="Pragmatic" />

	</ruleset>

Using a config file, allows you to only run vendor/bin/phpcs to check the code style.

For more advanced usage, please refer to the PHP Codesniffer docs.

Included rules

WordPress Coding Standard

We're pretty much using WordPress coding standards at this point with some exclusions (see ruleset.xml).

See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.

PHPcompatibilityWP

It allows to analyse code for compatibility with higher and lower versions of PHP. The default target version is PHP 7.0+.

Target version can be changed via custom phpcs.xml.

See https://github.com/PHPCompatibility/PHPCompatibilityWP

PSR2

See https://github.com/php-fig-rectified/psr2r-sniffer

Contributing

The Pragmatic coding standards is what enables our engineers to work together and write consistent PHP code.

Pull requests are welcome but will need to be reviewed by the members of our team.

Please open an issue first to discuss what you would like to change and, if our team agrees with it, then we could look into merging them.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2020-04-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固