百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

phpcf

> 编程语言
开源

PHP 代码格式化器

180 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

PHP 代码格式化器

phpcf

⚠️ The project is abandoned. Instead of adding support for PHP8+ we have decided to switch to PHP_CodeSniffer. ⚠️

The formatter was created to basically only modify whitespaces, for example line feed, tabs, spaces, etc. It means that phpcf does not replace similar utilities like PHP Code Sniffer (phpcs) or PHP Coding Standards Fixer (http://cs.sensiolabs.org) by Fabien Potencier. The utility supplements others and does all the "dirty work" with whitespace characters. It is worth noting that our utility respects the initial file formatting and only changes whitespace characters that do not follow the chosen ruleset (some utilities remove all whitespace first and reconstruct file from scratch, which is not necessarily what people want).

Our utility is extensible and supports arbitrary style sets. You can define your own formatting style pretty easily to replace Badoo formatting standard that is a bit different from PSR.

Below is a little usage example.

  • "phpcf apply " formats the specified file
  • "phpcf check " checks that formatting is correct and returns non-zero exit code when file is not formatted properly
$ cat minifier.php
 * . etc)   on line 3 column 14
        Expected one space after binary operators (=  * . etc)   on line 3 column 15
        ...

$ echo $?
1

It is worth noting again that phpcf is designed to only change whitespace characters and to do the most simple tasks such as:

  • replacing " "public" replacement or similar we suggest looking at PHP-CS-Fixer. The latter does not really touch whitespace characters but it can do much more sophisticated replacements than our utility.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言