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

Runs phpcbf #1730

Closed
wants to merge 5 commits into from
Closed

Runs phpcbf #1730

wants to merge 5 commits into from

Conversation

datengraben
Copy link
Contributor

Supersedes #1693

Preparation for #1687

Following command was used: /usr/bin/php8.2 ./vendor/bin/phpcbf src templates includes -q
* And document it
@datengraben datengraben requested a review from hansmorb January 11, 2025 13:03
@datengraben datengraben added the dx Developer Experience (technical) label Jan 11, 2025
@datengraben datengraben added this to the 2.10.2 milestone Jan 11, 2025
@datengraben
Copy link
Contributor Author

datengraben commented Jan 11, 2025

@hansmorb nachdem wir jetzt die dringenden PRs (mit viel Code-Änderungen) gemerged haben, habe ich diesen PR erneuert.

@datengraben datengraben mentioned this pull request Jan 11, 2025
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 48.88476% with 1650 lines in your changes missing coverage. Please review.

Project coverage is 53.61%. Comparing base (7e01486) to head (71035fa).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/Wordpress/CustomPostType/Location.php 1.38% 213 Missing ⚠️
src/View/BookingCodes.php 29.65% 185 Missing ⚠️
src/Wordpress/CustomPostType/Timeframe.php 35.41% 155 Missing ⚠️
src/Wordpress/CustomPostType/Booking.php 24.32% 112 Missing ⚠️
src/Service/iCalendar.php 30.18% 74 Missing ⚠️
src/Service/Cache.php 26.92% 57 Missing ⚠️
src/Plugin.php 18.84% 56 Missing ⚠️
src/Wordpress/CustomPostType/Item.php 3.44% 56 Missing ⚠️
src/Wordpress/CustomPostType/Restriction.php 3.57% 54 Missing ⚠️
src/Wordpress/CustomPostType/CustomPostType.php 32.91% 53 Missing ⚠️
... and 61 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1730      +/-   ##
============================================
- Coverage     54.08%   53.61%   -0.48%     
  Complexity     2628     2628              
============================================
  Files            98       98              
  Lines         11655    12122     +467     
============================================
+ Hits           6304     6499     +195     
- Misses         5351     5623     +272     

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

@hansmorb
Copy link
Contributor

Das sind die gleichen Styles wie die, die in PHPStorm durch die .editorconfig definiert sind, oder? Also da kommt das gleiche raus wie wenn ich in PHPStorm Strg+L auf jeder Datei drücken würde, oder?

@datengraben
Copy link
Contributor Author

Das sind die gleichen Styles wie die, die in PHPStorm durch die .editorconfig definiert sind, oder?
Also da kommt das gleiche raus wie wenn ich in PHPStorm Strg+L auf jeder Datei drücken würde, oder?

Nein phpcbf ist der "PHP Code Beautifier and Fixer". Der ist erstmal losgelöst von deiner IDE. Du kannst ihn aber in deiner IDE, z.B. PHPStorm einbinden. Ich weiß aber nicht ob das Strg+L ist, kann gut sein.

Auch nutzt phpcbf die Konfiguration der .editorconfig nicht bzw. bezieht sich nicht auf sie, sondern nur die Styles definiert in der phpcs.xml. Ich persönlich finde die PHPStorm/ij_* spezifische Definition in der sonst eigentlich recht offen standardisierten .editorconfig etwas überflüssig. Für mich sollte die .editorconfig minimal verfasst (also mit den IDE-unspezifischen Werten gefüllt sein). Das Code-Formatting läuft dann über die externen Tools, wir können ja nicht erwarten das jeder ein Intellij-Produkt/PHP-Storm verwendet. Und es die spezfischen Regeln im editorconfig plus die Regeln im phpcbf redundant zu pflegen, fände ich etwas umständlich.

Zum Beispiel hier im polylang Plugin:
https://github.com/polylang/polylang/blob/master/.editorconfig
https://github.com/polylang/polylang/blob/master/phpcs.xml.dist

@datengraben datengraben modified the milestones: 2.10.2, 2.10.3 Jan 14, 2025
@datengraben
Copy link
Contributor Author

@hansmorb leider hat der auch ein paar Vorkommen von current_time/time verändert (z.B. #1390) , hier muss ich nochmal drüberschauen welche Sniffs wir doch lieber ausschalten, solange #1388 noch offen ist.

@hansmorb hansmorb removed this from the 2.10.3 milestone Jan 28, 2025
@datengraben
Copy link
Contributor Author

@hansmorb die Verwendung von current_time war korrekterweise korrigiert, deren Verwendung mit timestamp-Argument ist discouraged.

https://developer.wordpress.org/reference/functions/current_time/

Copy link

github-actions bot commented Feb 3, 2025

@datengraben datengraben mentioned this pull request Feb 5, 2025
@datengraben
Copy link
Contributor Author

Close in favor of #1750

@datengraben datengraben closed this Feb 5, 2025
@datengraben datengraben deleted the datengraben/apply-phpcbf branch February 5, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx Developer Experience (technical)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants