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

update WPCS to v3.0 with minor code style tweaks #276

Closed
wants to merge 4 commits into from

Conversation

stklcode
Copy link
Contributor

@stklcode stklcode commented Nov 9, 2023

  • update WPCS definitions to v3.0
  • use printf() instead of echo sprintf()
  • use __DIR__ instead of dirname( __FILE__ )
  • remove unused parameter and inconsistend return value from track_visit()

@stklcode stklcode self-assigned this Nov 9, 2023
@stklcode stklcode added this to the 2.0.0 milestone Nov 9, 2023
Copy link

sonarqubecloud bot commented Nov 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@stklcode
Copy link
Contributor Author

Apparently this was already done in b2abe7a and the only remaining change is superseded by #286. Closing this PR.

@stklcode stklcode closed this Mar 14, 2024
@stklcode stklcode deleted the update-wpcs branch March 14, 2024 16:40
@lloc
Copy link

lloc commented Mar 14, 2024

  • use printf() instead of echo sprintf()

Is there an advantage to using echo sprint() over printf()?

@stklcode
Copy link
Contributor Author

stklcode commented Mar 14, 2024

No, there is no benefit in generating a formatted string and echoing the output immediately.

There is a marginal difference from the outside:

  • echo sprintf(...) has no return value
  • printf(...) returns the output length (we don't use it)

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.

2 participants