Fixed code style.

This commit is contained in:
Jan Böhmer 2020-08-21 22:44:38 +02:00
parent e01b06fb85
commit e73a90a234
24 changed files with 30 additions and 58 deletions

View file

@ -178,10 +178,10 @@ class AttachmentFormType extends AbstractType
if ($attachment instanceof Attachment && $file instanceof UploadedFile && $attachment->getAttachmentType(
) && !$this->submitHandler->isValidFileExtension($attachment->getAttachmentType(), $file)) {
$event->getForm()->get('file')->addError(
$event->getForm()->get('file')->addError(
new FormError($this->translator->trans('validator.file_ext_not_allowed'))
);
}
}
});
//Check the secure file checkbox, if file is in securefile location

View file

@ -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!');

View file

@ -83,13 +83,13 @@ class MasterPictureAttachmentType extends AbstractType
'choice_loader' => static function (Options $options) {
return new CallbackChoiceLoader(
static function () use ($options) {
$entity = $options['entity'];
if (!$entity instanceof AttachmentContainingDBElement) {
throw new \RuntimeException('$entity must have Attachments! (be of type AttachmentContainingDBElement)');
}
$entity = $options['entity'];
if (!$entity instanceof AttachmentContainingDBElement) {
throw new \RuntimeException('$entity must have Attachments! (be of type AttachmentContainingDBElement)');
}
return $entity->getAttachments()->toArray();
});
return $entity->getAttachments()->toArray();
});
},
]);