Skip to content

Commit e8c9781

Browse files
cleanup syntax
1 parent 48fad03 commit e8c9781

File tree

67 files changed

+110
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+110
-124
lines changed

src/Command/PhpunitCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6161
if (Response::HTTP_NOT_FOUND == $callResponse->getCode()) {
6262
$json = [
6363
'settings' => $this->appManager->getSettings('.elasticsearch-admin-users'),
64-
'aliases' => ['.elasticsearch-admin-users' => (object)[]],
64+
'aliases' => ['.elasticsearch-admin-users' => (object) []],
6565
];
6666
if (true === $this->callManager->checkVersion('7.0')) {
6767
$json['mappings'] = $this->appManager->getMappings('.elasticsearch-admin-users');

src/Controller/AppExceptionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function read(Request $request, FlattenException $exception, RequestStack
2828
if (true === in_array($exception->getStatusCode(), $codes)) {
2929
$user = $security->getUser();
3030

31-
if (!$user instanceof AppUserModel) {
31+
if (! $user instanceof AppUserModel) {
3232
$parameters['firewall'] = false;
3333
}
3434

src/Controller/AppIndexDatabaseImportController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function mappings(Request $request, string $index): JsonResponse
118118
if ($id) {
119119
$body .= json_encode(['index' => ['_id' => $id]])."\r\n";
120120
} else {
121-
$body .= json_encode(['index' => (object)[]])."\r\n";
121+
$body .= json_encode(['index' => (object) []])."\r\n";
122122
}
123123

124124
$body .= json_encode($line)."\r\n";

src/Controller/AppSecurityController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function register(Request $request): Response
9292
try {
9393
$json = [
9494
'settings' => $this->appManager->getSettings('.elasticsearch-admin-users'),
95-
'aliases' => ['.elasticsearch-admin-users' => (object)[]],
95+
'aliases' => ['.elasticsearch-admin-users' => (object) []],
9696
];
9797
if (true === $this->callManager->checkVersion('7.0')) {
9898
$json['mappings'] = $this->appManager->getMappings('.elasticsearch-admin-users');

src/Controller/ElasticsearchClusterController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public function audit(Request $request, string $elasticsearchUsername, string $e
451451
$results['audit_notice'][$checkpoint] = [];
452452
} else {
453453
if (true === isset($parameters['cluster_stats']['indices']['shards']['replication'])) {
454-
$replication = round($parameters['cluster_stats']['indices']['shards']['replication']*100, 2).'%';
454+
$replication = round($parameters['cluster_stats']['indices']['shards']['replication'] * 100, 2).'%';
455455
} else {
456456
$replication = null;
457457
}

src/Controller/ElasticsearchIndexController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ public function readImport(Request $request, string $index): Response
541541
$body .= json_encode(['index' => ['_id' => $id]])."\r\n";
542542
}
543543
} else {
544-
$body .= json_encode(['index' => (object)[]])."\r\n";
544+
$body .= json_encode(['index' => (object) []])."\r\n";
545545
}
546546

547547
$body .= json_encode($line)."\r\n";

src/Controller/ElasticsearchTaskController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function index(Request $request): Response
7979
* @param array<mixed> $a
8080
* @param array<mixed> $b
8181
*/
82-
private function sortByStartTime(array $a, array $b): int
82+
private function sortByStartTime(array $a, array $b): int
8383
{
8484
return $b['start_time_in_millis'] <=> $a['start_time_in_millis'];
8585
}

src/Form/Type/AppRoleType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
5757
}
5858
}
5959

60-
$builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) use ($options) {
60+
$builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) use ($options): void {
6161
$form = $event->getForm();
6262
$data = $event->getData();
6363

src/Form/Type/AppSubscriptionType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
109109
$builder->add('notifications', ChoiceType::class, [
110110
'multiple' => true,
111111
'choices' => AppNotificationModel::getTypes(),
112-
'choice_label' => function ($choice, $key, $value) {
112+
'choice_label' => static function ($choice, $key, $value) {
113113
return $value;
114114
},
115115
'choice_translation_domain' => false,
@@ -120,7 +120,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
120120
}
121121
}
122122

123-
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($options) {
123+
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($options): void {
124124
$form = $event->getForm();
125125

126126
if ($form->has('endpoint') && $form->get('endpoint')->getData()) {

src/Form/Type/AppUserType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
9797
'type' => PasswordType::class,
9898
'required' => $passwordRequired,
9999
'constraints' => $passwordConstraints,
100-
'first_options' => [
100+
'first_options' => [
101101
'label' => 'password',
102102
'attr' => [
103103
'autocomplete' => 'new-password',
@@ -115,7 +115,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
115115
$builder->add('roles', ChoiceType::class, [
116116
'multiple' => true,
117117
'choices' => $options['roles'],
118-
'choice_label' => function ($choice, $key, $value) use ($options) {
118+
'choice_label' => static function ($choice, $key, $value) use ($options) {
119119
return $options['roles'][$key];
120120
},
121121
'choice_translation_domain' => false,
@@ -129,7 +129,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
129129
}
130130
}
131131

132-
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($options) {
132+
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($options): void {
133133
$form = $event->getForm();
134134

135135
if ('register' == $options['context']) {

0 commit comments

Comments
 (0)