定制 justintime50/phpcs-short-scalar-types 二次开发

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

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

justintime50/phpcs-short-scalar-types

Composer 安装命令:

composer require justintime50/phpcs-short-scalar-types

包简介

PHPCS sniff to enforce short scalar type names in comments (bool, int, etc.)

README 文档

README

Version Licence

A PHPCS sniff to enforce the use of short scalar type names (bool, int, etc) in comments, instead of long names (boolean, integer, etc).

Install

# Install Sniff
composer require --dev justintime50/phpcs-short-scalar-types

# Allow PHPCS to find Sniff (or use https://github.com/PHPCSStandards/composer-installer)
vendor/bin/phpcs --config-set installed_paths vendor/justintime50/phpcs-short-scalar-types/ShortTypes

Usage

Add to your phpcs.xml:

<rule ref="ShortTypes.Commenting.ShortScalarTypes" />

Run PHPCS as usual. Use --fix to auto-correct long forms in comments.

Example

// @var boolean $flag  // Error: Use "bool" instead of "boolean".
// @var bool $flag     // OK

Development

To have PHPCS pick up the local copy of this sniff, you'll need to adjust the installed paths like so:

# Set config
vendor/bin/phpcs --config-set installed_paths "$(pwd)/ShortTypes"

# Confirm ShortTypes is now available
vendor/bin/phpcs -i

Testing

# Run sniff test
composer test

# Run autofix test
composer fix

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固