mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-26 04:49:32 +00:00
Fixed some inspection issues.
This commit is contained in:
parent
6caf605fe2
commit
e01b06fb85
80 changed files with 173 additions and 218 deletions
|
|
@ -69,11 +69,8 @@ class PermissionGroupType extends AbstractType
|
|||
if ($permission['group'] !== $options['group_name']) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
//Skip perrmissions without groups unless we have this as blanko group
|
||||
if ('*' !== $options['group_name']) {
|
||||
continue;
|
||||
}
|
||||
} elseif ('*' !== $options['group_name']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$builder->add($key, PermissionType::class, [
|
||||
|
|
@ -91,7 +88,7 @@ class PermissionGroupType extends AbstractType
|
|||
{
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
$resolver->setDefault('group_name', function (Options $options) {
|
||||
$resolver->setDefault('group_name', static function (Options $options) {
|
||||
return trim($options['name']);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class PermissionType extends AbstractType
|
|||
{
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
$resolver->setDefault('perm_name', function (Options $options) {
|
||||
$resolver->setDefault('perm_name', static function (Options $options) {
|
||||
return $options['name'];
|
||||
});
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ class PermissionType extends AbstractType
|
|||
return $options['name'];
|
||||
});
|
||||
|
||||
$resolver->setDefault('multi_checkbox', function (Options $options) {
|
||||
$resolver->setDefault('multi_checkbox', static function (Options $options) {
|
||||
return !$options['disabled'];
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ final 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): void
|
||||
public function mapDataToForms($viewData, $forms)
|
||||
{
|
||||
foreach ($forms as $form) {
|
||||
if ($this->inherit) {
|
||||
|
|
@ -119,7 +119,7 @@ final 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): void
|
||||
public function mapFormsToData($forms, &$viewData) :void
|
||||
{
|
||||
if ($this->inherit) {
|
||||
throw new RuntimeException('The permission type is readonly when it is showing read only data!');
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class PermissionsType extends AbstractType
|
|||
{
|
||||
$resolver->setDefaults([
|
||||
'show_legend' => true,
|
||||
'constraints' => function (Options $options) {
|
||||
'constraints' => static function (Options $options) {
|
||||
if (!$options['disabled']) {
|
||||
return [new NoLockout()];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue