Skip to content

Add some extra php cs fixer rules#2946

Merged
Crabcyborg merged 3 commits into
masterfrom
add_some_extra_php_cs_fixer_rules
Feb 6, 2026
Merged

Add some extra php cs fixer rules#2946
Crabcyborg merged 3 commits into
masterfrom
add_some_extra_php_cs_fixer_rules

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg commented Feb 6, 2026

This update adds a new dev dependency for https://github.com/kubawerlos/php-cs-fixer-custom-fixers

This update

  • Enforces that $expected is actually the expected value when using assertEquals / assertSame.
  • Enforces use of assertCount.
  • Removes more redundant parentheses.

Summary by CodeRabbit

  • Chores

    • Improved code style and formatting project-wide.
    • Enhanced PHP CS Fixer configuration and added custom fixers plus a development dependency to support them.
  • Tests

    • Standardized PHPUnit assertions across the test suite (expected, actual order) and replaced some count comparisons with dedicated count assertions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

Adds PHP CS Fixer custom fixers and dependency, enables risky fixes in the CI workflow, removes redundant parentheses from boolean expressions across PHPCS sniff files and a helper, and standardizes PHPUnit assertions (expected, actual) and some assertCount usages in tests.

Changes

Cohort / File(s) Summary
PHP CS Fixer config & CI
.github/workflows/php-cs-fixer.yml, .php-cs-fixer.php, composer.json
CI workflow now runs PHP CS Fixer with --allow-risky=yes. Registers and enables custom fixers (PhpUnitAssertArgumentsOrderFixer, PhpUnitDedicatedAssertFixer, NoUselessStrlenFixer, NoUselessParenthesisFixer). Adds kubawerlos/php-cs-fixer-custom-fixers to require-dev.
PHPCS sniff boolean-expression formatting
classes/helpers/FrmAppHelper.php, phpcs-sniffs/Formidable/Sniffs/CodeAnalysis/..., phpcs-sniffs/Formidable/Sniffs/Commenting/..., phpcs-sniffs/Formidable/Sniffs/PHPUnit/PreferAssertStringContainsSniff.php, phpcs-sniffs/Formidable/Sniffs/Security/BreakEchoConcatenationSniff.php
Removed redundant parentheses around boolean/negation expressions in multiple PHPCS sniff files and one helper. Purely stylistic; no logic changes.
PHPUnit tests — assertion ordering & counts
tests/phpunit/base/FrmUnitTest.php, tests/phpunit/database/test_FrmMigrate.php, tests/phpunit/emails/test_FrmEmailSummaryHelper.php, tests/phpunit/entries/test_FrmEntryValidate.php, tests/phpunit/entries/test_FrmTableHTMLGenerator.php, tests/phpunit/fields/test_Frm*.php, tests/phpunit/forms/test_Frm*.php, tests/phpunit/misc/test_Frm*.php
Reordered PHPUnit assertions to (expected, actual) across many tests. Converted some count comparisons to assertCount() where applicable. No production-code changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 I hopped through rules and linting rows,

Trimmed parentheses where the boolean grows.
Tests now say expected before the fact,
Fixers enabled — CI runs them exact.
A tiny hop for code, a tidy little show.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 48.28% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add some extra php cs fixer rules' accurately summarizes the main changes: adding PHP CS Fixer rules via configuration file and composer dependency.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add_some_extra_php_cs_fixer_rules

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Feb 6, 2026

Here's the code health analysis summary for commits 25d113f..ddeaca4. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource PHP LogoPHP❌ Failure
❗ 3 occurences introduced
View Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 26.60%. Comparing base (1d86f87) to head (ddeaca4).
⚠️ Report is 169 commits behind head on master.

Files with missing lines Patch % Lines
classes/helpers/FrmAppHelper.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2946      +/-   ##
============================================
- Coverage     27.07%   26.60%   -0.47%     
- Complexity     8866     8867       +1     
============================================
  Files           145      145              
  Lines         29867    29822      -45     
============================================
- Hits           8085     7934     -151     
- Misses        21782    21888     +106     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Crabcyborg Crabcyborg merged commit 8056528 into master Feb 6, 2026
18 of 22 checks passed
@Crabcyborg Crabcyborg deleted the add_some_extra_php_cs_fixer_rules branch February 6, 2026 14:01
stephywells pushed a commit that referenced this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant