Problem: developers just repeat the class name in a doc comment, which is useless:
namespace Drupal\example\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class Example.
*/
class Example extends ConfigFormBase {
Such a comments does not carry any additional information, the only benefit is the visual separation between the use statements and the beginning of the class.
Solution: create a sniff that checks if the class short comment only consists of 2 words. If one word is the class then throw a warning "The class short comment should describe what the class does and not simply repeat the class name."
Comments
Comment #2
arkener commentedPR: https://github.com/pfrenssen/coder/pull/116
Comment #3
klausiThanks, I have a tiny comment where the test case should be but after that you can merge.
Comment #5
arkener commentedFixed and merged, thanks for the review @Klausi!