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

Replaced short array syntax usages with traditional array syntax #411

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

aik099
Copy link
Member

@aik099 aik099 commented Jan 20, 2025

The short array syntax was accidentally introduced in the #407.

If there is a need, then we can mass-convert driver code to use short array syntax (e.g. using PHP_CodeSniffer rule or PhpStorm inspection).

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.07%. Comparing base (2cd7d77) to head (efb7309).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #411   +/-   ##
=========================================
  Coverage     86.07%   86.07%           
  Complexity      184      184           
=========================================
  Files             1        1           
  Lines           510      510           
=========================================
  Hits            439      439           
  Misses           71       71           

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

@aik099 aik099 requested a review from uuf6429 January 20, 2025 08:14
Copy link
Member

@uuf6429 uuf6429 left a comment

Choose a reason for hiding this comment

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

I'm not a fan of this change since:

  • in my eyes, it's a downgrade
  • it still isn't the proper way of telling devs what kind of coding style is allowed
  • it would have been automated and more future-proof if done through PHP-CS-Fixer (or similar)

In practices, since it's harmless, I'm fine with approving it.

@aik099
Copy link
Member Author

aik099 commented Jan 20, 2025

  • in my eyes, it's a downgrade

Syntax is syntax. Use whichever that works but be consistent throughout the codebase. This wasn't the case, hence this PR.

Anyway this PR is a transient step (as I've probably mentioned elsewhere) to keep syntax consistent. In another PR you can perform system-wide (driver code & driver tests) syntax change to short array declaration (you can use tools shown in the PR description).

  • it still isn't the proper way of telling devs what kind of coding style is allowed
  • it would have been automated and more future-proof if done through PHP-CS-Fixer (or similar)

Completely agree. I'm open to suggestions. Please create an issue where we can discuss our options. We can later apply same concepts to the mink/webdriver-classic-driver as well.

In an ideal world:

  • use a consistent code style across the codebase
  • stick to a coding standard (the PSR2 is used currently)
  • use a more strict coding standard
  • fail the build when PR code doesn't follow the standard

What we have now:

  • the PSR2 standard doesn't care about array declarations
  • coding style isn't automatically checked for PRs

.

@aik099 aik099 merged commit 345f695 into minkphp:master Jan 20, 2025
13 checks passed
@aik099 aik099 deleted the short-array-syntax-fix branch January 20, 2025 13:04
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.

2 participants