From 05f20eadabe3e29a16d4a238ede9b2eedcf7f618 Mon Sep 17 00:00:00 2001 From: shrop <shrop@14767.no-reply.drupal.org> Date: Wed, 26 Oct 2016 17:42:29 +0200 Subject: [PATCH] fix(HookInitCssSniff): Improve warning message wording (#2817537 by shrop) --- .../Sniffs/FunctionDefinitions/HookInitCssSniff.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coder_sniffer/DrupalPractice/Sniffs/FunctionDefinitions/HookInitCssSniff.php b/coder_sniffer/DrupalPractice/Sniffs/FunctionDefinitions/HookInitCssSniff.php index ef252b14..6a47d51b 100644 --- a/coder_sniffer/DrupalPractice/Sniffs/FunctionDefinitions/HookInitCssSniff.php +++ b/coder_sniffer/DrupalPractice/Sniffs/FunctionDefinitions/HookInitCssSniff.php @@ -68,10 +68,10 @@ class DrupalPractice_Sniffs_FunctionDefinitions_HookInitCssSniff extends Drupal_ && $tokens[$opener]['code'] === T_OPEN_PARENTHESIS ) { if ($tokens[$stackPtr]['content'] === ($fileName.'_init')) { - $warning = 'Do not use %s() in hook_init(), move it to your page/form callback or use hook_page_build() instead'; + $warning = 'Do not use %s() in hook_init(), use #attached for CSS and JS in your page/form callback or in hook_page_build() instead'; $phpcsFile->addWarning($warning, $string, 'AddFunctionFound', array($tokens[$string]['content'])); } else { - $warning = 'Do not use %s() in hook_page_build(), use #attached on the $page render array instead'; + $warning = 'Do not use %s() in hook_page_build(), use #attached for CSS and JS on the $page render array instead'; $phpcsFile->addWarning($warning, $string, 'AddFunctionFoundPageBuild', array($tokens[$string]['content'])); } } -- GitLab