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

Creating a routing method already ending in Action appends a second Action #2043

Closed
CJDennis opened this issue Dec 7, 2022 · 1 comment
Closed

Comments

@CJDennis
Copy link

CJDennis commented Dec 7, 2022

In the routing files a few autocomplete options are available. For a route controller, pressing [Ctrl]+[Space] will present the entirety of existing Controller methods including the appended Action. However, when using "Create Method", missing methods are always created with Action appended regardless of whether the missing method in the routing file already ends with Action or not.

If a route does not already end with Action, it is appended to the method name when it is created.
routing.yaml

my_foo_route:
  path: /foo
  controller: MyController::foo

MyController.php

class MyController {
  // correct
  public function fooAction() {
  }
}

If a route does already end with Action, it is also appended to the method name when it is created.
routing.yaml

my_foo_route:
  path: /foo
  controller: MyController::fooAction

MyController.php

class MyController {
  // incorrect
  public function fooActionAction() {
  }
}

If the routing method already ends with Action, a second Action should not be appended to it. It should also create a method like this:

MyController.php

class MyController {
  // correct
  public function fooAction() {
  }
}

Perhaps pressing [Ctrl]+[Space] should present the existing methods both with and without the final Action to indicate that either are allowed.

routing.yaml

my_foo_route:
  path: /foo
  controller: MyController::|
            +------------------------------------+
            | MyController::existingMethod       |
            | MyController::existingMethodAction |
            +------------------------------------+

where | is the cursor position before pressing [Ctrl]+[Space] and the "box" contains the autocomplete options.

@Haehnchen
Copy link
Owner

action was removed via: #2341

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

No branches or pull requests

2 participants