getkirby / getkirby.com

Source code and content for the Kirby website
https://getkirby.com
125 stars 260 forks source link

Class methods: use docblock description for example code #2314

Open distantnative opened 1 month ago

distantnative commented 1 month ago

Uses the core code docblocks to display the whole description of the method docblock as Example.

@bastianallgeier @lukasbestle What do you think about this idea? I think it would allow us to add more examples in-code that we would never maintain manually in the reference. But are there docblocks featuring other description parts than examples?

bastianallgeier commented 1 month ago

I really like the idea as well. Do you have a good example link where the doc block is used? I was trying to find something but I can only find those with the Example field.

distantnative commented 1 month ago

@bastianallgeier I don't think our core code is using that much (at all?) yet. That we would have to start to do.

bastianallgeier commented 1 month ago

I thought we already had more examples in the code. I think it's a good idea to follow @lukasbestle's idea and create such a review list to see what we are getting out of it.

lukasbestle commented 1 month ago

A search for * <code> in our core source returns 40 results. Then we also have 15 with * ```. Maybe there are more with different syntax all-together. As I wrote, we can find those by looping over all classes with the PHPDocumentor class and listing all methods that have a description in the docblock.