mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-20 10:57:40 +02:00
Fixed code style.
This commit is contained in:
parent
e01b06fb85
commit
e73a90a234
24 changed files with 30 additions and 58 deletions
|
@ -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
|
||||
|
|
|
@ -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!');
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue