Skip to content
Snippets Groups Projects
Commit 7a197729 authored by Joseph Olstad's avatar Joseph Olstad
Browse files

Issue #3536372 by joseph.olstad: phpcs related updates - more again.

parent f160f8ef
Branches
Tags
No related merge requests found
Pipeline #549352 passed with warnings
......@@ -387,7 +387,7 @@ function &_bootstrap_get_classes(array &$element, $property = 'attributes') {
function _bootstrap_glyphicon($name, $default = [], array $attributes = []) {
Bootstrap::deprecated();
$icon = Bootstrap::glyphicon($name, ['#markup' => $default]);
$icon_attributes = isset($icon['#attributes']) ? $icon['#attributes'] : [];
$icon_attributes = $icon['#attributes'] ?? [];
unset($icon['#attributes']);
return Element::createStandalone($icon)->setAttributes($attributes)->setAttributes($icon_attributes)->getArray();
}
......@@ -477,7 +477,7 @@ function _bootstrap_glyphicons_supported() {
function _bootstrap_icon($name, $default = NULL, array $attributes = []) {
Bootstrap::deprecated();
$icon = Bootstrap::glyphicon($name, ['#markup' => $default]);
$icon_attributes = isset($icon['#attributes']) ? $icon['#attributes'] : [];
$icon_attributes = $icon['#attributes'] ?? [];
unset($icon['#attributes']);
return (string) Element::createStandalone($icon)->setAttributes($attributes)->setAttributes($icon_attributes)->renderPlain();
}
......
......@@ -47,7 +47,7 @@ class Page extends BootstrapPage {
* {@inheritdoc}
*/
public function preprocess(array &$variables, $hook, array $info) {
$value = isset($variables['element']['child']['#value']) ? $variables['element']['child']['#value'] : FALSE;
$value = $variables['element']['child']['#value'] ?? FALSE;
if (_some_module_condition($value)) {
$variables['attributes']['class'][] = 'my-theme-class';
$variables['attributes']['class'][] = 'another-theme-class';
......@@ -74,7 +74,7 @@ class Page extends BootstrapPage {
// preprocess function. It also acts like the normal $variables array when
// you need it to in instances of accessing nested content or in loop
// structures like foreach.
$value = isset($variables['element']['child']['#value']) ? $variables['element']['child']['#value'] : FALSE;
$value = $variables['element']['child']['#value'] ?? FALSE;
if (_some_module_condition($value)) {
$variables->addClass(['my-theme-class', 'another-theme-class'])->removeClass('page');
}
......
......@@ -69,7 +69,7 @@ class Link extends BootstrapLink {
* {@inheritdoc}
*/
public static function preRender(array $element) {
$context = isset($element['#context']) ? $element['#context'] : [];
$context = $element['#context'] ?? [];
// Make downloadButton links into buttons.
if (!empty($context['downloadButton'])) {
......
......@@ -9,6 +9,11 @@
<!-- Check all files in the current directory and below. -->
<file>.</file>
<arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,md,yml"/>
<!-- Exclude some directories globally if needed. -->
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<!-- Change this value to 7 if you want to check Drupal 7 code. -->
<config name="drupal_core_version" value="10"/>
......
......@@ -22,7 +22,8 @@ $kernel = require_once __DIR__ . '/bootstrap.php';
$bootstrap = Bootstrap::getTheme('bootstrap');
/** @var \Drupal\bootstrap\Plugin\Setting\SettingInterface[] $settings */
/**
* @var \Drupal\bootstrap\Plugin\Setting\SettingInterface[] $settings */
$settings = array_filter($bootstrap->getSettingPlugin(NULL, TRUE), function (SettingInterface $setting) {
return !!$setting->getGroups();
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment