From 8dd3e6d43334e776323237f1ce3f9c62d1a678cf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:53:31 +0100 Subject: [PATCH] [CS] Refactor (#506) Co-authored-by: DACHCOM Bot --- src/Assembler/FormAssembler.php | 14 ++++++- .../FunnelActionElementAssembler.php | 13 ++++++- src/Builder/ExtJsFormBuilder.php | 25 +++++++------ src/Builder/FrontendFormBuilder.php | 16 +++++--- src/Configuration/Configuration.php | 12 +++++- src/Controller/Admin/ExportController.php | 14 ++++++- src/Controller/Admin/MailEditorController.php | 17 ++++++--- .../Admin/OutputWorkflowApiController.php | 15 ++++++-- .../Admin/OutputWorkflowController.php | 16 +++++--- .../Admin/OutputWorkflowFunnelController.php | 12 +++++- .../Admin/OutputWorkflowObjectController.php | 11 ++++++ src/Controller/Admin/SettingsController.php | 16 +++++++- src/Controller/AjaxController.php | 11 ++++++ src/Controller/EmailController.php | 11 ++++++ src/Controller/FunnelController.php | 12 +++++- .../CompilerPass/ApiProviderPass.php | 11 ++++++ .../CompilerPass/ChoiceBuilderPass.php | 11 ++++++ .../CompilerPass/DataInjectionPass.php | 11 ++++++ .../CompilerPass/DispatcherPass.php | 11 ++++++ .../DynamicMultiFileAdapterPass.php | 11 ++++++ .../DynamicObjectResolverPass.php | 11 ++++++ .../CompilerPass/FieldTransformerPass.php | 11 ++++++ .../CompilerPass/MailEditorWidgetPass.php | 11 ++++++ .../CompilerPass/OptionsTransformerPass.php | 11 ++++++ .../OutputInputTransformerPass.php | 11 ++++++ .../OutputWorkflowChannelPass.php | 11 ++++++ .../OutputWorkflowFunnelActionPass.php | 11 ++++++ .../OutputWorkflowFunnelLayerPass.php | 11 ++++++ .../CompilerPass/RuntimeDataProviderPass.php | 11 ++++++ .../CompilerPass/StorageProviderPass.php | 11 ++++++ src/DependencyInjection/Configuration.php | 14 ++++++- .../FormBuilderExtension.php | 18 +++++++-- src/Doctrine/Type/FormBuilderFieldsType.php | 19 ++++++++-- src/Document/Areabrick/Form/Form.php | 13 ++++++- .../Areabrick/Form/FormDialogBuilder.php | 15 +++++++- .../Adapter/DropZoneAdapter.php | 12 +++++- .../DynamicMultiFileAdapterInterface.php | 11 ++++++ .../Adapter/FineUploadAdapter.php | 13 ++++++- src/Event/BaseSubmissionEvent.php | 14 ++++++- src/Event/DoubleOptInSubmissionEvent.php | 12 +++++- src/Event/Form/FormTypeOptionsEvent.php | 11 ++++++ src/Event/Form/PostSetDataEvent.php | 13 ++++++- src/Event/Form/PreSetDataEvent.php | 13 ++++++- src/Event/Form/PreSubmitEvent.php | 13 ++++++- src/Event/FormAssembleEvent.php | 11 ++++++ .../ChannelSubjectGuardEvent.php | 11 ++++++ .../OutputWorkflowSignalEvent.php | 11 ++++++ .../OutputWorkflowSignalsEvent.php | 11 ++++++ src/Event/SubmissionEvent.php | 12 +++++- src/EventListener/Admin/AssetListener.php | 11 ++++++ .../Core/FunnelFormAssemblingListener.php | 11 ++++++ .../Core/FunnelRouteListener.php | 17 ++++++++- src/EventListener/Core/MailParamListener.php | 11 ++++++ src/EventListener/Core/RequestListener.php | 18 ++++++--- src/EventSubscriber/FormBuilderSubscriber.php | 37 ++++++++++++------- .../SignalStorage/ArraySignalStorage.php | 11 ++++++ .../SignalStorage/FormDataSignalStorage.php | 12 +++++- .../ProviderAwareStorageInterface.php | 11 ++++++ .../SignalStorage/SignalStorageInterface.php | 13 ++++++- .../SignalSubscribeHandler.php | 13 ++++++- src/Exception/DoubleOptInException.php | 11 ++++++ ...ptInUniqueConstraintViolationException.php | 11 ++++++ .../OutputWorkflow/GuardChannelException.php | 11 ++++++ .../OutputWorkflow/GuardException.php | 11 ++++++ .../GuardOutputWorkflowException.php | 11 ++++++ .../OutputWorkflow/GuardStackedException.php | 11 ++++++ src/Factory/FormDataFactory.php | 11 ++++++ src/Factory/FormDataFactoryInterface.php | 11 ++++++ src/Factory/FormDefinitionFactory.php | 11 ++++++ .../FormDefinitionFactoryInterface.php | 11 ++++++ src/Factory/ObjectResolverFactory.php | 13 ++++++- .../ObjectResolverFactoryInterface.php | 11 ++++++ src/Factory/OutputWorkflowFactory.php | 11 ++++++ .../OutputWorkflowFactoryInterface.php | 11 ++++++ .../Api/DataMappingElementCollectionType.php | 14 +++++-- .../Api/DataMappingElementConfigType.php | 13 ++++++- .../Channel/Api/FieldConfigType.php | 11 ++++++ .../OutputWorkflow/Channel/ApiChannelType.php | 11 ++++++ .../Channel/EmailChannelType.php | 23 +++++++++--- .../Action/FunnelActionCoreConfigType.php | 11 ++++++ .../Funnel/Action/FunnelActionType.php | 12 +++++- .../Action/FunnelActionsCollectionType.php | 11 ++++++ .../Funnel/Action/Type/ChannelActionType.php | 11 ++++++ .../Funnel/Action/Type/DisabledActionType.php | 11 ++++++ .../Action/Type/ReturnToFormActionType.php | 11 ++++++ .../Funnel/Layer/DynamicLayoutLayerType.php | 11 ++++++ .../Channel/FunnelChannelType.php | 12 +++++- .../Channel/Object/FieldConfigType.php | 15 +++++++- .../ObjectMappingElementCollectionType.php | 11 ++++++ .../Object/ObjectMappingElementConfigType.php | 11 ++++++ .../Worker/FieldCollectionWorkerType.php | 15 +++++++- .../Object/Worker/RelationWorkerType.php | 11 ++++++ .../Validation/ValidationCollectionType.php | 11 ++++++ .../Worker/Validation/ValidationType.php | 11 ++++++ .../Channel/ObjectChannelType.php | 15 +++++++- .../Component/FixedCollectionType.php | 11 ++++++ .../LocalizedValuesCollectionType.php | 11 ++++++ .../OutputWorkflowChannelChoiceType.php | 11 ++++++ .../Component/PimcoreHrefType.php | 11 ++++++ .../OutputWorkflowChannelCollectionType.php | 19 ++++++++-- .../OutputWorkflowChannelType.php | 16 ++++++-- .../OutputWorkflowCollectionType.php | 11 ++++++ .../OutputWorkflow/OutputWorkflowType.php | 13 ++++++- .../OutputWorkflow/SuccessManagementType.php | 11 ++++++ src/Form/AdvancedChoiceBuilderInterface.php | 11 ++++++ src/Form/ChoiceBuilderInterface.php | 11 ++++++ src/Form/Data/FormData.php | 11 ++++++ src/Form/Data/FormDataInterface.php | 11 ++++++ .../DataInjector/DataInjectorInterface.php | 11 ++++++ .../DataInjector/ExpressionDataInjector.php | 11 ++++++ src/Form/Extension/HelpExtension.php | 11 ++++++ src/Form/FormErrorsSerializer.php | 13 ++++++- src/Form/FormErrorsSerializerInterface.php | 11 ++++++ src/Form/FormValuesInputApplier.php | 12 +++++- src/Form/FormValuesInputApplierInterface.php | 11 ++++++ src/Form/FormValuesOutputApplier.php | 15 ++++++-- src/Form/FormValuesOutputApplierInterface.php | 11 ++++++ .../RuntimeData/FormRuntimeDataAllocator.php | 12 +++++- .../FormRuntimeDataAllocatorInterface.php | 11 ++++++ ...dlessAwareRuntimeDataProviderInterface.php | 11 ++++++ .../DoubleOptInSessionDataProvider.php | 11 ++++++ .../Provider/RequestDataProvider.php | 11 ++++++ src/Form/RuntimeData/RuntimeDataCollector.php | 11 ++++++ .../RuntimeDataProviderInterface.php | 11 ++++++ src/Form/Type/CloudflareTurnstileType.php | 11 ++++++ src/Form/Type/Container/ContainerType.php | 11 ++++++ .../Type/Container/FieldSetContainerType.php | 11 ++++++ .../Type/Container/RepeaterContainerType.php | 11 ++++++ .../Type/Container/Traits/ContainerTrait.php | 11 ++++++ src/Form/Type/ContainerCollectionType.php | 11 ++++++ src/Form/Type/DoubleOptInType.php | 11 ++++++ src/Form/Type/DynamicChoiceType.php | 11 ++++++ src/Form/Type/DynamicFormType.php | 13 ++++++- .../Type/DynamicMultiFile/DropZoneType.php | 11 ++++++ .../DynamicMultiFile/FineUploaderType.php | 11 ++++++ src/Form/Type/DynamicMultiFileType.php | 11 ++++++ src/Form/Type/FriendlyCaptchaType.php | 11 ++++++ src/Form/Type/HoneypotType.php | 11 ++++++ src/Form/Type/HtmlTagType.php | 11 ++++++ src/Form/Type/InstructionsType.php | 11 ++++++ src/Form/Type/LayerType.php | 12 +++++- src/Form/Type/Recaptcha3Type.php | 11 ++++++ src/Form/Type/SnippetType.php | 13 ++++++- src/FormBuilderBundle.php | 11 ++++++ src/FormBuilderEvents.php | 12 ++++++ src/MailEditor/AttributeBag.php | 11 ++++++ src/MailEditor/Parser/PlaceholderParser.php | 14 ++++++- .../Parser/PlaceholderParserInterface.php | 11 ++++++ .../Parser/TemplateParser/InkyParser.php | 11 ++++++ .../Parser/TemplateParser/PlainTextParser.php | 11 ++++++ .../TemplateParserInterface.php | 11 ++++++ src/MailEditor/TemplateGenerator.php | 14 +++++-- src/MailEditor/Widget/DateWidget.php | 11 ++++++ ...DoubleOptInSessionAdditionalDataWidget.php | 13 ++++++- .../Widget/DoubleOptInSessionEmailWidget.php | 12 +++++- src/MailEditor/Widget/FormFieldWidget.php | 14 ++++++- .../MailEditorFieldDataWidgetInterface.php | 11 ++++++ .../Widget/MailEditorWidgetInterface.php | 11 ++++++ src/Maintenance/CleanUpTask.php | 11 ++++++ .../DisposableEmailDomainFetchTask.php | 13 ++++++- src/Manager/DoubleOptInManager.php | 16 ++++++-- src/Manager/FormDefinitionManager.php | 11 ++++++ src/Manager/OutputWorkflowManager.php | 36 ++++++++++++------ src/Manager/PresetManager.php | 11 ++++++ src/Manager/TemplateManager.php | 11 ++++++ src/Migrations/Version20230830183642.php | 14 +++++-- src/Migrations/Version20230908101855.php | 21 +++++++---- src/Migrations/Version20240628143429.php | 11 ++++++ src/Migrations/Version20240819150642.php | 11 ++++++ src/Migrations/Version20240916132702.php | 11 ++++++ src/Model/DoubleOptInSession.php | 11 ++++++ src/Model/DoubleOptInSessionInterface.php | 11 ++++++ src/Model/FieldDefinitionInterface.php | 11 ++++++ src/Model/FormDefinition.php | 11 ++++++ src/Model/FormDefinitionInterface.php | 11 ++++++ src/Model/FormFieldContainerDefinition.php | 11 ++++++ .../FormFieldContainerDefinitionInterface.php | 11 ++++++ src/Model/FormFieldDefinition.php | 11 ++++++ src/Model/FormFieldDefinitionInterface.php | 11 ++++++ src/Model/FormFieldDynamicDefinition.php | 11 ++++++ .../FormFieldDynamicDefinitionInterface.php | 11 ++++++ src/Model/FormStorageData.php | 12 +++++- .../Fragment/EntityToArrayAwareInterface.php | 11 ++++++ .../Fragment/SubFieldsAwareInterface.php | 11 ++++++ src/Model/FunnelActionDefinition.php | 11 ++++++ src/Model/FunnelActionElement.php | 11 ++++++ src/Model/OutputWorkflow.php | 11 ++++++ src/Model/OutputWorkflowChannel.php | 11 ++++++ src/Model/OutputWorkflowChannelInterface.php | 11 ++++++ src/Model/OutputWorkflowInterface.php | 11 ++++++ src/OutputWorkflow/Channel/Api/ApiData.php | 11 ++++++ .../Channel/Api/ApiOutputChannel.php | 11 ++++++ .../Channel/Api/ApiOutputChannelWorker.php | 18 ++++++--- .../Channel/Api/ApiProviderInterface.php | 11 ++++++ src/OutputWorkflow/Channel/ChannelContext.php | 11 ++++++ .../Channel/ChannelContextAwareInterface.php | 11 ++++++ .../Channel/ChannelInterface.php | 11 ++++++ .../Channel/ChannelResponseAwareInterface.php | 11 ++++++ .../Channel/Email/EmailOutputChannel.php | 15 +++++++- .../Email/EmailOutputChannelWorker.php | 20 +++++++--- .../Channel/Email/Parser/MailParser.php | 28 +++++++++----- .../Channel/Funnel/Action/ChannelAction.php | 19 +++++++--- .../Channel/Funnel/Action/DisabledAction.php | 12 +++++- .../Action/FunnelActionElementStack.php | 11 ++++++ .../Funnel/Action/FunnelActionInterface.php | 11 ++++++ .../Funnel/Action/ReturnToFormAction.php | 13 ++++++- .../Channel/Funnel/FunnelOutputChannel.php | 23 ++++++++---- .../Funnel/Layer/DynamicLayoutLayer.php | 13 ++++++- .../Channel/Funnel/Layer/FunnelLayerData.php | 11 ++++++ .../Funnel/Layer/FunnelLayerInterface.php | 11 ++++++ .../Funnel/Layer/VirtualActionDefinitions.php | 11 ++++++ .../Channel/FunnelAwareChannelInterface.php | 11 ++++++ .../Channel/Object/AbstractObjectResolver.php | 34 ++++++++++------- .../Channel/Object/ExistingObjectResolver.php | 11 ++++++ .../FieldCollectionValidationHelper.php | 11 ++++++ .../Channel/Object/NewObjectResolver.php | 11 ++++++ .../Channel/Object/ObjectOutputChannel.php | 11 ++++++ .../Channel/Trait/ChannelContextTrait.php | 11 ++++++ .../DynamicObjectResolverInterface.php | 11 ++++++ .../ObjectByRuntimeDataResolver.php | 11 ++++++ .../FieldTransformerInterface.php | 11 ++++++ src/OutputWorkflow/FormSubmissionFinisher.php | 16 +++++--- .../FormSubmissionFinisherInterface.php | 11 ++++++ src/OutputWorkflow/FunnelData.php | 11 ++++++ src/OutputWorkflow/FunnelWorker.php | 16 +++++--- src/OutputWorkflow/FunnelWorkerData.php | 11 ++++++ src/OutputWorkflow/FunnelWorkerInterface.php | 11 ++++++ .../OutputWorkflowDispatcher.php | 19 ++++++---- .../OutputWorkflowDispatcherInterface.php | 11 ++++++ src/OutputWorkflow/OutputWorkflowResolver.php | 11 ++++++ .../OutputWorkflowResolverInterface.php | 11 ++++++ .../SuccessManagementWorker.php | 11 ++++++ .../SuccessManagementWorkerInterface.php | 11 ++++++ src/Registry/ApiProviderRegistry.php | 11 ++++++ src/Registry/ChoiceBuilderRegistry.php | 11 ++++++ src/Registry/ConditionalLogicRegistry.php | 15 ++++++-- src/Registry/DataInjectionRegistry.php | 11 ++++++ src/Registry/DispatcherRegistry.php | 11 ++++++ .../DynamicMultiFileAdapterRegistry.php | 11 ++++++ .../DynamicObjectResolverRegistry.php | 11 ++++++ src/Registry/FieldTransformerRegistry.php | 11 ++++++ src/Registry/FunnelActionRegistry.php | 11 ++++++ src/Registry/FunnelLayerRegistry.php | 11 ++++++ src/Registry/InputTransformerRegistry.php | 11 ++++++ src/Registry/MailEditorWidgetRegistry.php | 11 ++++++ src/Registry/OptionsTransformerRegistry.php | 11 ++++++ src/Registry/OutputTransformerRegistry.php | 11 ++++++ .../OutputWorkflowChannelRegistry.php | 11 ++++++ src/Registry/RuntimeDataProviderRegistry.php | 11 ++++++ src/Registry/StorageProviderRegistry.php | 11 ++++++ .../DoubleOptInSessionRepository.php | 11 ++++++ .../DoubleOptInSessionRepositoryInterface.php | 11 ++++++ src/Repository/FormDefinitionRepository.php | 13 ++++++- .../FormDefinitionRepositoryInterface.php | 11 ++++++ src/Repository/OutputWorkflowRepository.php | 11 ++++++ .../OutputWorkflowRepositoryInterface.php | 11 ++++++ src/Resolver/FormOptionsResolver.php | 11 ++++++ src/Resolver/FunnelDataResolver.php | 12 +++++- src/Session/FlashBagManager.php | 11 ++++++ src/Session/FlashBagManagerInterface.php | 11 ++++++ src/Storage/SessionStorageProvider.php | 11 ++++++ src/Storage/StorageProviderInterface.php | 11 ++++++ src/Stream/AttachmentStream.php | 14 +++++-- src/Stream/AttachmentStreamInterface.php | 11 ++++++ src/Stream/File.php | 15 +++++++- src/Stream/FileStack.php | 15 +++++++- src/Stream/FileStream.php | 15 ++++++-- src/Stream/FileStreamInterface.php | 11 ++++++ src/Tool/CloudflareTurnstile/Response.php | 13 ++++++- src/Tool/CloudflareTurnstileProcessor.php | 11 ++++++ .../CloudflareTurnstileProcessorInterface.php | 11 ++++++ src/Tool/FormDependencyLocator.php | 12 +++++- src/Tool/FriendlyCaptcha/Response.php | 13 ++++++- src/Tool/FriendlyCaptchaProcessor.php | 12 +++++- .../FriendlyCaptchaProcessorInterface.php | 11 ++++++ src/Tool/ImportExportProcessor.php | 14 +++++-- src/Tool/Install.php | 13 ++++++- src/Tool/LocaleDataMapper.php | 11 ++++++ src/Tool/ReCaptcha/Response.php | 13 ++++++- src/Tool/ReCaptchaProcessor.php | 11 ++++++ src/Tool/ReCaptchaProcessorInterface.php | 11 ++++++ src/Transformer/ChoicesMetaTransformer.php | 14 ++++++- src/Transformer/ChoicesTransformer.php | 13 ++++++- src/Transformer/DefaultValueTransformer.php | 11 ++++++ .../DynamicOptionsTransformerInterface.php | 11 ++++++ src/Transformer/HrefTransformer.php | 11 ++++++ .../Input/InputTransformerInterface.php | 13 ++++++- .../OptionsTransformerInterface.php | 11 ++++++ .../Output/CheckboxObjectTransformer.php | 11 ++++++ .../Output/ChoiceDataObjectTransformer.php | 15 +++++++- .../Output/CountryDataObjectTransformer.php | 13 ++++++- .../Output/DateDataObjectTransformer.php | 11 ++++++ .../Output/DynamicMultiFileTransformer.php | 14 ++++++- .../Output/FallbackTransformer.php | 11 ++++++ .../Output/OutputTransformerInterface.php | 11 ++++++ .../Traits/ChoiceTargetTransformerTrait.php | 11 ++++++ src/Transformer/Target/TargetAwareData.php | 11 ++++++ .../Target/TargetAwareOutputTransformer.php | 11 ++++++ src/Transformer/Target/TargetAwareValue.php | 11 ++++++ src/Twig/Extension/FlashMessageExtension.php | 11 ++++++ src/Twig/Extension/StaticFormExtension.php | 13 ++++++- .../Dispatcher/Dispatcher.php | 13 ++++++- .../Dispatcher/Module/Constraints.php | 16 ++++++-- .../Module/Data/ConstraintsData.php | 11 ++++++ .../Dispatcher/Module/Data/DataInterface.php | 11 ++++++ .../Module/Data/FormTypeClassesData.php | 11 ++++++ .../Module/Data/SuccessMessageData.php | 11 ++++++ .../Module/Data/SwitchOutputWorkflowData.php | 11 ++++++ .../Dispatcher/Module/FormTypeClasses.php | 11 ++++++ .../Dispatcher/Module/ModuleInterface.php | 11 ++++++ .../Dispatcher/Module/SuccessMessage.php | 11 ++++++ .../Module/SwitchOutputWorkflow.php | 12 +++++- .../ConditionalLogic/Factory/DataFactory.php | 11 ++++++ .../Processor/ConditionalLogicProcessor.php | 12 +++++- .../ReturnStack/FieldReturnStack.php | 11 ++++++ .../ReturnStack/ReturnStackInterface.php | 11 ++++++ .../ReturnStack/SimpleReturnStack.php | 11 ++++++ .../Rule/Action/ActionInterface.php | 13 ++++++- .../Rule/Action/ConstraintsAddAction.php | 11 ++++++ .../Rule/Action/ConstraintsRemoveAction.php | 11 ++++++ .../Rule/Action/SuccessMessageAction.php | 11 ++++++ .../Action/SwitchOutputWorkflowAction.php | 11 ++++++ .../Rule/Action/ToggleClassAction.php | 11 ++++++ .../Rule/Action/ToggleElementAction.php | 11 ++++++ .../Rule/Condition/ConditionInterface.php | 13 ++++++- .../Rule/Condition/ElementValueCondition.php | 15 +++++++- .../Condition/OutputWorkflowCondition.php | 11 ++++++ .../Rule/Traits/ActionTrait.php | 11 ++++++ .../Rule/Traits/ConditionTrait.php | 11 ++++++ .../Constraints/CloudflareTurnstile.php | 11 ++++++ .../CloudflareTurnstileValidator.php | 11 ++++++ .../Constraints/DynamicMultiFileNotBlank.php | 11 ++++++ .../DynamicMultiFileNotBlankValidator.php | 11 ++++++ src/Validator/Constraints/EmailChecker.php | 11 ++++++ .../Constraints/EmailCheckerValidator.php | 11 ++++++ src/Validator/Constraints/FriendlyCaptcha.php | 11 ++++++ .../Constraints/FriendlyCaptchaValidator.php | 11 ++++++ src/Validator/Constraints/Recaptcha3.php | 11 ++++++ .../Constraints/Recaptcha3Validator.php | 11 ++++++ .../DisposableEmailDomainChecker.php | 11 ++++++ .../EmailChecker/EmailCheckerInterface.php | 11 ++++++ .../EmailChecker/EmailCheckerProcessor.php | 12 +++++- 342 files changed, 3908 insertions(+), 280 deletions(-) diff --git a/src/Assembler/FormAssembler.php b/src/Assembler/FormAssembler.php index c610110c..bfdba52e 100644 --- a/src/Assembler/FormAssembler.php +++ b/src/Assembler/FormAssembler.php @@ -1,5 +1,16 @@ getSystemRuntimeData($optionsResolver, $headless); $formAttributes = $optionsResolver->getFormAttributes(); $useCsrfProtection = $optionsResolver->useCsrfProtection(); diff --git a/src/Assembler/FunnelActionElementAssembler.php b/src/Assembler/FunnelActionElementAssembler.php index 756a865c..b04ed298 100644 --- a/src/Assembler/FunnelActionElementAssembler.php +++ b/src/Assembler/FunnelActionElementAssembler.php @@ -1,5 +1,16 @@ setDefaults([ 'initiationPath' => null, @@ -157,5 +167,4 @@ private function isLastChannel(OutputWorkflowInterface $outputWorkflow, OutputWo return $outputWorkflow->getChannels()->last()->getId() === $channel->getId(); } - } diff --git a/src/Builder/ExtJsFormBuilder.php b/src/Builder/ExtJsFormBuilder.php index 78069094..030f034b 100644 --- a/src/Builder/ExtJsFormBuilder.php +++ b/src/Builder/ExtJsFormBuilder.php @@ -1,15 +1,26 @@ outputWorkflowChannelRegistry->getAllIdentifier() as $availableChannel) { - if ($this->outputWorkflowChannelRegistry->isFunnelAwareChannel($availableChannel) && $outputWorkflow->isFunnelWorkflow() === false) { continue; } @@ -269,7 +279,6 @@ private function generateExtJsFormTypesStructure(bool $flat = false): array $fieldStructure = $flat === true ? [] : $this->getFieldTypeGroups(); foreach ($formTypes as $formType => $formTypeConfiguration) { - if (!$this->isAllowedFormType($formType)) { continue; } @@ -546,7 +555,7 @@ private function generateDoubleOptInConfiguration(): array { return $this->configuration->getConfig('double_opt_in'); } - + private function getFormStoreData(): array { $formAttributes = $this->configuration->getConfig('form_attributes'); @@ -605,7 +614,6 @@ private function transformFieldOptions(array &$fieldData, bool $reverse = false) } foreach ($fieldData['options'] as $optionName => $optionValue) { - $optionKey = sprintf('options.%s', $optionName); if (!isset($backendConfig['fields'][$optionKey])) { @@ -652,7 +660,6 @@ private function checkDynamicFieldOptions(&$fieldData, array $formTypeConfig, st } foreach ($dynamicFields as $dynamicFieldName => $dynamicFieldOption) { - $dynamicFieldKey = str_replace('options.', '', $dynamicFieldName); $optionFieldKey = str_replace('options.', '', $optionKey); @@ -667,7 +674,6 @@ private function checkDynamicFieldOptions(&$fieldData, array $formTypeConfig, st $dynamicFieldData = $transformedData; if (!empty($dynamicFieldOption['options_transformer'])) { - /** @var DynamicOptionsTransformerInterface $transformer */ $transformer = $this->optionsTransformerRegistry->getDynamic($dynamicFieldOption['options_transformer']); $dynamicFieldConfig = $dynamicFieldOption['config'] ?? null; @@ -675,7 +681,6 @@ private function checkDynamicFieldOptions(&$fieldData, array $formTypeConfig, st $dynamicFieldData = $reverse === false ? $transformer->transform($rawData, $transformedData, $dynamicFieldConfig) : $transformer->reverseTransform($fieldData['options'][$dynamicFieldKey], $transformedData, $dynamicFieldConfig); - } if ($reverse === true) { @@ -706,14 +711,12 @@ private function transformContainerOptions(array &$fieldData, bool $reverse = fa $currentConfiguration = $fieldData['configuration']; foreach ($containerConfigurations as $containerConfiguration) { - $configName = $containerConfiguration['name']; if (!isset($currentConfiguration[$configName])) { continue; } if (!empty($containerConfiguration['options_transformer'])) { - $blockValue = $currentConfiguration[$configName]; $blockConfig = $containerConfiguration['config']; diff --git a/src/Builder/FrontendFormBuilder.php b/src/Builder/FrontendFormBuilder.php index 33fd58f0..fc90f3ca 100644 --- a/src/Builder/FrontendFormBuilder.php +++ b/src/Builder/FrontendFormBuilder.php @@ -1,5 +1,16 @@ getConfiguration(); $doubleOptInConfig = $formDefinition->getDoubleOptInConfig(); @@ -89,7 +99,6 @@ public function buildForm( array $formData = [], bool $useCsrfProtection = true ): FormInterface { - $defaults = [ 'form_preset' => null, 'form_template' => null @@ -136,7 +145,6 @@ public function buildHeadlessForm( array $formData = [], bool $useCsrfProtection = true ): FormInterface { - $formDefinitionConfig = $formDefinition->getConfiguration(); $formOptions = [ @@ -159,7 +167,6 @@ private function getBuilder( array $formOptions = [], bool $isHeadlessForm = false ): FormBuilderInterface { - $formDefinitionConfig = $formDefinition->getConfiguration(); if (isset($formDefinitionConfig['attributes']) && is_array($formDefinitionConfig['attributes'])) { @@ -188,7 +195,6 @@ private function getBuilder( private function addFormAttributes(array $currentAttributes, array $attributes): array { foreach ($attributes as $attribute) { - // legacy if (!isset($attribute['option'])) { continue; diff --git a/src/Configuration/Configuration.php b/src/Configuration/Configuration.php index c7b38bb9..25fda0df 100644 --- a/src/Configuration/Configuration.php +++ b/src/Configuration/Configuration.php @@ -1,5 +1,16 @@ getProperties(\ReflectionProperty::IS_PUBLIC) as $refProperty) { - $propertyName = $refProperty->getName(); if (in_array($propertyName, $invalidProperties)) { diff --git a/src/Controller/Admin/ExportController.php b/src/Controller/Admin/ExportController.php index 68c8a26f..cb591dc0 100644 --- a/src/Controller/Admin/ExportController.php +++ b/src/Controller/Admin/ExportController.php @@ -1,15 +1,26 @@ $widget) { - $groupName = $widget->getWidgetGroupName(); if (!isset($allWidgets[$groupName])) { @@ -61,10 +71,8 @@ public function getMailEditorDataAction(Request $request): JsonResponse } if ($widget instanceof MailEditorFieldDataWidgetInterface) { - $fieldConfigElements = []; foreach ($formFields as $field) { - $widgetFieldType = $widget->getWidgetIdentifierByField($widgetType, $field); $widgetsConfiguration[$widgetFieldType] = $this->translateWidgetConfig($widget->getWidgetConfigByField($field)); @@ -104,7 +112,6 @@ public function getMailEditorDataAction(Request $request): JsonResponse $allWidgets[$groupName]['elements'] = $fieldConfigElements; $widgetFieldsTemplate = (new TemplateGenerator())->generateWidgetFieldTemplate($fieldConfigElements); - } else { $widgetsConfiguration[$widgetType] = $this->translateWidgetConfig($widget->getWidgetConfig()); $allWidgets[$groupName]['elements'][] = [ diff --git a/src/Controller/Admin/OutputWorkflowApiController.php b/src/Controller/Admin/OutputWorkflowApiController.php index 20247c5d..5dbdb668 100644 --- a/src/Controller/Admin/OutputWorkflowApiController.php +++ b/src/Controller/Admin/OutputWorkflowApiController.php @@ -1,5 +1,16 @@ $service) { - try { $configurationFields = $this->validateApiConfigurationFields($service->getProviderConfigurationFields($formDefinition)); } catch (\Throwable $e) { @@ -112,7 +122,6 @@ public function getApiProviderAction(Request $request): JsonResponse protected function validateApiPredefinedFields(array $fields): array { return array_map(static function ($property) { - if (!is_array($property)) { $property = [ 'label' => $property, @@ -124,7 +133,6 @@ protected function validateApiPredefinedFields(array $fields): array 'label' => $property['label'] ?? 'UNKNOWN', 'value' => $property['value'] ?? 'UNKNOWN' ]; - }, $fields); } @@ -137,7 +145,6 @@ protected function validateApiConfigurationFields(array $fields): array $validatedConfigurationFields = []; foreach ($fields as $field) { - $optionsResolver = new OptionsResolver(); $optionsResolver->setRequired(['type', 'label', 'name', 'required']); $optionsResolver->setAllowedValues('type', ['text', 'select']); diff --git a/src/Controller/Admin/OutputWorkflowController.php b/src/Controller/Admin/OutputWorkflowController.php index 82bd6d0d..203465da 100644 --- a/src/Controller/Admin/OutputWorkflowController.php +++ b/src/Controller/Admin/OutputWorkflowController.php @@ -1,5 +1,16 @@ getOutputWorkflows() as $outputWorkflow) { - $icon = 'pimcore_icon_output_workflow'; if ($outputWorkflow->isFunnelWorkflow()) { $icon = 'pimcore_icon_output_workflow_funnel_aware'; @@ -132,7 +141,6 @@ public function addOutputWorkflowAction(Request $request, int $formId): JsonResp $message = sprintf('Output Workflow with name "%s" already exists!', $name); } else { try { - $outputWorkflow = $this->outputWorkflowManager->save([ 'name' => $name, 'formDefinition' => $formDefinition, @@ -140,7 +148,6 @@ public function addOutputWorkflowAction(Request $request, int $formId): JsonResp ]); $id = $outputWorkflow->getId(); - } catch (\Exception $e) { $success = false; $message = sprintf('Error while creating new output workflow with name "%s". Error was: %s', $name, $e->getMessage()); @@ -200,7 +207,6 @@ public function saveOutputWorkflowAction(Request $request, int $outputWorkflowId if ($form->isValid()) { $this->outputWorkflowManager->saveRawEntity($outputWorkflow); } else { - foreach ($form->getErrors(true, true) as $e) { $errorMessageTemplate = $e->getMessageTemplate(); foreach ($e->getMessageParameters() as $key => $value) { diff --git a/src/Controller/Admin/OutputWorkflowFunnelController.php b/src/Controller/Admin/OutputWorkflowFunnelController.php index 96ab4370..bb1a33fb 100644 --- a/src/Controller/Admin/OutputWorkflowFunnelController.php +++ b/src/Controller/Admin/OutputWorkflowFunnelController.php @@ -1,5 +1,16 @@ $service) { - $funnelActionDefinitions = $service->getFunnelActionDefinitions(); if ($service->dynamicFunnelActionAware() === true && count($funnelActionDefinitions) > 0) { diff --git a/src/Controller/Admin/OutputWorkflowObjectController.php b/src/Controller/Admin/OutputWorkflowObjectController.php index 58d453ae..0722805a 100644 --- a/src/Controller/Admin/OutputWorkflowObjectController.php +++ b/src/Controller/Admin/OutputWorkflowObjectController.php @@ -1,5 +1,16 @@ doubleOptInSessionRepository->find($token); if (!$doubleOptInSession instanceof DoubleOptInSessionInterface) { - return $this->json([ + return $this->json( + [ 'success' => false, 'message' => sprintf('Session %s not found', $token) ] diff --git a/src/Controller/AjaxController.php b/src/Controller/AjaxController.php index efe542e6..070841f2 100644 --- a/src/Controller/AjaxController.php +++ b/src/Controller/AjaxController.php @@ -1,5 +1,16 @@ outputWorkflowRepository->findById($funnelId); if (!$outputWorkflow instanceof OutputWorkflowInterface) { return $this->renderError($request, sprintf('Funnel with id %d not found', $funnelId)); diff --git a/src/DependencyInjection/CompilerPass/ApiProviderPass.php b/src/DependencyInjection/CompilerPass/ApiProviderPass.php index b48b819a..8c3c90a9 100644 --- a/src/DependencyInjection/CompilerPass/ApiProviderPass.php +++ b/src/DependencyInjection/CompilerPass/ApiProviderPass.php @@ -1,5 +1,16 @@ thenUnset() ->end() ->end() - ; + ; return $rootNode; } @@ -751,5 +762,4 @@ private function buildDoubleOptInNode(): NodeDefinition return $rootNode; } - } diff --git a/src/DependencyInjection/FormBuilderExtension.php b/src/DependencyInjection/FormBuilderExtension.php index 158ee26e..e3541def 100644 --- a/src/DependencyInjection/FormBuilderExtension.php +++ b/src/DependencyInjection/FormBuilderExtension.php @@ -1,15 +1,26 @@ setParameter('form_builder.persistence.doctrine.enabled', true); $container->setParameter('form_builder.persistence.doctrine.manager', $entityManagerName); - } private function buildEmailCheckerStack(ContainerBuilder $container, array $config): void diff --git a/src/Doctrine/Type/FormBuilderFieldsType.php b/src/Doctrine/Type/FormBuilderFieldsType.php index 8a9c3eac..dea76628 100644 --- a/src/Doctrine/Type/FormBuilderFieldsType.php +++ b/src/Doctrine/Type/FormBuilderFieldsType.php @@ -1,4 +1,17 @@ -getMethod(); if ($method === 'POST') { - $result = $this->fileStream->handleUpload([ 'binary' => 'qqfile', 'uuid' => 'qquuid', @@ -42,7 +52,6 @@ public function onUpload(Request $request): Response ], false); return new JsonResponse($result); - } if ($method === 'DELETE') { diff --git a/src/Event/BaseSubmissionEvent.php b/src/Event/BaseSubmissionEvent.php index c6d2bddd..25d18a6b 100644 --- a/src/Event/BaseSubmissionEvent.php +++ b/src/Event/BaseSubmissionEvent.php @@ -1,10 +1,21 @@ signalSubscribeHandler->listen( - SignalSubscribeHandler::CHANNEL_FUNNEL_PROCESS, [ + SignalSubscribeHandler::CHANNEL_FUNNEL_PROCESS, + [ 'funnelData' => $this->funnelDataResolver->getFunnelData($event->getRequest()) ] ); @@ -61,7 +73,8 @@ public function setupFunnelExceptionRequest(ExceptionEvent $event): void } $this->signalSubscribeHandler->listen( - SignalSubscribeHandler::CHANNEL_FUNNEL_PROCESS, [ + SignalSubscribeHandler::CHANNEL_FUNNEL_PROCESS, + [ 'funnelData' => $this->funnelDataResolver->getFunnelData($event->getRequest()) ] ); diff --git a/src/EventListener/Core/MailParamListener.php b/src/EventListener/Core/MailParamListener.php index 4d43e63f..3deb8c23 100644 --- a/src/EventListener/Core/MailParamListener.php +++ b/src/EventListener/Core/MailParamListener.php @@ -1,5 +1,16 @@ frontendFormBuilder->buildDoubleOptInForm($formDefinition); } elseif ($formType === self::FORM_TYPE_DEFAULT) { @@ -71,7 +81,6 @@ public function onKernelRequest(RequestEvent $event): void } else { throw new \InvalidArgumentException(sprintf('Invalid form type "%s"', $formType)); } - } catch (\Throwable $e) { $this->generateErroredJsonReturn($event, $e); @@ -215,7 +224,6 @@ protected function detectFormRuntimeDataInRequest(Request $request, FormDefiniti protected function detectFormIdByType(array $values, string $formMatchType = self::FORM_TYPE_DEFAULT): ?int { foreach ($values as $key => $parameters) { - if (!str_contains($key, $formMatchType)) { continue; } diff --git a/src/EventSubscriber/FormBuilderSubscriber.php b/src/EventSubscriber/FormBuilderSubscriber.php index f22f3194..79141cb9 100644 --- a/src/EventSubscriber/FormBuilderSubscriber.php +++ b/src/EventSubscriber/FormBuilderSubscriber.php @@ -1,29 +1,40 @@ configuration->getConfig('funnel'); $signalStorageClass = $funnelConfiguration['signal_storage_class']; diff --git a/src/Exception/DoubleOptInException.php b/src/Exception/DoubleOptInException.php index 6264c748..4744ca1e 100644 --- a/src/Exception/DoubleOptInException.php +++ b/src/Exception/DoubleOptInException.php @@ -1,5 +1,16 @@ $collectionData) { - $hasChildren = isset($collectionData['children']) && count($collectionData['children']) > 0; if ($hasChildren === true) { @@ -33,7 +42,6 @@ function ($data) { if (count($collectionData['config']['apiMapping']) === 0) { unset($data[$index]); } - } return array_values($data); diff --git a/src/Form/Admin/Type/OutputWorkflow/Channel/Api/DataMappingElementConfigType.php b/src/Form/Admin/Type/OutputWorkflow/Channel/Api/DataMappingElementConfigType.php index 99a6a5ba..ebea82cf 100644 --- a/src/Form/Admin/Type/OutputWorkflow/Channel/Api/DataMappingElementConfigType.php +++ b/src/Form/Admin/Type/OutputWorkflow/Channel/Api/DataMappingElementConfigType.php @@ -1,5 +1,16 @@ add('config', FieldConfigType::class); $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { - $data = $event->getData(); $form = $event->getForm(); if (isset($data['children'])) { $form->add('children', DataMappingElementCollectionType::class); } - }); } } diff --git a/src/Form/Admin/Type/OutputWorkflow/Channel/Api/FieldConfigType.php b/src/Form/Admin/Type/OutputWorkflow/Channel/Api/FieldConfigType.php index b218be79..07d2e489 100644 --- a/src/Form/Admin/Type/OutputWorkflow/Channel/Api/FieldConfigType.php +++ b/src/Form/Admin/Type/OutputWorkflow/Channel/Api/FieldConfigType.php @@ -1,5 +1,16 @@ add('mailLayoutData', CollectionType::class, ['allow_add' => true, 'entry_type' => TextType::class]); $builder->get('ignoreFields')->addEventListener( - FormEvents::PRE_SUBMIT, function (FormEvent $event) { - if ($event->getData() === '') { - $event->setData([]); + FormEvents::PRE_SUBMIT, + function (FormEvent $event) { + if ($event->getData() === '') { + $event->setData([]); + } } - }); + ); $builder->get('mailLayoutData') ->addModelTransformer(new CallbackTransformer( diff --git a/src/Form/Admin/Type/OutputWorkflow/Channel/Funnel/Action/FunnelActionCoreConfigType.php b/src/Form/Admin/Type/OutputWorkflow/Channel/Funnel/Action/FunnelActionCoreConfigType.php index 828f4d17..868c82e1 100644 --- a/src/Form/Admin/Type/OutputWorkflow/Channel/Funnel/Action/FunnelActionCoreConfigType.php +++ b/src/Form/Admin/Type/OutputWorkflow/Channel/Funnel/Action/FunnelActionCoreConfigType.php @@ -1,5 +1,16 @@ add('coreConfiguration', FunnelActionCoreConfigType::class); $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { - $data = $event->getData(); $form = $event->getForm(); diff --git a/src/Form/Admin/Type/OutputWorkflow/Channel/Funnel/Action/FunnelActionsCollectionType.php b/src/Form/Admin/Type/OutputWorkflow/Channel/Funnel/Action/FunnelActionsCollectionType.php index 4d3fbcff..48a1164b 100644 --- a/src/Form/Admin/Type/OutputWorkflow/Channel/Funnel/Action/FunnelActionsCollectionType.php +++ b/src/Form/Admin/Type/OutputWorkflow/Channel/Funnel/Action/FunnelActionsCollectionType.php @@ -1,5 +1,16 @@ add('type', TextType::class); $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { - $data = $event->getData(); $form = $event->getForm(); diff --git a/src/Form/Admin/Type/OutputWorkflow/Channel/Object/FieldConfigType.php b/src/Form/Admin/Type/OutputWorkflow/Channel/Object/FieldConfigType.php index 41ba578b..cf9d08fc 100644 --- a/src/Form/Admin/Type/OutputWorkflow/Channel/Object/FieldConfigType.php +++ b/src/Form/Admin/Type/OutputWorkflow/Channel/Object/FieldConfigType.php @@ -1,7 +1,20 @@ setDefaults([ 'auto_initialize' => false, - 'allow_add' => true, - 'allow_delete' => true, - 'by_reference' => false, - 'entry_type' => OutputWorkflowChannelType::class + 'allow_add' => true, + 'allow_delete' => true, + 'by_reference' => false, + 'entry_type' => OutputWorkflowChannelType::class ]); } diff --git a/src/Form/Admin/Type/OutputWorkflow/OutputWorkflowChannelType.php b/src/Form/Admin/Type/OutputWorkflow/OutputWorkflowChannelType.php index d9b9d365..7e39e017 100644 --- a/src/Form/Admin/Type/OutputWorkflow/OutputWorkflowChannelType.php +++ b/src/Form/Admin/Type/OutputWorkflow/OutputWorkflowChannelType.php @@ -1,5 +1,16 @@ add('funnelActions', FunnelActionsCollectionType::class, []); $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { - $data = $event->getData(); $form = $event->getForm(); $formData = $form->getData(); @@ -61,21 +71,19 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $form->add('configuration', $formClass, $formOptions); if (!array_key_exists('name', $data)) { - $name = $formData instanceof OutputWorkflowChannel && !empty($formData->getName()) ? $formData->getName() : Uuid::v1()->toRfc4122(); $event->setData(array_merge($data, ['name' => $name])); } - }); } public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'data_class' => OutputWorkflowChannel::class, + 'data_class' => OutputWorkflowChannel::class, 'property_path' => '[2]' ]); } diff --git a/src/Form/Admin/Type/OutputWorkflow/OutputWorkflowCollectionType.php b/src/Form/Admin/Type/OutputWorkflow/OutputWorkflowCollectionType.php index 80b1cc7b..24891f3f 100644 --- a/src/Form/Admin/Type/OutputWorkflow/OutputWorkflowCollectionType.php +++ b/src/Form/Admin/Type/OutputWorkflow/OutputWorkflowCollectionType.php @@ -1,5 +1,16 @@ add('channels', OutputWorkflowChannelCollectionType::class); $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { - /** @var array $submittedData */ $submittedData = $event->getData(); /** @var OutputWorkflowInterface $outputWorkflow */ @@ -39,6 +49,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void if ($name === $outputWorkflowChannelName) { $newSortedSubmittedChannels[$index] = $channelData; unset($submittedChannels[$submitIndex]); + break; } } diff --git a/src/Form/Admin/Type/OutputWorkflow/SuccessManagementType.php b/src/Form/Admin/Type/OutputWorkflow/SuccessManagementType.php index a8a3daf3..b04bd0d1 100644 --- a/src/Form/Admin/Type/OutputWorkflow/SuccessManagementType.php +++ b/src/Form/Admin/Type/OutputWorkflow/SuccessManagementType.php @@ -1,5 +1,16 @@ getName(); foreach ($form->getErrors(true, true) as $formError) { - $name = ''; $origin = $formError->getOrigin(); $currentFieldName = $origin->getName(); if (!$formError->getCause() instanceof ConstraintViolationInterface) { - if (!isset($errors['general'])) { $errors['general'] = []; } diff --git a/src/Form/FormErrorsSerializerInterface.php b/src/Form/FormErrorsSerializerInterface.php index 479397a6..bdeee614 100644 --- a/src/Form/FormErrorsSerializerInterface.php +++ b/src/Form/FormErrorsSerializerInterface.php @@ -1,5 +1,16 @@ $formFieldValue) { - $fieldDefinition = $formDefinition->getField($fieldName); if (!$fieldDefinition instanceof FieldDefinitionInterface) { continue; diff --git a/src/Form/FormValuesInputApplierInterface.php b/src/Form/FormValuesInputApplierInterface.php index 07539038..76e2558a 100644 --- a/src/Form/FormValuesInputApplierInterface.php +++ b/src/Form/FormValuesInputApplierInterface.php @@ -1,5 +1,16 @@ getName(), $ignoreFields, true)) { continue; } @@ -70,14 +80,12 @@ protected function parseField( mixed $fieldRawValue, array $ignoreFields ): ?array { - if ($fieldDefinition instanceof FormFieldContainerDefinitionInterface) { $subFieldValues = []; foreach ($this->getFormSubFields($formField) as $index => $subFieldCollection) { $subCollectionFieldValues = []; /** @var FormFieldDefinitionInterface $subEntityField */ foreach ($fieldDefinition->getFields() as $subEntityField) { - if (in_array($subEntityField->getName(), $ignoreFields, true)) { continue; } @@ -152,7 +160,6 @@ protected function parseFieldValueWithOutputTransformer( mixed $rawValue, ?string $locale ): ?array { - $defaults = [ 'field_type' => FormValuesOutputApplierInterface::FIELD_TYPE_SIMPLE, 'name' => $fieldDefinition->getName(), diff --git a/src/Form/FormValuesOutputApplierInterface.php b/src/Form/FormValuesOutputApplierInterface.php index 977542aa..24cb2d97 100644 --- a/src/Form/FormValuesOutputApplierInterface.php +++ b/src/Form/FormValuesOutputApplierInterface.php @@ -1,5 +1,16 @@ runtimeDataProviderRegistry->getAll() as $dataProvider) { - if ($headless === true && !$dataProvider instanceof HeadlessAwareRuntimeDataProviderInterface) { continue; } diff --git a/src/Form/RuntimeData/FormRuntimeDataAllocatorInterface.php b/src/Form/RuntimeData/FormRuntimeDataAllocatorInterface.php index 03f48284..fb50a416 100644 --- a/src/Form/RuntimeData/FormRuntimeDataAllocatorInterface.php +++ b/src/Form/RuntimeData/FormRuntimeDataAllocatorInterface.php @@ -1,5 +1,16 @@ add('formCl', HiddenType::class, [ 'mapped' => false, 'data' => $options['conditional_logic'] ?? null, @@ -94,7 +104,6 @@ function ($runtimeData) { ]); $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { - $data = $event->getData(); $runtimeData = $data['formRuntimeData'] ?? null; $tokenValue = $data['formRuntimeDataToken'] ?? null; diff --git a/src/Form/Type/DynamicMultiFile/DropZoneType.php b/src/Form/Type/DynamicMultiFile/DropZoneType.php index f941e9cd..01cfc89a 100644 --- a/src/Form/Type/DynamicMultiFile/DropZoneType.php +++ b/src/Form/Type/DynamicMultiFile/DropZoneType.php @@ -1,5 +1,16 @@ getAll() as $element) { - if ($element->isDisabled()) { continue; } diff --git a/src/Form/Type/Recaptcha3Type.php b/src/Form/Type/Recaptcha3Type.php index 545eb2bf..66feebc2 100644 --- a/src/Form/Type/Recaptcha3Type.php +++ b/src/Form/Type/Recaptcha3Type.php @@ -1,5 +1,16 @@ nodeValue; if ($value === 'true' || $value === 'false') { $value = $value === 'true'; diff --git a/src/MailEditor/Parser/PlaceholderParserInterface.php b/src/MailEditor/Parser/PlaceholderParserInterface.php index d99ce326..b9fe5659 100644 --- a/src/MailEditor/Parser/PlaceholderParserInterface.php +++ b/src/MailEditor/Parser/PlaceholderParserInterface.php @@ -1,5 +1,16 @@ %s', implode('', $containerFields)); return sprintf('%s', $field['type'], $field['subType'], $tableData); - } private function closeTable(): string @@ -75,5 +84,4 @@ private function openTable(): string return $template; } - } diff --git a/src/MailEditor/Widget/DateWidget.php b/src/MailEditor/Widget/DateWidget.php index 93081019..42031a88 100644 --- a/src/MailEditor/Widget/DateWidget.php +++ b/src/MailEditor/Widget/DateWidget.php @@ -1,5 +1,16 @@ translator->trans($attributeBag->get('block_label')); if ($layoutType === 'html') { - return sprintf(' + return sprintf( + ' diff --git a/src/MailEditor/Widget/MailEditorFieldDataWidgetInterface.php b/src/MailEditor/Widget/MailEditorFieldDataWidgetInterface.php index fd64e63e..c05b24d2 100644 --- a/src/MailEditor/Widget/MailEditorFieldDataWidgetInterface.php +++ b/src/MailEditor/Widget/MailEditorFieldDataWidgetInterface.php @@ -1,5 +1,16 @@ get($this->source, ['connect_timeout' => 10]); } catch (\Throwable $e) { - $this->setFetchStamp($now); $this->logger->error(sprintf('[DISPOSABLE EMAIL DOMAINS FETCH] %s', $e->getMessage())); @@ -58,7 +68,6 @@ public function execute(): void try { $this->formBuilderEmailCheckerStorage->write(DisposableEmailDomainChecker::DISPOSABLE_EMAIL_DOMAIN_DATABASE_PATH, $response->getBody()->getContents()); } catch (FilesystemException $e) { - $this->setFetchStamp($now); $this->logger->error(sprintf('[DISPOSABLE EMAIL DOMAINS FETCH] %s', $e->getMessage())); diff --git a/src/Manager/DoubleOptInManager.php b/src/Manager/DoubleOptInManager.php index 400613cb..db16e2aa 100644 --- a/src/Manager/DoubleOptInManager.php +++ b/src/Manager/DoubleOptInManager.php @@ -1,5 +1,16 @@ configuration->getConfig('double_opt_in'); $allowMultipleUserSessions = $doubleOptInConfig['allowMultipleUserSessions'] ?? true; if ($allowMultipleUserSessions === false) { - $doubleOptInSession = $this->doubleOptInSessionRepository->findOneBy([ 'applied' => false, 'email' => $email, @@ -221,7 +230,6 @@ public function getOutDatedDoubleOptInSessions(): array } if ($expiration['open_sessions'] > 0) { - $expiredOpenSessionDate = new \DateTime(); $expiredOpenSessionDate->modify(sprintf('-%d hour', $expiration['open_sessions'])); @@ -236,7 +244,6 @@ public function getOutDatedDoubleOptInSessions(): array } if ($expiration['redeemed_sessions'] > 0) { - $expiredRedeemedSessionDate = new \DateTime(); $expiredRedeemedSessionDate->modify(sprintf('-%d hour', $expiration['redeemed_sessions'])); @@ -262,6 +269,7 @@ private function sendDoubleOptInMessage(DoubleOptInSessionInterface $doubleOptIn foreach ([$locale, 'default'] as $layoutLocale) { if (!empty($mailTemplates[$layoutLocale]['id'])) { $mailTemplate = $mailTemplates[$layoutLocale]['id']; + break; } } diff --git a/src/Manager/FormDefinitionManager.php b/src/Manager/FormDefinitionManager.php index 9ca06426..db0da098 100644 --- a/src/Manager/FormDefinitionManager.php +++ b/src/Manager/FormDefinitionManager.php @@ -1,5 +1,16 @@ getFormDefinition()->getConditionalLogic(); foreach ($cl as $block) { - if (count( - array_filter( - $block['condition'] ?? [], - static function (array $condition) use ($outputWorkflow) { - return $condition['type'] === 'outputWorkflow' && in_array($outputWorkflow->getName(), $condition['outputWorkflows'], true); - })) > 0) { + array_filter( + $block['condition'] ?? [], + static function (array $condition) use ($outputWorkflow) { + return $condition['type'] === 'outputWorkflow' && in_array($outputWorkflow->getName(), $condition['outputWorkflows'], true); + } + ) + ) > 0) { return true; } if (count( - array_filter( - $block['action'] ?? [], - static function (array $action) use ($outputWorkflow) { - return $action['type'] === 'switchOutputWorkflow' && $action['workflowName'] === $outputWorkflow->getName(); - })) > 0) { + array_filter( + $block['action'] ?? [], + static function (array $action) use ($outputWorkflow) { + return $action['type'] === 'switchOutputWorkflow' && $action['workflowName'] === $outputWorkflow->getName(); + } + ) + ) > 0) { return true; } } diff --git a/src/Manager/PresetManager.php b/src/Manager/PresetManager.php index 60db321f..88cde4ed 100644 --- a/src/Manager/PresetManager.php +++ b/src/Manager/PresetManager.php @@ -1,5 +1,16 @@ findAll() as $channel) { - if ($channel->getType() !== 'email') { continue; } @@ -65,7 +75,6 @@ private function migrateMailLayout(array $configuration): ?array $changed = false; foreach ($configuration as $locale => $configurationData) { - if (!array_key_exists('mailLayoutData', $configurationData)) { continue; } @@ -122,7 +131,6 @@ protected function parseSquareBracketsTag(array $tag): string $additionalParameter = ''; foreach ($cleanConfig as $configName => $configValue) { - if (in_array($configName, ['sub-type', 'show_label'], true)) { continue; } diff --git a/src/Migrations/Version20230908101855.php b/src/Migrations/Version20230908101855.php index 62851280..2bd52ab6 100644 --- a/src/Migrations/Version20230908101855.php +++ b/src/Migrations/Version20230908101855.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * This source file is available under two different licenses: + * - GNU General Public License version 3 (GPLv3) + * - DACHCOM Commercial License (DCL) + * Full copyright and license information is available in + * LICENSE.md which is distributed with this source code. + * + * @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com) + * @license GPLv3 and DCL + */ + namespace FormBuilderBundle\Migrations; use Doctrine\DBAL\Schema\Schema; @@ -20,13 +31,13 @@ public function up(Schema $schema): void $workflowIdMap = array_reduce($workflowIdMapData, static function ($carry, $data) { $carry[$data['id']] = $data['name']; + return $carry; }, []); $forms = $this->connection->fetchAllAssociative("SELECT id, conditionalLogic FROM formbuilder_forms WHERE (conditionalLogic LIKE '%\"switchOutputWorkflow\"%' OR conditionalLogic LIKE '%\"outputWorkflow\"%')"); foreach ($forms as $form) { - $conditionalLogic = array_map(static function ($logic) use ($workflowIdMap) { return [ 'condition' => array_filter( @@ -36,9 +47,9 @@ public function up(Schema $schema): void } foreach ($condition['outputWorkflows'] as $index => $outputWorkflowId) { - if (!isset($workflowIdMap[$outputWorkflowId])) { unset($condition['outputWorkflows'][$index]); + continue; } @@ -52,7 +63,6 @@ public function up(Schema $schema): void $condition['outputWorkflows'] = array_values($condition['outputWorkflows']); return $condition; - }, $logic['condition'] ?? []) ), 'action' => array_filter( @@ -69,7 +79,6 @@ public function up(Schema $schema): void unset($action['workflowId']); return $action; - }, $logic['action'] ?? []) ) ]; @@ -85,13 +94,13 @@ public function down(Schema $schema): void $workflowIdMap = array_reduce($workflowIdMapData, static function ($carry, $data) { $carry[$data['name']] = $data['id']; + return $carry; }, []); $forms = $this->connection->fetchAllAssociative("SELECT id, conditionalLogic FROM formbuilder_forms WHERE (conditionalLogic LIKE '%\"switchOutputWorkflow\"%' OR conditionalLogic LIKE '%\"outputWorkflow\"%')"); foreach ($forms as $form) { - $conditionalLogic = array_map(static function ($logic) use ($workflowIdMap) { return [ 'condition' => array_map(static function ($condition) use ($workflowIdMap) { @@ -104,7 +113,6 @@ public function down(Schema $schema): void } return $condition; - }, $logic['condition'] ?? []), 'action' => array_map(static function ($action) use ($workflowIdMap) { if ($action['type'] !== 'switchOutputWorkflow') { @@ -115,7 +123,6 @@ public function down(Schema $schema): void unset($action['workflowName']); return $action; - }, $logic['action'] ?? []) ]; }, unserialize($form['conditionalLogic'])); diff --git a/src/Migrations/Version20240628143429.php b/src/Migrations/Version20240628143429.php index dbf83087..242c8c74 100644 --- a/src/Migrations/Version20240628143429.php +++ b/src/Migrations/Version20240628143429.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * This source file is available under two different licenses: + * - GNU General Public License version 3 (GPLv3) + * - DACHCOM Commercial License (DCL) + * Full copyright and license information is available in + * LICENSE.md which is distributed with this source code. + * + * @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com) + * @license GPLv3 and DCL + */ + namespace FormBuilderBundle\Migrations; use Doctrine\DBAL\Schema\Schema; diff --git a/src/Migrations/Version20240819150642.php b/src/Migrations/Version20240819150642.php index c110748d..c4004c45 100644 --- a/src/Migrations/Version20240819150642.php +++ b/src/Migrations/Version20240819150642.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * This source file is available under two different licenses: + * - GNU General Public License version 3 (GPLv3) + * - DACHCOM Commercial License (DCL) + * Full copyright and license information is available in + * LICENSE.md which is distributed with this source code. + * + * @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com) + * @license GPLv3 and DCL + */ + namespace FormBuilderBundle\Migrations; use Doctrine\DBAL\Schema\Schema; diff --git a/src/Migrations/Version20240916132702.php b/src/Migrations/Version20240916132702.php index 3c036075..3f07b8f7 100644 --- a/src/Migrations/Version20240916132702.php +++ b/src/Migrations/Version20240916132702.php @@ -2,6 +2,17 @@ declare(strict_types=1); +/* + * This source file is available under two different licenses: + * - GNU General Public License version 3 (GPLv3) + * - DACHCOM Commercial License (DCL) + * Full copyright and license information is available in + * LICENSE.md which is distributed with this source code. + * + * @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com) + * @license GPLv3 and DCL + */ + namespace FormBuilderBundle\Migrations; use Doctrine\DBAL\Schema\Schema; diff --git a/src/Model/DoubleOptInSession.php b/src/Model/DoubleOptInSession.php index 930eaea2..53638834 100644 --- a/src/Model/DoubleOptInSession.php +++ b/src/Model/DoubleOptInSession.php @@ -1,5 +1,16 @@ 0; $mapping = $apiMappingField['config']['apiMapping'] ?? null; @@ -80,13 +90,13 @@ protected function buildMapping(array $apiStructure, array $apiMappingData, arra if ($hasChildren) { $apiStructure[] = $this->buildMapping($apiField, $apiMappingField['children'], $formData, true); + continue; } if ($hasParent === false) { $apiStructure[] = $apiField; } - } return $apiStructure; @@ -110,7 +120,6 @@ protected function buildApiNodes(array $nodes, array $formData, array $mapping, } foreach ($apiMappingFields as $apiMappingField) { - $context = [ 'type' => $formField['type'] ?? null, 'parentType' => $hasParent ? $parentType : null, @@ -162,7 +171,6 @@ protected function buildRepeaterBlock(array $rows, int $index): array { $fields = []; foreach ($rows as $mapRow) { - $repeaterFormFields = $mapRow['formField']; $repeaterApiMapping = $mapRow['apiMapping']; $fieldTransformer = $mapRow['fieldTransformer']; @@ -219,7 +227,6 @@ protected function applyFieldTransformer($value, ?string $fieldTransformerName, protected function findFormDataField(string $requestedFieldName, array $data): ?array { foreach ($data as $fieldData) { - if ($requestedFieldName === $fieldData['name']) { return $fieldData; } @@ -254,7 +261,6 @@ protected function dispatchGuardEvent( array $formRuntimeData, ?ChannelContext $channelContext ): mixed { - $channelSubjectGuardEvent = new ChannelSubjectGuardEvent( $form->getData(), $subject, diff --git a/src/OutputWorkflow/Channel/Api/ApiProviderInterface.php b/src/OutputWorkflow/Channel/Api/ApiProviderInterface.php index e62c0117..7a8f903b 100644 --- a/src/OutputWorkflow/Channel/Api/ApiProviderInterface.php +++ b/src/OutputWorkflow/Channel/Api/ApiProviderInterface.php @@ -1,5 +1,16 @@ createDoubleOptInSessionValues( @@ -164,7 +174,6 @@ protected function setMailBodyPlaceholder( ] ); } else { - if ($doubleOptInSession instanceof DoubleOptInSessionInterface) { $fieldValues['double_opt_in_session'] = $doubleOptInSessionValues; } @@ -311,11 +320,11 @@ protected function createDoubleOptInSessionValues(?DoubleOptInSessionInterface $ foreach ($validFields as $validField) { $data[] = match ($validField) { - 'email' => $this->createDoubleOptInSessionValue('email', $doubleOptInSession->getEmail(), $createFieldValueScheme), - 'token' => $this->createDoubleOptInSessionValue('token', $doubleOptInSession->getTokenAsString(), $createFieldValueScheme), - 'creation_date' => $this->createDoubleOptInSessionValue('creation_date', $doubleOptInSession->getCreationDate(), $createFieldValueScheme), + 'email' => $this->createDoubleOptInSessionValue('email', $doubleOptInSession->getEmail(), $createFieldValueScheme), + 'token' => $this->createDoubleOptInSessionValue('token', $doubleOptInSession->getTokenAsString(), $createFieldValueScheme), + 'creation_date' => $this->createDoubleOptInSessionValue('creation_date', $doubleOptInSession->getCreationDate(), $createFieldValueScheme), 'additional_data' => $this->createDoubleOptInSessionValue('additional_data', $doubleOptInSession->getAdditionalData(), $createFieldValueScheme), - default => null, + default => null, }; } @@ -338,6 +347,5 @@ protected function createDoubleOptInSessionValue(string $name, mixed $value, boo 'type' => 'text' ] ]; - } } diff --git a/src/OutputWorkflow/Channel/Funnel/Action/ChannelAction.php b/src/OutputWorkflow/Channel/Funnel/Action/ChannelAction.php index ca38b706..bb01be4c 100644 --- a/src/OutputWorkflow/Channel/Funnel/Action/ChannelAction.php +++ b/src/OutputWorkflow/Channel/Funnel/Action/ChannelAction.php @@ -1,5 +1,16 @@ setPath('#'); return $funnelActionElement; } if (!array_key_exists('channelName', $configuration)) { - $funnelActionElement->setPath('#'); return $funnelActionElement; @@ -52,12 +60,12 @@ public function buildFunnelActionElement( if ($availableChannel->getName() === $configuration['channelName']) { $verifiedChannelId = $availableChannel->getName(); $subject = $availableChannel; + break; } } if ($subject === null) { - $funnelActionElement->setPath('#'); return $funnelActionElement; @@ -69,7 +77,8 @@ public function buildFunnelActionElement( 'funnelId' => $channel->getOutputWorkflow()->getId(), 'channelId' => $verifiedChannelId, 'storageToken' => $storageToken - ]); + ] + ); $funnelActionElement->setPath($path); $funnelActionElement->setSubject($subject); diff --git a/src/OutputWorkflow/Channel/Funnel/Action/DisabledAction.php b/src/OutputWorkflow/Channel/Funnel/Action/DisabledAction.php index a72c7245..361331a6 100644 --- a/src/OutputWorkflow/Channel/Funnel/Action/DisabledAction.php +++ b/src/OutputWorkflow/Channel/Funnel/Action/DisabledAction.php @@ -1,5 +1,16 @@ setPath('#'); $funnelActionElement->setDisabled(true); diff --git a/src/OutputWorkflow/Channel/Funnel/Action/FunnelActionElementStack.php b/src/OutputWorkflow/Channel/Funnel/Action/FunnelActionElementStack.php index a315e2e3..f4535981 100644 --- a/src/OutputWorkflow/Channel/Funnel/Action/FunnelActionElementStack.php +++ b/src/OutputWorkflow/Channel/Funnel/Action/FunnelActionElementStack.php @@ -1,5 +1,16 @@ setPath('#'); return $funnelActionElement; diff --git a/src/OutputWorkflow/Channel/Funnel/FunnelOutputChannel.php b/src/OutputWorkflow/Channel/Funnel/FunnelOutputChannel.php index 8b1b93a9..62668ee1 100644 --- a/src/OutputWorkflow/Channel/Funnel/FunnelOutputChannel.php +++ b/src/OutputWorkflow/Channel/Funnel/FunnelOutputChannel.php @@ -1,5 +1,16 @@ buildForm($funnelLayerData, $formBuilder); $formBuilder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($funnelWorkerData) { - $form = $event->getForm(); try { @@ -106,14 +116,12 @@ public function dispatchFunnelProcessing(FunnelWorkerData $funnelWorkerData): Re } catch (\Throwable $e) { $form->addError(new FormError($e->getMessage())); } - }, 250); $form = $formBuilder->getForm(); $form->handleRequest($funnelWorkerData->getRequest()); if ($form->isSubmitted()) { - // exception already handled in post submit event! $funnelTargetAction = $this->findFunnelTargetAction($funnelWorkerData, $form); @@ -122,7 +130,6 @@ public function dispatchFunnelProcessing(FunnelWorkerData $funnelWorkerData): Re } if ($form->isValid()) { - if (!empty($form->getData())) { $handledFormData = $funnelLayer->handleFormData($funnelLayerData, $form->getData()); $funnelWorkerData->getFormStorageData()->addFunnelRuntimeData($funnelName, $handledFormData); @@ -150,7 +157,6 @@ public function dispatchFunnelProcessing(FunnelWorkerData $funnelWorkerData): Re ]; if ($renderType === self::RENDER_TYPE_PRERENDER) { - $template = $this->renderer->createTemplate($this->templating->render( $funnelLayerData->getFunnelLayerView(), $viewArguments @@ -165,14 +171,15 @@ public function dispatchFunnelProcessing(FunnelWorkerData $funnelWorkerData): Re ); if ($funnelWorkerData->getRequest()->isXmlHttpRequest()) { - $jsonArguments = $this->serializer instanceof NormalizerInterface ? $this->serializer->normalize( array_merge( [ 'funnelActions' => $funnelWorkerData->getFunnelActionElementStack()->getAll(), ], $funnelLayerData->getFunnelLayerViewArguments() - ), null, ['groups' => ['FunnelOutput']] + ), + null, + ['groups' => ['FunnelOutput']] ) : []; return new JsonResponse( @@ -202,9 +209,9 @@ private function findFunnelTargetAction(FunnelWorkerData $funnelWorkerData, Form $target = null; foreach ($form->all() as $formType) { - if ($formType instanceof SubmitButton && $formType->isClicked()) { $target = $formType->getName(); + break; } } diff --git a/src/OutputWorkflow/Channel/Funnel/Layer/DynamicLayoutLayer.php b/src/OutputWorkflow/Channel/Funnel/Layer/DynamicLayoutLayer.php index 48a02c86..80383e7d 100644 --- a/src/OutputWorkflow/Channel/Funnel/Layer/DynamicLayoutLayer.php +++ b/src/OutputWorkflow/Channel/Funnel/Layer/DynamicLayoutLayer.php @@ -1,5 +1,16 @@ processObjectData($object, $field); } @@ -376,7 +384,6 @@ protected function processFieldWorkerValue(string $workerName, array $workerConf { return match ($workerName) { 'relationWorker' => call_user_func(static function (?DataObject\ClassDefinition\Data $fieldDefinition, array $workerConfig, mixed $value) { - $relationType = $workerConfig['relationType'] ?? null; if (!in_array($relationType, ['object', 'asset', 'document'])) { @@ -402,7 +409,6 @@ protected function processFieldWorkerValue(string $workerName, array $workerConf } return null; - }, $fieldDefinition, $workerConfig, $value), default => null }; diff --git a/src/OutputWorkflow/Channel/Object/ExistingObjectResolver.php b/src/OutputWorkflow/Channel/Object/ExistingObjectResolver.php index 2768a5b7..b4166b5a 100644 --- a/src/OutputWorkflow/Channel/Object/ExistingObjectResolver.php +++ b/src/OutputWorkflow/Channel/Object/ExistingObjectResolver.php @@ -1,5 +1,16 @@ buildErrorResponse($request, $submissionEvent, implode(', ', $e->getGuardExceptionMessages())); } catch (\Throwable $e) { - $errorMessage = sprintf('Error while dispatching workflow "%s". Message was: %s', $outputWorkflow->getName(), $e->getMessage()); return $this->buildErrorResponse($request, $submissionEvent, $errorMessage); @@ -188,7 +198,6 @@ protected function generateRedirectFormSuccessResponse( if ($useFlashBag === true) { foreach ($responseMessages as $type => $eventMessages) { foreach ($eventMessages as $message) { - $messageKey = $type === 'redirect_message' ? sprintf('%s_redirect_flash_message', $flashBagPrefix) : sprintf('%s_%d_%s', $flashBagPrefix, $formDefinition->getId(), $type); @@ -212,13 +221,11 @@ protected function generateAjaxFormSuccessResponse( $error = false; foreach ($responseMessages as $type => $eventMessages) { - if ($type === 'error') { $error = true; } foreach ($eventMessages as $message) { - if ($type === 'redirect_message' && $useFlashBag === true) { $this->flashBagManager->add(sprintf('%s_redirect_flash_message', $flashBagPrefix), $message); } @@ -250,7 +257,6 @@ protected function generateRedirectFinisherErrorResponse( string $flashBagPrefix, array|string $errors ): RedirectResponse { - $uri = $redirectUri ?? '?send=false'; if (!is_array($errors)) { diff --git a/src/OutputWorkflow/FormSubmissionFinisherInterface.php b/src/OutputWorkflow/FormSubmissionFinisherInterface.php index 07832c30..d9503c34 100644 --- a/src/OutputWorkflow/FormSubmissionFinisherInterface.php +++ b/src/OutputWorkflow/FormSubmissionFinisherInterface.php @@ -1,5 +1,16 @@ setFunnelActionElementStack($this->buildFunnelActionElementStack($funnelWorkerData)); $funnelResponse = $channelProcessor->dispatchFunnelProcessing($funnelWorkerData); @@ -155,7 +165,6 @@ protected function processDataFunnel(FunnelWorkerData $funnelWorkerData): Respon $channelProcessor = $funnelWorkerData->getChannelProcessor(); try { - $arguments = [ $funnelWorkerData->getSubmissionEvent(), $funnelWorkerData->getOutputWorkflow()->getName(), @@ -167,9 +176,7 @@ protected function processDataFunnel(FunnelWorkerData $funnelWorkerData): Respon } else { $channelProcessor->dispatchOutputProcessing(...$arguments); } - } catch (\Throwable $e) { - $funnelErrorToken = $funnelWorkerData->getFormStorageData()->addFunnelError($e->getMessage()); $this->getStorageProvider()->update( @@ -246,7 +253,6 @@ protected function buildSubmissionEvent( OutputWorkflowInterface $outputWorkflow, FormStorageData $formStorageData ): SubmissionEvent { - $formRuntimeData = $formStorageData->getFormRuntimeData() ?? []; $formData = $this->formValuesInputApplier->apply($formStorageData->getFormData(), $outputWorkflow->getFormDefinition()); diff --git a/src/OutputWorkflow/FunnelWorkerData.php b/src/OutputWorkflow/FunnelWorkerData.php index ef4fc2bf..33df3d2e 100644 --- a/src/OutputWorkflow/FunnelWorkerData.php +++ b/src/OutputWorkflow/FunnelWorkerData.php @@ -1,5 +1,16 @@ signalSubscribeHandler->broadcast([ 'exception' => $e, 'channelContext' => $channelContext ]); throw $e; - } catch (\Throwable $e) { - $this->signalSubscribeHandler->broadcast([ 'exception' => $e, 'channelContext' => $channelContext @@ -79,7 +87,6 @@ protected function dispatchOutputWorkflowInitiating(OutputWorkflowInterface $out } if (count($exceptionStack) > 0) { - $exception = new GuardStackedException($exceptionStack); $this->signalSubscribeHandler->broadcast([ 'exception' => $exception, @@ -99,7 +106,6 @@ protected function dispatchOutputWorkflowFunnelInitiating(OutputWorkflowInterfac try { $this->funnelWorker->initiateFunnel($outputWorkflow, $submissionEvent); } catch (\Throwable $e) { - $this->signalSubscribeHandler->broadcast(['exception' => $e]); throw new \Exception( @@ -121,7 +127,6 @@ public function dispatchOutputWorkflowFunnelProcessing(OutputWorkflowInterface $ try { $response = $this->funnelWorker->processFunnel($outputWorkflow, $request); } catch (\Throwable $e) { - throw new \Exception( sprintf( '"%s" workflow funnel errored at processing state: %s', diff --git a/src/OutputWorkflow/OutputWorkflowDispatcherInterface.php b/src/OutputWorkflow/OutputWorkflowDispatcherInterface.php index 3881025e..3d16451e 100644 --- a/src/OutputWorkflow/OutputWorkflowDispatcherInterface.php +++ b/src/OutputWorkflow/OutputWorkflowDispatcherInterface.php @@ -1,5 +1,16 @@ [], 'condition' => [] ]; - protected array $serviceConfiguration = [ 'action' => [], 'condition' => [] ]; - private string $actionInterface; private string $conditionInterface; @@ -26,7 +35,7 @@ public function __construct(string $actionInterface, string $conditionInterface) $this->conditionInterface = $conditionInterface; } - public function register(string$identifier, mixed $service, ?string $type = null, array $configuration = []): void + public function register(string $identifier, mixed $service, ?string $type = null, array $configuration = []): void { $allowedTypes = ['action', 'condition']; if (!is_null($type) && !in_array($type, $allowedTypes)) { diff --git a/src/Registry/DataInjectionRegistry.php b/src/Registry/DataInjectionRegistry.php index b81f87d3..428bbe04 100644 --- a/src/Registry/DataInjectionRegistry.php +++ b/src/Registry/DataInjectionRegistry.php @@ -1,5 +1,16 @@ repository->findAll(); + return $this->repository->findAll(); } } diff --git a/src/Repository/FormDefinitionRepositoryInterface.php b/src/Repository/FormDefinitionRepositoryInterface.php index 442a3bde..e6efd24a 100644 --- a/src/Repository/FormDefinitionRepositoryInterface.php +++ b/src/Repository/FormDefinitionRepositoryInterface.php @@ -1,5 +1,16 @@ close(); - } catch (\Exception $e) { Logger::error(sprintf('Error while creating attachment zip (%s): %s', $zipPath, $e->getMessage())); @@ -128,7 +138,6 @@ public function createAttachmentAsset($data, $fieldName, $formName): ?Asset $asset->save(); unlink($zipPath); - } catch (\Exception $e) { Logger::error(sprintf('Error while storing asset in pimcore (%s): %s', $zipPath, $e->getMessage())); @@ -161,7 +170,6 @@ public function cleanUp(OutputWorkflowSignalsEvent $signalsEvent): void } foreach ($signalsEvent->getSignalsByName(self::SIGNAL_CLEAN_UP) as $signal) { - $fileStack = $signal->getData(); if (!$fileStack instanceof FileStack) { continue; diff --git a/src/Stream/AttachmentStreamInterface.php b/src/Stream/AttachmentStreamInterface.php index c0b644cb..65b038db 100644 --- a/src/Stream/AttachmentStreamInterface.php +++ b/src/Stream/AttachmentStreamInterface.php @@ -1,5 +1,16 @@ request->get($options['uuid']); if ($totalParts > 1) { - // chunked upload $partIndex = (int) $mainRequest->request->get($options['chunkIndex']); @@ -166,7 +176,6 @@ public function handleUpload(array $options = [], bool $instantChunkCombining = 'fileName' => $fileSafeName, 'uuid' => $uuid ]; - } public function combineChunks(array $options = []): array @@ -188,7 +197,6 @@ public function combineChunks(array $options = []): array $chunkFiles = $this->formBuilderChunkStorage->listContents($uuid)->toArray(); usort($chunkFiles, static function (StorageAttributes $a, StorageAttributes $b) { - $pathInfoA = pathinfo($a->path()); $pathInfoB = pathinfo($b->path()); @@ -211,7 +219,6 @@ public function combineChunks(array $options = []): array fclose($tmpStream); if ($chunkSuccess === false) { - try { $this->formBuilderChunkStorage->deleteDirectory($uuid); } catch (FilesystemException $exception) { diff --git a/src/Stream/FileStreamInterface.php b/src/Stream/FileStreamInterface.php index 388192d5..1e1fbbd9 100644 --- a/src/Stream/FileStreamInterface.php +++ b/src/Stream/FileStreamInterface.php @@ -1,5 +1,16 @@ fetchAllAssociative() as $data) { - $document = null; try { diff --git a/src/Tool/FriendlyCaptcha/Response.php b/src/Tool/FriendlyCaptcha/Response.php index 103d9741..885ab11c 100644 --- a/src/Tool/FriendlyCaptcha/Response.php +++ b/src/Tool/FriendlyCaptcha/Response.php @@ -1,10 +1,21 @@ execute()->fetchAllAssociative() as $rawFormOutputWorkflowDefinition) { - $fowChannelQb = $this->connection->createQueryBuilder(); $fowChannelQb ->select('*') @@ -78,7 +88,6 @@ public function processFormDefinitionToYaml(int $formId): string ? unserialize($rawFormOutputWorkflowDefinition['success_management'], ['allowed_classes' => false]) : null, ]; - } $data = [ @@ -130,7 +139,6 @@ public function processYamlToFormDefinition(int $formId, mixed $data): void } if (is_array($formContent['output_workflows'])) { - foreach ($formContent['output_workflows'] as $outputWorkflowDefinition) { /** @var OutputWorkflowInterface $outputWorkflow */ $outputWorkflow = $this->outputWorkflowManager->save([ diff --git a/src/Tool/Install.php b/src/Tool/Install.php index 04443928..03943f49 100644 --- a/src/Tool/Install.php +++ b/src/Tool/Install.php @@ -1,5 +1,16 @@ $choiceDataValue) { - // tooltip if ($choiceDataKey === 'data-meta-tooltip') { $attr['tooltip'] = $choiceDataValue; @@ -153,7 +163,7 @@ protected function extractRelation(string $locale, array $data): ?array ]; } - function isAssocArray(array $arr): bool + public function isAssocArray(array $arr): bool { return array_keys($arr) !== range(0, count($arr) - 1); } diff --git a/src/Transformer/ChoicesTransformer.php b/src/Transformer/ChoicesTransformer.php index 95e9eef5..778ed3f4 100644 --- a/src/Transformer/ChoicesTransformer.php +++ b/src/Transformer/ChoicesTransformer.php @@ -1,5 +1,16 @@ $choiceKey, - 'value' => $choiceValue + 'value' => $choiceValue ]; } } diff --git a/src/Transformer/DefaultValueTransformer.php b/src/Transformer/DefaultValueTransformer.php index c8ef7844..c64d4566 100644 --- a/src/Transformer/DefaultValueTransformer.php +++ b/src/Transformer/DefaultValueTransformer.php @@ -1,5 +1,16 @@ attachmentStream->createAttachmentAsset($attachmentData, $fieldDefinition->getName(), $rootFormData->getFormDefinition()->getName()); if ($asset instanceof Asset) { - $hostUrl = \Pimcore\Tool::getHostUrl(); if (isset($options['submit_as_admin_deep_link']) && $options['submit_as_admin_deep_link'] === true) { diff --git a/src/Transformer/Output/FallbackTransformer.php b/src/Transformer/Output/FallbackTransformer.php index 4aa9ec4f..f49ce62c 100644 --- a/src/Transformer/Output/FallbackTransformer.php +++ b/src/Transformer/Output/FallbackTransformer.php @@ -1,5 +1,16 @@ dataFactory->generate(ConstraintsData::class); - if(!$returnContainer instanceof DataInterface) { + if (!$returnContainer instanceof DataInterface) { throw new \Exception('Could not create Constraints container'); } @@ -68,7 +79,7 @@ public function apply(array $options): DataInterface } /** - * Constraints from current conditional logic + * Constraints from current conditional logic. */ private function checkConditionalLogicConstraints(array $defaultFieldConstraints): array { @@ -109,7 +120,6 @@ private function appendConstraintsData(array $constraints): array { $constraintData = []; foreach ($constraints as $constraint) { - $constraintType = $constraint['type']; $constraintConfig = $constraint['config'] ?? []; diff --git a/src/Validation/ConditionalLogic/Dispatcher/Module/Data/ConstraintsData.php b/src/Validation/ConditionalLogic/Dispatcher/Module/Data/ConstraintsData.php index 606a1024..92c8f857 100644 --- a/src/Validation/ConditionalLogic/Dispatcher/Module/Data/ConstraintsData.php +++ b/src/Validation/ConditionalLogic/Dispatcher/Module/Data/ConstraintsData.php @@ -1,5 +1,16 @@ appliedConditions as $returnStack) { - if (!$returnStack instanceof SimpleReturnStack || $returnStack->getActionType() !== 'switchOutputWorkflow') { continue; } diff --git a/src/Validation/ConditionalLogic/Factory/DataFactory.php b/src/Validation/ConditionalLogic/Factory/DataFactory.php index 7e5f2cb5..8b2a13f6 100644 --- a/src/Validation/ConditionalLogic/Factory/DataFactory.php +++ b/src/Validation/ConditionalLogic/Factory/DataFactory.php @@ -1,5 +1,16 @@ getFieldValue($formData, $conditionFieldName); if ($this->getComparator() === 'contains') { - $value = $this->getValue(); if (!is_array($value)) { $value = is_string($this->getValue()) && str_contains($this->getValue(), ',') ? explode(',', $this->getValue()) : [$this->getValue()]; @@ -60,7 +70,8 @@ public function isValid(array $formData, int $ruleId, array $configuration = []) return false; } - protected function getFieldValue(array $formData, string $fieldname) { + protected function getFieldValue(array $formData, string $fieldname) + { $fieldValue = $formData[$fieldname] ?? null; if ($fieldValue !== null) { return $fieldValue; diff --git a/src/Validation/ConditionalLogic/Rule/Condition/OutputWorkflowCondition.php b/src/Validation/ConditionalLogic/Rule/Condition/OutputWorkflowCondition.php index c9027475..31871608 100644 --- a/src/Validation/ConditionalLogic/Rule/Condition/OutputWorkflowCondition.php +++ b/src/Validation/ConditionalLogic/Rule/Condition/OutputWorkflowCondition.php @@ -1,5 +1,16 @@