Skip to content
Snippets Groups Projects
Commit 0041105d authored by Will Hearn's avatar Will Hearn
Browse files

feat(phpcs): Correct any issues reported by phpcs

parent 1a1b710d
Branches
Tags 8.x-6.6
No related merge requests found
......@@ -30,13 +30,13 @@ class SystemThemeSettings extends BootstrapSystemThemeSettings {
$form['wxt_bootstrap'] = [
'#type' => 'vertical_tabs',
'#attached' => ['library' => ['bootstrap/theme-settings']],
'#prefix' => '<h2><small>' . t('WxT Bootstrap Settings') . '</small></h2>',
'#prefix' => '<h2><small>' . $this->t('WxT Bootstrap Settings') . '</small></h2>',
'#weight' => -10,
];
$groups = [
'accessibility' => t('Accessibility'),
'customization' => t('Customization'),
'gcweb' => t('GCWeb'),
'accessibility' => $this->t('Accessibility'),
'customization' => $this->t('Customization'),
'gcweb' => $this->t('GCWeb'),
];
foreach ($groups as $group => $title) {
$form[$group] = [
......
......@@ -18,11 +18,6 @@ class Comment extends PreprocessBase {
* {@inheritdoc}
*/
public function preprocessVariables(Variables $variables) {
$account = $variables['comment']->getOwner();
$username = [
'#theme' => 'username',
'#account' => $account,
];
$variables['author'] = \Drupal::service('renderer')->render($elements);
// Getting the node creation time stamp from the comment object.
......@@ -30,7 +25,10 @@ class Comment extends PreprocessBase {
// Adjust submitted display.
$variables['created'] = \Drupal::service('date.formatter')->format($date, 'wxt_standard');
$variables['submitted'] = $this->t('@username - <span class="comments-ago">@datetime </span>', ['@username' => $variables['author'], '@datetime' => $variables['created']]);
$variables['submitted'] = $this->t('@username - <span class="comments-ago">@datetime </span>', [
'@username' => $variables['author'],
'@datetime' => $variables['created'],
]);
}
}
......@@ -19,7 +19,7 @@ class MaintenancePage extends PreprocessBase {
public function preprocess(array &$variables, $hook, array $info) {
$config = \Drupal::config('wxt_library.settings');
$variant = ($config->get('minimized.options')) ? 'minified' : 'source';
$wxt_libraries = _wxt_library_options() + ['wet-boew' => t('Core')];
$wxt_libraries = _wxt_library_options() + ['wet-boew' => $this->t('Core')];
$wxt_active = $config->get('wxt.theme');
foreach ($wxt_libraries as $wxt_library => $name) {
......
......@@ -69,12 +69,12 @@ function wxt_bootstrap_theme_suggestions_page_alter(array &$suggestions, array $
$wxt_active = $wxt->getLibraryName();
if ($node->book['bid'] == $node->id()) {
// Theme book index page
// Theme book index page.
$suggestions[] = $variables['theme_hook_original'] . '__book_index';
$suggestions[] = $variables['theme_hook_original'] . '__' . $wxt_active . '__book_index';
}
else {
// Theme book child page
// Theme book child page.
$suggestions[] = $variables['theme_hook_original'] . '__book_page';
$suggestions[] = $variables['theme_hook_original'] . '__' . $wxt_active . '__book_page';
}
......@@ -165,7 +165,7 @@ function wxt_bootstrap_preprocess_filter_caption(&$variables) {
$node = \Drupal::routeMatch()->getParameter('node');
if (!$node instanceof NodeInterface) {
// Show caption if not on a node page to ensure it displays in CKEditor
// Show caption if not on a node page to ensure it displays in CKEditor.
$variables['show_caption'] = TRUE;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment