Closed Anthelixes closed 1 year ago
@Anthelixes can you please provide a little bit more context on the warning above? How can it be replicated? Thanks.
Create an URL using:
Url::fromRoute('entity.node.canonical', ['node' => $this->node->id()], []),
Running: ./vendor/bin/phpmd ./web/modules/custom/ github phpmd.xml
will give:
::warning file=.../Plugin/Block/EventMenuBlock.php,line=239::Avoid using static access to class '\Drupal\Core\Url' in method 'generateButton'.
Similar also with:
public function getCacheContexts() {
return Cache::mergeContexts(parent::getCacheContexts(), ['url']);
}
or Element::children()
@tavib47 @stefanbutura - Do you agree with this change?
Logged ticket https://helpdesk.eaudeweb.ro/issues/15825
PR: @eaudeweb/qa#5