Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

格式化代码 #482

Closed
wants to merge 4 commits into from
Closed

格式化代码 #482

wants to merge 4 commits into from

Conversation

YepYuYu
Copy link
Contributor

@YepYuYu YepYuYu commented Jul 12, 2023

根据项目当前风格,统一代码风格:

  • 遵循 RSR-1 标准
  • 遵循 RSR-2 标准
  • 遵循 RSR-12 标准
  • 简单字符串应该使用单引号代替双引号
  • 禁止存在没用到的use
  • 禁止只有单行空格和分号的写法
  • 禁止结束分号之前的单行空格
  • 禁止多余的分号,如;;;
  • 禁止多余的空白行
  • 禁止代码和注释之间存在空格
  • 禁止空注释
  • 注释中标签垂直对齐
  • 注释和代码保持相同的缩进
  • 命名空间前面不应该有空格
  • 代码相近的赋值操作对齐
  • 数组成员在单个作用域中按最小空间对齐
  • PHPDoc需遵循PSR-5
  • 多行注释对齐
  • 强制转换和变量之间应该有一个空格
  • 连接符号两边必须有一个空格
  • 等号对齐、数字箭头符号对齐
  • 在数组声明中,每个逗号后面必须有一个空格
  • 数组使用简洁语法,方括号语法
  • 数组索引必须是方括号
  • 规定函数中括号的格式
  • class 的 method 之间需要存在一个空行
  • class 的 property 之间需要存在一个空行
  • class 的 const、trait_import、case 不需要空行
  • 命名空间中不得包含空格,注释
  • 如需取消变量,必须使用 (null) 而非 (unset)强制类型转换
  • 尽可能的使用空合并运算法
  • 方法调用的参数每个逗号后必须有一个空格
  • 在数组中,每个逗号之前不得有空格
  • 数组直接解构,不需要使用 list 语法
  • 尽可能使用 null 合并运算法而非三元运算符

@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2023

Codecov Report

Patch coverage: 8.18% and project coverage change: -0.01 ⚠️

Comparison is base (13fd7f2) 12.28% compared to head (422fd03) 12.27%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff              @@
##                3.0     #482      +/-   ##
============================================
- Coverage     12.28%   12.27%   -0.01%     
  Complexity     2960     2960              
============================================
  Files            64       64              
  Lines          7125     7126       +1     
============================================
  Hits            875      875              
- Misses         6250     6251       +1     
Flag Coverage Δ
unittests 12.27% <8.18%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Model.php 0.00% <0.00%> (ø)
src/Paginator.php 0.00% <0.00%> (ø)
src/db/Fetch.php 0.00% <0.00%> (ø)
src/db/Mongo.php 0.00% <0.00%> (ø)
src/db/Query.php 4.48% <0.00%> (ø)
src/db/Raw.php 100.00% <ø> (ø)
src/db/Where.php 0.00% <0.00%> (ø)
src/db/builder/Mongo.php 0.00% <0.00%> (ø)
src/db/builder/Oracle.php 0.00% <0.00%> (ø)
src/db/builder/Pgsql.php 0.00% <0.00%> (ø)
... and 41 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@YepYuYu YepYuYu closed this Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants