Convert Behat annotations to PHP attributes in UI contexts#18843
Convert Behat annotations to PHP attributes in UI contexts#18843TheMilek merged 1 commit intoSylius:2.3from
Conversation
📝 WalkthroughWalkthroughThis PR converts Behat step docblock annotations ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Sylius/Behat/Context/Ui/BrowserContext.php`:
- Around line 16-17: The two PHP import lines are not alphabetized: move "use
Behat\Behat\Context\Context;" above "use Behat\Step\When;" so the imports are in
alphabetical order; update the use statements in BrowserContext.php to list
Behat\Behat\Context\Context before Behat\Step\When (ensure no other import order
is disturbed).
In `@src/Sylius/Behat/Context/Ui/ChannelContext.php`:
- Around line 16-18: Reorder the PHP use imports in ChannelContext so they
follow the project's alphabetical ordering and the guideline that
Behat\Behat\Context\Context comes before Behat\Step imports: replace the current
block (using Behat\Step\When; use Behat\Step\Then; use
Behat\Behat\Context\Context;) with use Behat\Behat\Context\Context first, then
use Behat\Step\Then and finally use Behat\Step\When; mirror the same ordering
fix applied in ThemeContext and UserContext.
In `@src/Sylius/Behat/Context/Ui/CustomerContext.php`:
- Around line 16-17: The new import use Behat\Step\Then is out of alphabetical
order; reorder the use statements so PHP imports are alphabetized (e.g., ensure
Behat\Behat\Context\Context and Behat\Mink\Exception\ElementNotFoundException
come before Behat\Step\Then), updating the use block in CustomerContext.php so
all Behat-related use lines are sorted lexicographically.
In `@src/Sylius/Behat/Context/Ui/EmailContext.php`:
- Around line 16-17: Reorder the PHP use imports so they are alphabetized: move
the import "use Behat\Behat\Context\Context;" before "use Behat\Step\Then;" in
the imports block of EmailContext.php so that Context sorts before Then,
complying with the project's alphabetical use-import guideline.
In `@src/Sylius/Behat/Context/Ui/ThemeContext.php`:
- Around line 16-18: Reorder the PHP use imports so they are alphabetically
sorted: move Behat\Behat\Context\Context before the Behat\Step\* imports and
within the Behat\Step group place Then before When; update the use statements
for Context, Then, and When in ThemeContext.php accordingly (i.e., import
Context first, then Behat\Step\Then, then Behat\Step\When).
In `@src/Sylius/Behat/Context/Ui/UserContext.php`:
- Around line 16-18: The current use-import ordering in UserContext is
incorrect: move "use Behat\Behat\Context\Context;" before the Step imports and
reorder the Step imports so "use Behat\Step\Then;" comes before "use
Behat\Step\When;"; ensure all use statements in UserContext (and match pattern
used in ThemeContext/ChannelContext) are alphabetized per coding guidelines so
imports are consistently ordered.
| use Behat\Step\When; | ||
| use Behat\Behat\Context\Context; |
There was a problem hiding this comment.
use Behat\Step\When is out of alphabetical order
Same issue as other files in this PR: Behat\Behat\Context\Context sorts before Behat\Step\When.
As per coding guidelines: "Sort PHP use imports alphabetically".
♻️ Proposed fix
-use Behat\Step\When;
use Behat\Behat\Context\Context;
+use Behat\Step\When;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use Behat\Step\When; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Step\When; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/Sylius/Behat/Context/Ui/BrowserContext.php` around lines 16 - 17, The two
PHP import lines are not alphabetized: move "use Behat\Behat\Context\Context;"
above "use Behat\Step\When;" so the imports are in alphabetical order; update
the use statements in BrowserContext.php to list Behat\Behat\Context\Context
before Behat\Step\When (ensure no other import order is disturbed).
| use Behat\Step\When; | ||
| use Behat\Step\Then; | ||
| use Behat\Behat\Context\Context; |
There was a problem hiding this comment.
use Behat\Step\* imports have two ordering violations
Same issue as ThemeContext and UserContext: both belong after Behat\Behat\Context\Context, and Then should precede When.
As per coding guidelines: "Sort PHP use imports alphabetically".
♻️ Proposed fix
-use Behat\Step\When;
-use Behat\Step\Then;
use Behat\Behat\Context\Context;
+use Behat\Step\Then;
+use Behat\Step\When;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use Behat\Step\When; | |
| use Behat\Step\Then; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Step\Then; | |
| use Behat\Step\When; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/Sylius/Behat/Context/Ui/ChannelContext.php` around lines 16 - 18, Reorder
the PHP use imports in ChannelContext so they follow the project's alphabetical
ordering and the guideline that Behat\Behat\Context\Context comes before
Behat\Step imports: replace the current block (using Behat\Step\When; use
Behat\Step\Then; use Behat\Behat\Context\Context;) with use
Behat\Behat\Context\Context first, then use Behat\Step\Then and finally use
Behat\Step\When; mirror the same ordering fix applied in ThemeContext and
UserContext.
| use Behat\Step\Then; | ||
| use Behat\Behat\Context\Context; |
There was a problem hiding this comment.
use Behat\Step\Then is out of alphabetical order
Behat\Behat\* sorts before Behat\Step\*, so the new import should be placed after the existing Behat\Behat\Context\Context and Behat\Mink\Exception\ElementNotFoundException imports.
As per coding guidelines: "Sort PHP use imports alphabetically".
♻️ Proposed fix
-use Behat\Step\Then;
use Behat\Behat\Context\Context;
use Behat\Mink\Exception\ElementNotFoundException;
+use Behat\Step\Then;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use Behat\Step\Then; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Mink\Exception\ElementNotFoundException; | |
| use Behat\Step\Then; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/Sylius/Behat/Context/Ui/CustomerContext.php` around lines 16 - 17, The
new import use Behat\Step\Then is out of alphabetical order; reorder the use
statements so PHP imports are alphabetized (e.g., ensure
Behat\Behat\Context\Context and Behat\Mink\Exception\ElementNotFoundException
come before Behat\Step\Then), updating the use block in CustomerContext.php so
all Behat-related use lines are sorted lexicographically.
| use Behat\Step\Then; | ||
| use Behat\Behat\Context\Context; |
There was a problem hiding this comment.
use Behat\Step\Then is out of alphabetical order
Behat\Behat\Context\Context sorts before Behat\Step\Then.
As per coding guidelines: "Sort PHP use imports alphabetically".
♻️ Proposed fix
-use Behat\Step\Then;
use Behat\Behat\Context\Context;
+use Behat\Step\Then;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use Behat\Step\Then; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Step\Then; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/Sylius/Behat/Context/Ui/EmailContext.php` around lines 16 - 17, Reorder
the PHP use imports so they are alphabetized: move the import "use
Behat\Behat\Context\Context;" before "use Behat\Step\Then;" in the imports block
of EmailContext.php so that Context sorts before Then, complying with the
project's alphabetical use-import guideline.
| use Behat\Step\When; | ||
| use Behat\Step\Then; | ||
| use Behat\Behat\Context\Context; |
There was a problem hiding this comment.
use Behat\Step\* imports have two ordering violations
- Both
Behat\Step\*entries should appear afterBehat\Behat\Context\Context(B < S). - Within the
Behat\Stepgroup,Then(T) sorts beforeWhen(W).
As per coding guidelines: "Sort PHP use imports alphabetically".
♻️ Proposed fix
-use Behat\Step\When;
-use Behat\Step\Then;
use Behat\Behat\Context\Context;
+use Behat\Step\Then;
+use Behat\Step\When;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use Behat\Step\When; | |
| use Behat\Step\Then; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Step\Then; | |
| use Behat\Step\When; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/Sylius/Behat/Context/Ui/ThemeContext.php` around lines 16 - 18, Reorder
the PHP use imports so they are alphabetically sorted: move
Behat\Behat\Context\Context before the Behat\Step\* imports and within the
Behat\Step group place Then before When; update the use statements for Context,
Then, and When in ThemeContext.php accordingly (i.e., import Context first, then
Behat\Step\Then, then Behat\Step\When).
| use Behat\Step\When; | ||
| use Behat\Step\Then; | ||
| use Behat\Behat\Context\Context; |
There was a problem hiding this comment.
use Behat\Step\* imports have two ordering violations
Same pattern as ThemeContext and ChannelContext: both imports belong after Behat\Behat\Context\Context, and Then should precede When.
As per coding guidelines: "Sort PHP use imports alphabetically".
♻️ Proposed fix
-use Behat\Step\When;
-use Behat\Step\Then;
use Behat\Behat\Context\Context;
+use Behat\Step\Then;
+use Behat\Step\When;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use Behat\Step\When; | |
| use Behat\Step\Then; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Behat\Context\Context; | |
| use Behat\Step\Then; | |
| use Behat\Step\When; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/Sylius/Behat/Context/Ui/UserContext.php` around lines 16 - 18, The
current use-import ordering in UserContext is incorrect: move "use
Behat\Behat\Context\Context;" before the Step imports and reorder the Step
imports so "use Behat\Step\Then;" comes before "use Behat\Step\When;"; ensure
all use statements in UserContext (and match pattern used in
ThemeContext/ChannelContext) are alphabetized per coding guidelines so imports
are consistently ordered.
❗ Preview Environment delete from Bunnyshell failedCheck https://github.com/Sylius/Sylius/actions/runs/22142741253 for details. See: Environment Details Available commands:
|
Summary by CodeRabbit