Problem/Motivation
List builders are not controllers; their namespace should not include \Controller\. Drupal core would ignore the namespace used for list builders, but using \Controller\ in their namespace will make people think that list builders are controllers, which is not exact.
Furthermore, since Drupal core will use PHP attributes to find controllers, and associate them to a route, it is important to put in a Controller directory only those files that contain a controller class, or Drupal core would parse files that do not contain controllers.
Proposed resolution
Do not use a namespace that contains \Controller\ for list builders.
Issue fork examples-3584457
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
avpadernoThe correct terminology for Drupal 8+ is entity handler: an entity list builder and a class that handles access to an entity are entity handlers, not entity controllers.
Comment #3
avpadernoFor Drupal core, there are #3584795: Remove non-controller classes from module Controller namespaces/folders and #3585072: Move controller classes to Controller namespaces. Moving classes that are not controllers from outside the Controller directory avoids that Drupal core checks for attributes in classes that are not controllers.
Comment #4
avpadernoComment #5
avpadernoComment #6
avpadernoComment #7
avpadernoComment #9
avpadernoComment #10
avpadernoComment #12
avpaderno