Suggestion for modules' web pages: Add a hint to all methods of a certain trait
It would be nice to have way to somehow add a hint to some trait (e.g. https://github.com/Codeception/module-symfony/blob/main/src/Codeception/Module/Symfony/SecurityAssertionsTrait.php), and then have this hint displayed at all methods of that trait (e.g. https://codeception.com/docs/modules/Symfony#dontSeeAuthentication).
Background: That security trait requires Symfony's security.helper service to be declared public, see https://github.com/Codeception/module-symfony/issues/138, and there might be more use cases in the future where something has to be explained for an entire trait.
@Naktibalda what do you think?
the laravel module also splits its assertions into Traits, and the Lumen module will do the same soon.
I think it would be useful to be able to docblocks for traits.
Or even more, to be able to somehow organize the assertions in the website documentation according to the trait to which they belong.
Keep things that are related together, right?
Or even more, to be able to somehow organize the assertions in the website documentation according to the trait to which they belong.
I already suggested one step into this direction at https://github.com/Codeception/Codeception/discussions/6063#discussioncomment-244542:
On the framework pages, on each function add a note where the source code lives.
But after thinking some more about it, your idea is even better! Let's drop the alphabetical order in favor of trait "sections" - both in the page and in the index column (right hand side)
Why?
- Index: The Symfony Module page now lists 131 actions. These are too many IMO for alphabetical searching (i.e. nobody is scanning this list from top to bottom). Organizing the index into chapters would make it easier.
- Page itself: If I'm reading https://codeception.com/docs/modules/Symfony#seeEmailIsSent, I'm probably more interested in
grabLastSentEmail(=next in the trait), than inseeEventTriggered(=next in alphabet)
So the solution would then be to have a docblock for the trait, and this is displayed as "introduction" of this trait's section on the page. So (for now) repeating stuff at multiple functions isn't even necessary.
This would also make my idea to add some "see also" links obsolete, which I started at https://github.com/Codeception/module-symfony/pull/122