For example: In sonata admin, a single admin class has always recurring syntax like
$formMapper->add('test', null, ['label' => 'testlabel']);
$formMapper->add('test1', null, ['label' => 'testlabel1']);
$formMapper->add('test2', null, ['label' => 'testlabel2']);
In this case if i am adding several fields with the add method, our quality gate is telling me, that it is a code smell using the 'label' string more than 2 times. I should add a constant for that string ...
Is it now good or bad practise to have many many classes full of constants like
const KEY_LABEL = 'label'
$formMapper->add('test2', null, [self::KEY_LABEL => 'testlabel2']);
???
I can't figure out, whats the great benefit .. if someday the label key will change, which is given by the framework, i have to make changes to this stuff either way ...