Commit 4b7312d1 authored by gbyte.co's avatar gbyte.co

Improve code style

parent 900c08ef
......@@ -203,9 +203,9 @@ function simple_sitemap_update_8202() {
foreach ($entity_types as $entity_type_name => &$entity_type) {
if (is_array($entity_type)) {
foreach($entity_type as $bundle_name => &$bundle) {
foreach ($entity_type as $bundle_name => &$bundle) {
if (isset($bundle['entities'])) {
foreach($bundle['entities'] as $entity_id => $entity_settings) {
foreach ($bundle['entities'] as $entity_id => $entity_settings) {
$database->insert('simple_sitemap_entity_overrides')
->fields([
'entity_type' => $entity_type_name,
......@@ -251,7 +251,7 @@ function simple_sitemap_update_8204() {
$sitemap_entity_types = \Drupal::service('entity_type.manager')->getDefinitions();
$entity_types = \Drupal::config('simple_sitemap.entity_types')->get();
unset($entity_types['_core']);
foreach($entity_types as $entity_type_id => $entity_type) {
foreach ($entity_types as $entity_type_id => $entity_type) {
if (!isset($sitemap_entity_types[$entity_type_id])
|| !$sitemap_entity_types[$entity_type_id]->hasLinkTemplate('canonical')) {
......@@ -276,9 +276,9 @@ function simple_sitemap_update_8205() {
$entity_types = \Drupal::config('simple_sitemap.entity_types')->get();
unset($entity_types['_core']);
$enabled_entity_types = [];
foreach($entity_types as $entity_type_id => $bundles) {
foreach ($entity_types as $entity_type_id => $bundles) {
$enabled_entity_types[] = $entity_type_id;
foreach($bundles as $bundle_name => $bundle_settings) {
foreach ($bundles as $bundle_name => $bundle_settings) {
\Drupal::service('config.factory')
->getEditable("simple_sitemap.bundle_settings.$entity_type_id.$bundle_name")
->setData($bundle_settings)->save();
......@@ -302,7 +302,7 @@ function simple_sitemap_update_8205() {
*/
function simple_sitemap_update_8206() {
$custom_links = \Drupal::config('simple_sitemap.custom')->get();
foreach($custom_links as $i => $custom_link) {
foreach ($custom_links as $i => $custom_link) {
if (!isset($custom_link['path'])) {
unset($custom_links[$i]);
}
......
......@@ -340,7 +340,7 @@ class Simplesitemap {
// Deleting inclusion settings.
$config_names = $this->configFactory->listAll("simple_sitemap.bundle_settings.$entity_type_id.");
foreach($config_names as $config_name) {
foreach ($config_names as $config_name) {
$this->configFactory->getEditable($config_name)->delete();
}
......@@ -377,7 +377,7 @@ class Simplesitemap {
$bundle_settings = $this->configFactory
->getEditable("simple_sitemap.bundle_settings.$entity_type_id.$bundle_name");
foreach($settings as $setting_key => $setting) {
foreach ($settings as $setting_key => $setting) {
if ($setting_key === 'index') {
$setting = intval($setting);
}
......@@ -408,7 +408,7 @@ class Simplesitemap {
}
$delete_instances = [];
foreach($query->execute()->fetchAll() as $result) {
foreach ($query->execute()->fetchAll() as $result) {
$delete = TRUE;
$instance_settings = unserialize($result->inclusion_settings);
foreach ($instance_settings as $setting_key => $instance_setting) {
......@@ -458,7 +458,7 @@ class Simplesitemap {
else {
$config_names = $this->configFactory->listAll('simple_sitemap.bundle_settings.');
$all_settings = [];
foreach($config_names as $config_name) {
foreach ($config_names as $config_name) {
$config_name_parts = explode('.', $config_name);
$all_settings[$config_name_parts[2]][$config_name_parts[3]] = $this->configFactory->get($config_name)->get();
}
......
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