Applied code style rules to src/

This commit is contained in:
Jan Böhmer 2020-01-05 15:46:58 +01:00
parent 700c049d26
commit f861de791f
186 changed files with 1462 additions and 1059 deletions

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -38,7 +41,7 @@ class PermissionGroupType extends AbstractType
$this->perm_structure = $resolver->getPermissionStructure();
}
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$permissions = $this->perm_structure['perms'];
@ -66,7 +69,7 @@ class PermissionGroupType extends AbstractType
}
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
parent::configureOptions($resolver);
@ -77,7 +80,7 @@ class PermissionGroupType extends AbstractType
$resolver->setDefault('inherit', false);
$resolver->setDefault('label', function (Options $options) {
if (!empty($this->perm_structure['groups'][$options['group_name']]['label'])) {
if (! empty($this->perm_structure['groups'][$options['group_name']]['label'])) {
return $this->perm_structure['groups'][$options['group_name']]['label'];
}

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -41,7 +44,7 @@ class PermissionType extends AbstractType
$this->perm_structure = $resolver->getPermissionStructure();
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
parent::configureOptions($resolver);
@ -50,7 +53,7 @@ class PermissionType extends AbstractType
});
$resolver->setDefault('label', function (Options $options) {
if (!empty($this->perm_structure['perms'][$options['perm_name']]['label'])) {
if (! empty($this->perm_structure['perms'][$options['perm_name']]['label'])) {
return $this->perm_structure['perms'][$options['perm_name']]['label'];
}
@ -58,7 +61,7 @@ class PermissionType extends AbstractType
});
$resolver->setDefault('multi_checkbox', function (Options $options) {
return !$options['disabled'];
return ! $options['disabled'];
});
$resolver->setDefaults([
@ -66,7 +69,7 @@ class PermissionType extends AbstractType
]);
}
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$operations = $this->perm_structure['perms'][$options['perm_name']]['operations'];
@ -82,7 +85,7 @@ class PermissionType extends AbstractType
$builder->setDataMapper(new PermissionsMapper($this->resolver, $options['inherit']));
}
public function buildView(FormView $view, FormInterface $form, array $options)
public function buildView(FormView $view, FormInterface $form, array $options): void
{
$view->vars['multi_checkbox'] = $options['multi_checkbox'];
}

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -49,7 +52,7 @@ class PermissionsMapper implements DataMapperInterface
* @param mixed $viewData View data of the compound form being initialized
* @param FormInterface[]|\Traversable $forms A list of {@link FormInterface} instances
*/
public function mapDataToForms($viewData, $forms)
public function mapDataToForms($viewData, $forms): void
{
foreach ($forms as $form) {
if ($this->inherit) {
@ -96,7 +99,7 @@ class PermissionsMapper implements DataMapperInterface
* @param mixed $viewData The compound form's view data that get mapped
* its children model data
*/
public function mapFormsToData($forms, &$viewData)
public function mapFormsToData($forms, &$viewData): void
{
if ($this->inherit) {
throw new \RuntimeException('The permission type is readonly when it is showing read only data!');

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -41,12 +44,12 @@ class PermissionsType extends AbstractType
$this->perm_structure = $resolver->getPermissionStructure();
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'show_legend' => true,
'constraints' => function (Options $options) {
if (!$options['disabled']) {
if (! $options['disabled']) {
return [new NoLockout()];
}
@ -56,12 +59,12 @@ class PermissionsType extends AbstractType
]);
}
public function buildView(FormView $view, FormInterface $form, array $options)
public function buildView(FormView $view, FormInterface $form, array $options): void
{
$view->vars['show_legend'] = $options['show_legend'];
}
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$groups = $this->perm_structure['groups'];