Skip to content
Snippets Groups Projects
Commit 86553f4a authored by gbyte's avatar gbyte
Browse files

Clean up

parent d3588261
No related branches found
Tags 4.1.0
No related merge requests found
......@@ -209,7 +209,7 @@ class SimpleSitemapViews {
// Required arguments.
foreach ($bits as $bit) {
if ($bit == '%' || strpos($bit, '%') === 0) {
$indexable_arguments[] = isset($arguments[$arg_index]) ? $arguments[$arg_index] : $bit;
$indexable_arguments[] = $arguments[$arg_index] ?? $bit;
$arg_index++;
}
}
......
......@@ -34,7 +34,7 @@ class SimpleSitemapViewsTest extends SimpleSitemapViewsTestBase {
$this->assertNotEmpty($indexable_views);
$test_view_exists = FALSE;
foreach ($indexable_views as &$view) {
foreach ($indexable_views as $view) {
if ($view->id() == $this->testView->id() && $view->current_display == $this->testView->current_display) {
$test_view_exists = TRUE;
break;
......
......@@ -218,7 +218,7 @@ function simple_sitemap_update_8201() {
];
foreach ($entity_types as $entity_type_name => $settings) {
if (isset($naming_changes[$entity_type_name])) {
$entity_types[$naming_changes[$entity_type_name]] = $entity_types[$entity_type_name];
$entity_types[$naming_changes[$entity_type_name]] = $settings;
unset($entity_types[$entity_type_name]);
}
}
......@@ -544,13 +544,9 @@ function simple_sitemap_update_8212() {
foreach ($all_bundle_settings as $bundle_settings) {
$config = $config_factory->get($bundle_settings)->get();
$config['include_images'] = isset($config['include_images'])
? (bool) $config['include_images']
: FALSE;
$config['include_images'] = isset($config['include_images']) && $config['include_images'];
$config['index'] = isset($config['index'])
? (bool) $config['index']
: FALSE;
$config['index'] = isset($config['index']) && $config['index'];
$config_factory->getEditable($bundle_settings)->setData($config)->save();
}
......
......@@ -136,8 +136,8 @@ class CustomLinksForm extends SimpleSitemapFormBase {
$placeholders = [
'@line' => ++$i,
'@path' => $link_config['path'],
'@priority' => isset($link_config['priority']) ? $link_config['priority'] : '',
'@changefreq' => isset($link_config['changefreq']) ? $link_config['changefreq'] : '',
'@priority' => $link_config['priority'] ?? '',
'@changefreq' => $link_config['changefreq'] ?? '',
'@changefreq_options' => implode(', ', FormHelper::getChangefreqOptions()),
];
......@@ -207,7 +207,7 @@ class CustomLinksForm extends SimpleSitemapFormBase {
$custom_links_string_lines = array_filter(array_map('trim', $custom_links_string_lines));
$custom_links = [];
foreach ($custom_links_string_lines as $i => &$line) {
foreach ($custom_links_string_lines as $i => $line) {
$link_settings = explode(' ', $line);
$custom_links[$i]['path'] = $link_settings[0];
......
......@@ -458,7 +458,7 @@ class FormHelper {
'#description' => $this->getEntityCategory() === 'instance'
? $this->t('The frequency with which this <em>@bundle</em> entity changes. Search engine bots may take this as an indication of how often to index it.', ['@bundle' => $bundle_name])
: $this->t('The frequency with which entities of this type change. Search engine bots may take this as an indication of how often to index them.'),
'#default_value' => isset($this->bundleSettings[$variant]['changefreq']) ? $this->bundleSettings[$variant]['changefreq'] : NULL,
'#default_value' => $this->bundleSettings[$variant]['changefreq'] ?? NULL,
'#options' => $this->getChangefreqSelectValues(),
];
......
......@@ -145,7 +145,7 @@ class StatusForm extends SimpleSitemapFormBase {
// With all results processed, there still may be some stashed results to
// be indexed.
$percent = $percent === 100 && $this->queueWorker->generationInProgress() ? 99 : $percent;
$percent = $percent == 100 && $this->queueWorker->generationInProgress() ? 99 : $percent;
$index_progress = [
'#theme' => 'progress_bar',
......
......@@ -66,13 +66,6 @@ abstract class SimplesitemapTestBase extends BrowserTestBase {
*/
protected $defaultSitemapUrl = 'sitemap.xml';
/**
* Use the testing profile.
*
* @var string
*/
protected $profile = 'testing';
/**
* Use the classy theme.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment