Commit 2503c149 authored by gbyte.co's avatar gbyte.co

Fix some code style

parent b9b67fa1
......@@ -87,6 +87,7 @@ class SimpleSitemapViewsController extends ControllerBase {
'#type' => 'fieldset',
'table' => $table,
];
return $build;
}
......
......@@ -56,6 +56,7 @@ class ArgumentCollector implements EventSubscriberInterface {
*/
public static function getSubscribedEvents() {
$events[KernelEvents::TERMINATE] = 'onTerminate';
return $events;
}
......@@ -106,6 +107,7 @@ class ArgumentCollector implements EventSubscriberInterface {
$args[] = $arg;
}
}
return $args;
}
......
......@@ -90,6 +90,7 @@ class SimpleSitemapViews {
public function isEnabled() {
// Support enabled when views display extender is enabled.
$enabled = Views::getEnabledDisplayExtenders();
return isset($enabled[self::PLUGIN_ID]);
}
......@@ -148,6 +149,7 @@ class SimpleSitemapViews {
if ($extender instanceof SimpleSitemapDisplayExtender && $extender->hasSitemapSettings() && $extender->isIndexingEnabled()) {
return $extender->getSitemapSettings();
}
return NULL;
}
......@@ -175,6 +177,7 @@ class SimpleSitemapViews {
$indexable_arguments[] = $argument_id;
}
}
return $indexable_arguments;
}
......@@ -241,6 +244,7 @@ class SimpleSitemapViews {
'arguments_ids' => $args_ids,
'arguments_values' => $args_values,
]);
return (bool) $query->execute();
}
......@@ -284,6 +288,7 @@ class SimpleSitemapViews {
'arguments' => $convert ? $this->convertArgumentsStringToArray($row->arguments) : $row->arguments,
];
}
return $arguments;
}
......@@ -302,6 +307,7 @@ class SimpleSitemapViews {
if (!empty($condition)) {
$query->condition($condition);
}
// Get the number of rows from the index table.
return $query->countQuery()->execute()->fetchField();
}
......@@ -326,6 +332,7 @@ class SimpleSitemapViews {
}
$query->orderBy('id', 'ASC');
$query->range($position - 1, 1);
return $query->execute()->fetchField();
}
......@@ -363,6 +370,7 @@ class SimpleSitemapViews {
return !empty($display['display_plugin']) && in_array($display['display_plugin'], $display_plugins);
};
$displays = array_filter($view_entity->get('display'), $filter_callback);
return array_keys($displays);
}
......@@ -404,6 +412,7 @@ class SimpleSitemapViews {
}
}
}
return $indexable_views;
}
......@@ -443,6 +452,7 @@ class SimpleSitemapViews {
$args_slice = array_slice($args, 0, $length);
$variations[] = $this->convertArgumentsArrayToString($args_slice);
}
return $variations;
}
......@@ -489,6 +499,7 @@ class SimpleSitemapViews {
}
}
}
return $plugin_ids;
}
......
......@@ -127,6 +127,7 @@ class SimplesitemapVariantsForm extends SimplesitemapFormBase {
$variants[$name]['type'] = !empty($variant_settings[1]) ? trim($variant_settings[1]) : SimplesitemapManager::DEFAULT_SITEMAP_TYPE;
$variants[$name]['label'] = !empty($variant_settings[2]) ? trim($variant_settings[2]) : $name;
}
return $variants;
}
......@@ -142,6 +143,7 @@ class SimplesitemapVariantsForm extends SimplesitemapFormBase {
. ' | ' . $variant_definition['label']
. "\r\n";
}
return $variants_string;
}
}
......@@ -83,6 +83,7 @@ class Logger {
*/
public function log($logSeverityLevel = self::LOG_SEVERITY_LEVEL_DEFAULT) {
$this->logger->$logSeverityLevel(strtr($this->message, $this->substitutions));
return $this;
}
......@@ -95,6 +96,7 @@ class Logger {
if (empty($permission) || $this->currentUser->hasPermission($permission)) {
$this->messenger->addMessage($this->t($this->message, $this->substitutions), $displayMessageType);
}
return $this;
}
}
......@@ -53,6 +53,7 @@ class ArbitraryUrlGenerator extends UrlGeneratorBase {
array $configuration,
$plugin_id,
$plugin_definition) {
return new static(
$configuration,
$plugin_id,
......@@ -70,6 +71,7 @@ class ArbitraryUrlGenerator extends UrlGeneratorBase {
$arbitrary_links = [];
$sitemap_variant = $this->sitemapVariant;
$this->moduleHandler->alter('simple_sitemap_arbitrary_links', $arbitrary_links, $sitemap_variant);
return array_values($arbitrary_links);
}
......
......@@ -96,6 +96,7 @@ class CustomUrlGenerator extends EntityUrlGeneratorBase {
*/
public function getDataSets() {
$this->includeImages = $this->generator->getSetting('custom_links_include_images', FALSE);
return array_values($this->generator->setVariants($this->sitemapVariant)->getCustomLinks());
}
......@@ -108,6 +109,7 @@ class CustomUrlGenerator extends EntityUrlGeneratorBase {
['@path' => $data_set['path'], '@custom_paths_url' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap/custom'])
->display('warning', 'administer sitemap settings')
->log('warning');
return FALSE;
}
......
......@@ -152,6 +152,7 @@ abstract class EntityUrlGeneratorBase extends UrlGeneratorBase {
->setOption('language', $this->languages[$this->defaultLanguageId])->toString()
);
}
return $alternate_urls;
}
......@@ -173,6 +174,7 @@ abstract class EntityUrlGeneratorBase extends UrlGeneratorBase {
}
}
}
return $alternate_urls;
}
......@@ -191,6 +193,7 @@ abstract class EntityUrlGeneratorBase extends UrlGeneratorBase {
}
}
}
return $alternate_urls;
}
......
......@@ -69,6 +69,7 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
*/
public function setSettings(array $settings) {
$this->settings = $settings;
return $this;
}
......@@ -78,6 +79,7 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
*/
public function setSitemapVariant($sitemap_variant) {
$this->sitemapVariant = $sitemap_variant;
return $this;
}
......@@ -108,6 +110,7 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
*/
public function generate($data_set) {
$path_data = $this->processDataSet($data_set);
return FALSE !== $path_data ? [$path_data] : [];
}
}
......@@ -41,6 +41,7 @@ class SimplesitemapSettings {
$setting = $this->configFactory
->get('simple_sitemap.settings')
->get($name);
return NULL !== $setting ? $setting : $default;
}
......@@ -63,6 +64,7 @@ class SimplesitemapSettings {
public function saveSetting($name, $setting) {
$this->configFactory->getEditable('simple_sitemap.settings')
->set($name, $setting)->save();
return $this;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment