Convert Behat annotations to PHP attributes in Hybrid contexts#18833
Convert Behat annotations to PHP attributes in Hybrid contexts#18833TheMilek merged 1 commit intoSylius:2.3from
Conversation
📝 WalkthroughWalkthroughThis PR migrates Behat step definitions from docblock annotations to PHP 8 attributes across two test context files. Added imports for Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 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 |
❗ Preview Environment delete from Bunnyshell failedCheck https://github.com/Sylius/Sylius/actions/runs/22131510547 for details. See: Environment Details Available commands:
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/Sylius/Behat/Context/Hybrid/Setup/SecurityContext.php (1)
16-17: Imports are not sorted alphabetically.Same issue as in
CartContext.php—Behat\Behat\Context\Contextshould come beforeBehat\Step\Given.Proposed fix
-use Behat\Step\Given; use Behat\Behat\Context\Context; +use Behat\Step\Given;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Sylius/Behat/Context/Hybrid/Setup/SecurityContext.php` around lines 16 - 17, Reorder the PHP use imports in SecurityContext so they are alphabetized and grouped by type: place Behat\Behat\Context\Context before Behat\Step\Given (i.e., swap the two use statements), matching the same import ordering fix applied in CartContext.php and following the project's "classes first, alphabetized" guideline.src/Sylius/Behat/Context/Hybrid/Setup/CartContext.php (1)
16-17: Imports are not sorted alphabetically.
Behat\Behat\Context\Contextshould precedeBehat\Step\Whenlexicographically.Proposed fix
-use Behat\Step\When; use Behat\Behat\Context\Context; +use Behat\Step\When;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Sylius/Behat/Context/Hybrid/Setup/CartContext.php` around lines 16 - 17, The import statements are out of alphabetical order: move the Behat\Behat\Context\Context import so it comes before Behat\Step\When (and ensure all other `use` statements in CartContext.php are alphabetized and grouped by type), e.g., reorder the `use` lines in the top of the file so class imports are sorted lexicographically with `Behat\Behat\Context\Context` preceding `Behat\Step\When`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/Sylius/Behat/Context/Hybrid/Setup/CartContext.php`:
- Around line 16-17: The import statements are out of alphabetical order: move
the Behat\Behat\Context\Context import so it comes before Behat\Step\When (and
ensure all other `use` statements in CartContext.php are alphabetized and
grouped by type), e.g., reorder the `use` lines in the top of the file so class
imports are sorted lexicographically with `Behat\Behat\Context\Context`
preceding `Behat\Step\When`.
In `@src/Sylius/Behat/Context/Hybrid/Setup/SecurityContext.php`:
- Around line 16-17: Reorder the PHP use imports in SecurityContext so they are
alphabetized and grouped by type: place Behat\Behat\Context\Context before
Behat\Step\Given (i.e., swap the two use statements), matching the same import
ordering fix applied in CartContext.php and following the project's "classes
first, alphabetized" guideline.
Summary by CodeRabbit