Skip to content

Commit 6099f8b

Browse files
committed
Minor: Format code
1 parent 355f71b commit 6099f8b

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

src/CoreBundle/Controller/SocialController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public function getUserProfile(
485485
$baseUrl = $requestStack->getCurrentRequest()->getBaseUrl();
486486
$profileFieldsVisibilityJson = $settingsManager->getSetting('profile.profile_fields_visibility');
487487
$decoded = json_decode($profileFieldsVisibilityJson, true);
488-
$profileFieldsVisibility = (is_array($decoded) && isset($decoded['options']))
488+
$profileFieldsVisibility = (\is_array($decoded) && isset($decoded['options']))
489489
? $decoded['options']
490490
: [];
491491

@@ -533,7 +533,7 @@ private function getExtraFieldBlock(
533533

534534
$fieldVisibilityConfig = $settingsManager->getSetting('profile.profile_fields_visibility');
535535
$decoded = json_decode($fieldVisibilityConfig, true);
536-
$fieldVisibility = (is_array($decoded) && isset($decoded['options']))
536+
$fieldVisibility = (\is_array($decoded) && isset($decoded['options']))
537537
? $decoded['options']
538538
: [];
539539

@@ -568,6 +568,7 @@ private function getExtraFieldBlock(
568568
}
569569

570570
break;
571+
571572
case ExtraField::FIELD_TYPE_GEOLOCALIZATION_COORDINATES:
572573
case ExtraField::FIELD_TYPE_GEOLOCALIZATION:
573574
$geoData = explode('::', $fieldValue);

src/CoreBundle/Form/ProfileType.php

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Chamilo\CoreBundle\Form\Type\IllustrationType;
1111
use Chamilo\CoreBundle\Repository\LanguageRepository;
1212
use Chamilo\CoreBundle\Settings\SettingsManager;
13+
use DateTimeZone;
1314
use Symfony\Component\Form\AbstractType;
1415
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
1516
use Symfony\Component\Form\Extension\Core\Type\EmailType;
@@ -31,35 +32,35 @@ public function __construct(
3132
public function buildForm(FormBuilderInterface $builder, array $options): void
3233
{
3334
$changeableOptions = $this->settingsManager->getSetting('profile.changeable_options', true) ?? [];
34-
$visibleOptions = $this->settingsManager->getSetting('profile.visible_options', true) ?? [];
35+
$visibleOptions = $this->settingsManager->getSetting('profile.visible_options', true) ?? [];
3536

3637
$languages = array_flip($this->languageRepository->getAllAvailableToArray(true));
3738

3839
$fieldsMap = [
39-
'name' => ['field' => 'firstname', 'type' => TextType::class, 'label' => 'Firstname'],
40-
'officialcode' => ['field' => 'official_code', 'type' => TextType::class, 'label' => 'Official Code'],
41-
'email' => ['field' => 'email', 'type' => EmailType::class, 'label' => 'Email'],
42-
'picture' => [
43-
'field' => 'illustration',
44-
'type' => IllustrationType::class,
45-
'label' => 'Picture',
40+
'name' => ['field' => 'firstname', 'type' => TextType::class, 'label' => 'Firstname'],
41+
'officialcode' => ['field' => 'official_code', 'type' => TextType::class, 'label' => 'Official Code'],
42+
'email' => ['field' => 'email', 'type' => EmailType::class, 'label' => 'Email'],
43+
'picture' => [
44+
'field' => 'illustration',
45+
'type' => IllustrationType::class,
46+
'label' => 'Picture',
4647
'mapped' => false,
4748
],
48-
'login' => ['field' => 'login', 'type' => TextType::class, 'label' => 'Login'],
49+
'login' => ['field' => 'login', 'type' => TextType::class, 'label' => 'Login'],
4950
'password' => [
50-
'field' => 'password',
51-
'type' => PasswordType::class,
52-
'label' => 'Password',
53-
'mapped' => false,
51+
'field' => 'password',
52+
'type' => PasswordType::class,
53+
'label' => 'Password',
54+
'mapped' => false,
5455
'required' => false,
5556
],
5657
'language' => [
57-
'field' => 'locale',
58-
'type' => ChoiceType::class,
59-
'label' => 'Language',
60-
'choices' => $languages,
61-
'required' => true,
62-
'placeholder'=> null,
58+
'field' => 'locale',
59+
'type' => ChoiceType::class,
60+
'label' => 'Language',
61+
'choices' => $languages,
62+
'required' => true,
63+
'placeholder' => null,
6364
'choice_translation_domain' => false,
6465
],
6566
'phone' => ['field' => 'phone', 'type' => TextType::class, 'label' => 'Phone Number'],
@@ -71,9 +72,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
7172
$isEditable = \in_array($key, $changeableOptions, true);
7273

7374
$options = [
74-
'label' => $fieldConfig['label'],
75+
'label' => $fieldConfig['label'],
7576
'required' => $fieldConfig['required'] ?? false,
76-
'mapped' => $fieldConfig['mapped'] ?? true,
77+
'mapped' => $fieldConfig['mapped'] ?? true,
7778
];
7879

7980
if (isset($fieldConfig['choices'])) {
@@ -95,16 +96,16 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
9596
}
9697

9798
if ('true' === $this->settingsManager->getSetting('profile.use_users_timezone', true)) {
98-
$timezones = \DateTimeZone::listIdentifiers();
99+
$timezones = DateTimeZone::listIdentifiers();
99100
sort($timezones);
100101
$timezoneChoices = array_combine($timezones, $timezones);
101102

102103
$builder->add(
103104
'timezone',
104105
ChoiceType::class,
105106
[
106-
'label' => 'Timezone',
107-
'choices' => $timezoneChoices,
107+
'label' => 'Timezone',
108+
'choices' => $timezoneChoices,
108109
'required' => false,
109110
'placeholder' => '',
110111
'choice_translation_domain' => false,

0 commit comments

Comments
 (0)