Skip to content

Refactoring formatter#646

Merged
MauricioFauth merged 4 commits intophpmyadmin:masterfrom
kamil-tekiela:Refactoring-Formatter
Apr 10, 2026
Merged

Refactoring formatter#646
MauricioFauth merged 4 commits intophpmyadmin:masterfrom
kamil-tekiela:Refactoring-Formatter

Conversation

@kamil-tekiela
Copy link
Copy Markdown
Contributor

These PR adds DTO for formatting options. In this repo, it seems that only type is ever provided. In the main repo only

$this->response->addJSON(['sql' => Formatter::format($query, ['line_ending' => ' ', 'indentation' => ''])]);

This PR removes the ability to provide custom formats. I don't know if any other project relies on it and I can add it back, but I removed it to make the code simpler. I think it would be better to keep that option even if it's not used in PMA, but please let me know which is better.

The options parts_newline and indent_parts were removed as I could not see them being used anywhere.

@kamil-tekiela kamil-tekiela force-pushed the Refactoring-Formatter branch from f50d615 to bfd9445 Compare March 5, 2026 14:25
Copy link
Copy Markdown
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this create a breaking change?

@kamil-tekiela
Copy link
Copy Markdown
Contributor Author

Does this create a breaking change?

Yes

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
@kamil-tekiela kamil-tekiela force-pushed the Refactoring-Formatter branch from d847709 to 6bc115d Compare April 4, 2026 17:28
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.30%. Comparing base (5be4eed) to head (6bc115d).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #646      +/-   ##
============================================
- Coverage     96.33%   96.30%   -0.04%     
+ Complexity     2264     2253      -11     
============================================
  Files            89       90       +1     
  Lines          5026     4982      -44     
============================================
- Hits           4842     4798      -44     
  Misses          184      184              
Flag Coverage Δ
unit-8.2-ubuntu-latest 96.30% <100.00%> (-0.04%) ⬇️
unit-8.3-ubuntu-latest 96.30% <100.00%> (-0.04%) ⬇️
unit-8.4-ubuntu-latest 96.30% <100.00%> (-0.04%) ⬇️
unit-8.5-ubuntu-latest 96.30% <100.00%> (-0.04%) ⬇️

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

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

@williamdes williamdes requested a review from MauricioFauth April 9, 2026 09:27
Copy link
Copy Markdown
Member

@MauricioFauth MauricioFauth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@MauricioFauth MauricioFauth merged commit f440917 into phpmyadmin:master Apr 10, 2026
13 of 14 checks passed
@MauricioFauth MauricioFauth self-assigned this Apr 10, 2026
@kamil-tekiela kamil-tekiela deleted the Refactoring-Formatter branch April 10, 2026 20:17
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.

3 participants