Skip to content

Commit 36801c3

Browse files
committed
+ first commit
0 parents  commit 36801c3

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.phpfmt.ini

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
; PSR 代码规范请参考: http://www.php-fig.org/
2+
3+
; 应用 Cakephp 的代码风格
4+
; cakephp = 0
5+
6+
; 自动分析类的属性并生成构造方法
7+
; 可选择 camel/snak/golang 三种风格的构造方法
8+
; constructor = camel
9+
10+
; 自动分析类的属性并生成 set/get 方法
11+
; 可选择 camel/snak/golang 三种风格的方法命名
12+
; setters_and_getters = camel
13+
14+
; 试运行
15+
; Runs the formatter without atually changing files
16+
; returns exit code 1 if changes would have been applied
17+
; dry-run = 1
18+
19+
; 允许自动对齐
20+
enable_auto_align = 1
21+
22+
; 忽略指定的 passes 类型
23+
; exclude=pass1,passN,...
24+
25+
; 忽略代码修正的文件名,可使用通配符
26+
; ignore =
27+
28+
; 使用指定 size 的空格替换 tab
29+
indent_with_space = 4
30+
31+
; 格式化前先检查 php 文件的语法是否有错误 (该功能不太好用,不建议打开)
32+
; lint-before = 1
33+
34+
; 不生成 .php~ 格式的备份文件
35+
no-backup = 1
36+
37+
; 激活 PSR1 风格
38+
psr1 = 1
39+
40+
; 激活 PSR1 风格的 3/4.3 部分 - 类和方法名称的大小写(该功能会将函数转成驼峰式命名,不建议打开)
41+
; psr1-naming = 1
42+
43+
; 激活 PSR2 风格
44+
psr2 = 1
45+
46+
; 将单行语法智能切换为多行
47+
; 例如将 if ($a) echo 'a';
48+
; 替换为带换行的 if ($a) { echo 'a'; }
49+
smart_linebreak_after_curly = 1
50+
51+
; 修复类中方法的可见性顺序 - PSR-2 4.2
52+
visibility_order = 1
53+
54+
; yoda-style 风格修正 ($a == null) 替换成 (null == $a)
55+
; yoda = 0
56+
57+
; 需要执行的代码修正命令
58+
passes = WrongConstructorName,ReplaceBooleanAndOr,EliminateDuplicatedEmptyLines,RTrim,RestoreComments,UpgradeToPreg,IndentTernaryConditions,StripSpaceWithinControlStructures,StripExtraCommaInList,PrettyPrintDocBlocks,SpaceBetweenMethods,NoSpaceAfterPHPDocBlocks,ShortArray,DoubleToSingleQuote,LeftAlignComment,IndentTernaryConditions,AlignDoubleSlashComments,RemoveUseLeadingSlash,MergeElseIf,ClassToSelf,ClassToStatic,Reindent,ReindentEqual,ReindentObjOps,ReindentComments,ReindentAndAlignObjOps,ReindentSwitchBlocks,ReindentColonBlocks,PSR1OpenTags,PSR1ClassNames,PSR1ClassConstants,PSR1BOMMark,PSR2AlignObjOp,PSR2EmptyFunction,PSR2CurlyOpenNextLine,PSR2LnAfterNamespace,PSR2KeywordsLowerCase,PSR2IndentWithSpace,PSR2SingleEmptyLineAndStripClosingTag,PSR2ModifierVisibilityStaticOrder,NormalizeLnAndLtrimLines

fmt.phar

342 KB
Binary file not shown.

0 commit comments

Comments
 (0)