Completed
Branch FET/reg-form-builder/main (a66e69)
by
unknown
09:49 queued 19s
created
core/domain/services/graphql/inputs/AttendeesConnectionOrderbyInput.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -17,31 +17,31 @@
 block discarded – undo
17 17
 class AttendeesConnectionOrderbyInput extends InputBase
18 18
 {
19 19
 
20
-    /**
21
-     * AttendeesConnectionOrderbyInput constructor.
22
-     */
23
-    public function __construct()
24
-    {
25
-        $this->setName($this->namespace . 'AttendeesConnectionOrderbyInput');
26
-        $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso'));
27
-        parent::__construct();
28
-    }
20
+	/**
21
+	 * AttendeesConnectionOrderbyInput constructor.
22
+	 */
23
+	public function __construct()
24
+	{
25
+		$this->setName($this->namespace . 'AttendeesConnectionOrderbyInput');
26
+		$this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso'));
27
+		parent::__construct();
28
+	}
29 29
 
30 30
 
31
-    /**
32
-     * @return GraphQLFieldInterface[]
33
-     */
34
-    protected function getFields(): array
35
-    {
36
-        return [
37
-            new GraphQLField(
38
-                'field',
39
-                ['non_null' => $this->namespace . 'AttendeesConnectionOrderbyEnum']
40
-            ),
41
-            new GraphQLField(
42
-                'order',
43
-                'OrderEnum'
44
-            ),
45
-        ];
46
-    }
31
+	/**
32
+	 * @return GraphQLFieldInterface[]
33
+	 */
34
+	protected function getFields(): array
35
+	{
36
+		return [
37
+			new GraphQLField(
38
+				'field',
39
+				['non_null' => $this->namespace . 'AttendeesConnectionOrderbyEnum']
40
+			),
41
+			new GraphQLField(
42
+				'order',
43
+				'OrderEnum'
44
+			),
45
+		];
46
+	}
47 47
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/inputs/TicketsConnectionOrderbyInput.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -17,31 +17,31 @@
 block discarded – undo
17 17
 class TicketsConnectionOrderbyInput extends InputBase
18 18
 {
19 19
 
20
-    /**
21
-     * TicketsConnectionOrderbyInput constructor.
22
-     */
23
-    public function __construct()
24
-    {
25
-        $this->setName($this->namespace . 'TicketsConnectionOrderbyInput');
26
-        $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso'));
27
-        parent::__construct();
28
-    }
20
+	/**
21
+	 * TicketsConnectionOrderbyInput constructor.
22
+	 */
23
+	public function __construct()
24
+	{
25
+		$this->setName($this->namespace . 'TicketsConnectionOrderbyInput');
26
+		$this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso'));
27
+		parent::__construct();
28
+	}
29 29
 
30 30
 
31
-    /**
32
-     * @return GraphQLFieldInterface[]
33
-     */
34
-    protected function getFields(): array
35
-    {
36
-        return [
37
-            new GraphQLField(
38
-                'field',
39
-                ['non_null' => $this->namespace . 'TicketsConnectionOrderbyEnum']
40
-            ),
41
-            new GraphQLField(
42
-                'order',
43
-                'OrderEnum'
44
-            ),
45
-        ];
46
-    }
31
+	/**
32
+	 * @return GraphQLFieldInterface[]
33
+	 */
34
+	protected function getFields(): array
35
+	{
36
+		return [
37
+			new GraphQLField(
38
+				'field',
39
+				['non_null' => $this->namespace . 'TicketsConnectionOrderbyEnum']
40
+			),
41
+			new GraphQLField(
42
+				'order',
43
+				'OrderEnum'
44
+			),
45
+		];
46
+	}
47 47
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/inputs/DatetimesConnectionOrderbyInput.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -17,31 +17,31 @@
 block discarded – undo
17 17
 class DatetimesConnectionOrderbyInput extends InputBase
18 18
 {
19 19
 
20
-    /**
21
-     * DatetimesConnectionOrderbyInput constructor.
22
-     */
23
-    public function __construct()
24
-    {
25
-        $this->setName($this->namespace . 'DatetimesConnectionOrderbyInput');
26
-        $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso'));
27
-        parent::__construct();
28
-    }
20
+	/**
21
+	 * DatetimesConnectionOrderbyInput constructor.
22
+	 */
23
+	public function __construct()
24
+	{
25
+		$this->setName($this->namespace . 'DatetimesConnectionOrderbyInput');
26
+		$this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso'));
27
+		parent::__construct();
28
+	}
29 29
 
30 30
 
31
-    /**
32
-     * @return GraphQLFieldInterface[]
33
-     */
34
-    protected function getFields(): array
35
-    {
36
-        return [
37
-            new GraphQLField(
38
-                'field',
39
-                ['non_null' => $this->namespace . 'DatetimesConnectionOrderbyEnum']
40
-            ),
41
-            new GraphQLField(
42
-                'order',
43
-                'OrderEnum'
44
-            ),
45
-        ];
46
-    }
31
+	/**
32
+	 * @return GraphQLFieldInterface[]
33
+	 */
34
+	protected function getFields(): array
35
+	{
36
+		return [
37
+			new GraphQLField(
38
+				'field',
39
+				['non_null' => $this->namespace . 'DatetimesConnectionOrderbyEnum']
40
+			),
41
+			new GraphQLField(
42
+				'order',
43
+				'OrderEnum'
44
+			),
45
+		];
46
+	}
47 47
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/mutators/TicketUpdate.php 2 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -15,68 +15,68 @@
 block discarded – undo
15 15
 class TicketUpdate extends EntityMutator
16 16
 {
17 17
 
18
-    /**
19
-     * Defines the mutation data modification closure.
20
-     *
21
-     * @param EEM_Ticket $model
22
-     * @param Ticket     $type
23
-     * @return callable
24
-     */
25
-    public static function mutateAndGetPayload(EEM_Ticket $model, Ticket $type)
26
-    {
27
-        /**
28
-         * Updates an entity.
29
-         *
30
-         * @param array       $input   The input for the mutation
31
-         * @param AppContext  $context The AppContext passed down to all resolvers
32
-         * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
33
-         * @return array
34
-         * @throws EE_Error
35
-         * @throws ReflectionException
36
-         */
37
-        return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
38
-            try {
39
-                /** @var EE_Ticket $entity */
40
-                $entity = EntityMutator::getEntityFromInputData($model, $input);
18
+	/**
19
+	 * Defines the mutation data modification closure.
20
+	 *
21
+	 * @param EEM_Ticket $model
22
+	 * @param Ticket     $type
23
+	 * @return callable
24
+	 */
25
+	public static function mutateAndGetPayload(EEM_Ticket $model, Ticket $type)
26
+	{
27
+		/**
28
+		 * Updates an entity.
29
+		 *
30
+		 * @param array       $input   The input for the mutation
31
+		 * @param AppContext  $context The AppContext passed down to all resolvers
32
+		 * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
33
+		 * @return array
34
+		 * @throws EE_Error
35
+		 * @throws ReflectionException
36
+		 */
37
+		return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
38
+			try {
39
+				/** @var EE_Ticket $entity */
40
+				$entity = EntityMutator::getEntityFromInputData($model, $input);
41 41
 
42
-                $datetimes = [];
43
-                $prices = null;
42
+				$datetimes = [];
43
+				$prices = null;
44 44
 
45
-                $args = TicketMutation::prepareFields($input);
45
+				$args = TicketMutation::prepareFields($input);
46 46
 
47
-                if (isset($args['datetimes'])) {
48
-                    $datetimes = $args['datetimes'];
49
-                    unset($args['datetimes']);
50
-                }
51
-                if (array_key_exists('prices', $args)) {
52
-                    $prices = $args['prices'];
53
-                    unset($args['prices']);
54
-                }
47
+				if (isset($args['datetimes'])) {
48
+					$datetimes = $args['datetimes'];
49
+					unset($args['datetimes']);
50
+				}
51
+				if (array_key_exists('prices', $args)) {
52
+					$prices = $args['prices'];
53
+					unset($args['prices']);
54
+				}
55 55
 
56
-                $entity->save($args);
56
+				$entity->save($args);
57 57
 
58
-                if (! empty($datetimes)) {
59
-                    TicketMutation::setRelatedDatetimes($entity, $datetimes);
60
-                }
61
-                // if prices array is passed.
62
-                if (is_array($prices)) {
63
-                    TicketMutation::setRelatedPrices($entity, $prices);
64
-                }
58
+				if (! empty($datetimes)) {
59
+					TicketMutation::setRelatedDatetimes($entity, $datetimes);
60
+				}
61
+				// if prices array is passed.
62
+				if (is_array($prices)) {
63
+					TicketMutation::setRelatedPrices($entity, $prices);
64
+				}
65 65
 
66
-                do_action('AHEE__EventEspresso_core_domain_services_graphql_mutators_ticket_update', $entity, $input);
67
-            } catch (Exception $exception) {
68
-                EntityMutator::handleExceptions(
69
-                    $exception,
70
-                    esc_html__(
71
-                        'The ticket could not be deleted because of the following error(s)',
72
-                        'event_espresso'
73
-                    )
74
-                );
75
-            }
66
+				do_action('AHEE__EventEspresso_core_domain_services_graphql_mutators_ticket_update', $entity, $input);
67
+			} catch (Exception $exception) {
68
+				EntityMutator::handleExceptions(
69
+					$exception,
70
+					esc_html__(
71
+						'The ticket could not be deleted because of the following error(s)',
72
+						'event_espresso'
73
+					)
74
+				);
75
+			}
76 76
 
77
-            return [
78
-                'id' => $entity->ID(),
79
-            ];
80
-        };
81
-    }
77
+			return [
78
+				'id' => $entity->ID(),
79
+			];
80
+		};
81
+	}
82 82
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
          * @throws EE_Error
35 35
          * @throws ReflectionException
36 36
          */
37
-        return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
37
+        return static function(array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
38 38
             try {
39 39
                 /** @var EE_Ticket $entity */
40 40
                 $entity = EntityMutator::getEntityFromInputData($model, $input);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
                 $entity->save($args);
57 57
 
58
-                if (! empty($datetimes)) {
58
+                if ( ! empty($datetimes)) {
59 59
                     TicketMutation::setRelatedDatetimes($entity, $datetimes);
60 60
                 }
61 61
                 // if prices array is passed.
Please login to merge, or discard this patch.
core/domain/services/graphql/mutators/DatetimeBulkUpdate.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,17 +8,17 @@
 block discarded – undo
8 8
 class DatetimeBulkUpdate extends EntityMutator
9 9
 {
10 10
 
11
-    /**
12
-     * Defines the mutation data modification closure.
13
-     *
14
-     * @param EEM_Datetime $model
15
-     * @param Datetime     $type
16
-     * @return callable
17
-     */
18
-    public static function mutateAndGetPayload(EEM_Datetime $model, Datetime $type): callable
19
-    {
20
-        $entityMutator = DatetimeUpdate::mutateAndGetPayload($model, $type);
21
-        $bulkMutator = new BulkEntityMutator($entityMutator);
22
-        return array($bulkMutator, 'updateEntities');
23
-    }
11
+	/**
12
+	 * Defines the mutation data modification closure.
13
+	 *
14
+	 * @param EEM_Datetime $model
15
+	 * @param Datetime     $type
16
+	 * @return callable
17
+	 */
18
+	public static function mutateAndGetPayload(EEM_Datetime $model, Datetime $type): callable
19
+	{
20
+		$entityMutator = DatetimeUpdate::mutateAndGetPayload($model, $type);
21
+		$bulkMutator = new BulkEntityMutator($entityMutator);
22
+		return array($bulkMutator, 'updateEntities');
23
+	}
24 24
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/mutators/EventUpdate.php 2 patches
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -14,63 +14,63 @@
 block discarded – undo
14 14
 class EventUpdate extends EntityMutator
15 15
 {
16 16
 
17
-    /**
18
-     * Defines the mutation data modification closure.
19
-     *
20
-     * @param EEM_Event $model
21
-     * @param Event     $type
22
-     * @return callable
23
-     */
24
-    public static function mutateFields(EEM_Event $model, Event $type)
25
-    {
26
-        /**
27
-         * Update additional data related to the entity.
28
-         *
29
-         * @param int          $id               The ID of the postObject being mutated
30
-         * @param array        $input            The input for the mutation
31
-         * @param WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated
32
-         * @param string       $mutation_name    The name of the mutation (ex: create, update, delete)
33
-         * @param AppContext   $context          The AppContext passed down to all resolvers
34
-         * @param ResolveInfo  $info             The ResolveInfo passed down to all resolvers
35
-         * @return void
36
-         */
37
-        return static function (
38
-            int $id,
39
-            array $input,
40
-            WP_Post_Type $post_type_object,
41
-            string $mutation_name,
42
-            AppContext $context,
43
-            ResolveInfo $info
44
-        ) use (
45
-            $model,
46
-            $type
47
-        ) {
48
-            try {
49
-                // Make sure we are dealing with the right entity.
50
-                if (
51
-                    ! property_exists($post_type_object, 'graphql_single_name')
52
-                    || $post_type_object->graphql_single_name !== $type->name()
53
-                ) {
54
-                    return;
55
-                }
17
+	/**
18
+	 * Defines the mutation data modification closure.
19
+	 *
20
+	 * @param EEM_Event $model
21
+	 * @param Event     $type
22
+	 * @return callable
23
+	 */
24
+	public static function mutateFields(EEM_Event $model, Event $type)
25
+	{
26
+		/**
27
+		 * Update additional data related to the entity.
28
+		 *
29
+		 * @param int          $id               The ID of the postObject being mutated
30
+		 * @param array        $input            The input for the mutation
31
+		 * @param WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated
32
+		 * @param string       $mutation_name    The name of the mutation (ex: create, update, delete)
33
+		 * @param AppContext   $context          The AppContext passed down to all resolvers
34
+		 * @param ResolveInfo  $info             The ResolveInfo passed down to all resolvers
35
+		 * @return void
36
+		 */
37
+		return static function (
38
+			int $id,
39
+			array $input,
40
+			WP_Post_Type $post_type_object,
41
+			string $mutation_name,
42
+			AppContext $context,
43
+			ResolveInfo $info
44
+		) use (
45
+			$model,
46
+			$type
47
+		) {
48
+			try {
49
+				// Make sure we are dealing with the right entity.
50
+				if (
51
+					! property_exists($post_type_object, 'graphql_single_name')
52
+					|| $post_type_object->graphql_single_name !== $type->name()
53
+				) {
54
+					return;
55
+				}
56 56
 
57
-                /** @var EE_Event $entity */
58
-                $entity = EntityMutator::getEntityFromID($model, $id);
59
-                $args = EventMutation::prepareFields($input);
57
+				/** @var EE_Event $entity */
58
+				$entity = EntityMutator::getEntityFromID($model, $id);
59
+				$args = EventMutation::prepareFields($input);
60 60
 
61
-                // Update the entity
62
-                $entity->save($args);
61
+				// Update the entity
62
+				$entity->save($args);
63 63
 
64
-                do_action('AHEE__EventEspresso_core_domain_services_graphql_mutators_event_update', $entity, $input);
65
-            } catch (Exception $exception) {
66
-                EntityMutator::handleExceptions(
67
-                    $exception,
68
-                    esc_html__(
69
-                        'The datetime could not be updated because of the following error(s)',
70
-                        'event_espresso'
71
-                    )
72
-                );
73
-            }
74
-        };
75
-    }
64
+				do_action('AHEE__EventEspresso_core_domain_services_graphql_mutators_event_update', $entity, $input);
65
+			} catch (Exception $exception) {
66
+				EntityMutator::handleExceptions(
67
+					$exception,
68
+					esc_html__(
69
+						'The datetime could not be updated because of the following error(s)',
70
+						'event_espresso'
71
+					)
72
+				);
73
+			}
74
+		};
75
+	}
76 76
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
          * @param ResolveInfo  $info             The ResolveInfo passed down to all resolvers
35 35
          * @return void
36 36
          */
37
-        return static function (
37
+        return static function(
38 38
             int $id,
39 39
             array $input,
40 40
             WP_Post_Type $post_type_object,
Please login to merge, or discard this patch.
core/domain/services/graphql/mutators/FormSectionDelete.php 3 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,48 +11,48 @@
 block discarded – undo
11 11
 class FormSectionDelete extends EntityMutator
12 12
 {
13 13
 
14
-    /**
15
-     * Defines the mutation data modification closure.
16
-     *
17
-     * @param EEM_Form_Section $model
18
-     * @return callable
19
-     */
20
-    public static function mutateAndGetPayload(EEM_Form_Section $model)
21
-    {
22
-        /**
23
-         * Deletes an entity.
24
-         *
25
-         * @param array       $input   The input for the mutation
26
-         * @param AppContext  $context The AppContext passed down to all resolvers
27
-         * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
28
-         * @return array
29
-         */
30
-        return static function (array $input, AppContext $context, ResolveInfo $info) use ($model): array {
31
-            try {
32
-                /** @var EE_Form_Section $entity */
33
-                $entity = EntityMutator::getEntityFromInputData($model, $input);
14
+	/**
15
+	 * Defines the mutation data modification closure.
16
+	 *
17
+	 * @param EEM_Form_Section $model
18
+	 * @return callable
19
+	 */
20
+	public static function mutateAndGetPayload(EEM_Form_Section $model)
21
+	{
22
+		/**
23
+		 * Deletes an entity.
24
+		 *
25
+		 * @param array       $input   The input for the mutation
26
+		 * @param AppContext  $context The AppContext passed down to all resolvers
27
+		 * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
28
+		 * @return array
29
+		 */
30
+		return static function (array $input, AppContext $context, ResolveInfo $info) use ($model): array {
31
+			try {
32
+				/** @var EE_Form_Section $entity */
33
+				$entity = EntityMutator::getEntityFromInputData($model, $input);
34 34
 
35
-                $result = $entity->delete();
36
-                EntityMutator::validateResults($result);
35
+				$result = $entity->delete();
36
+				EntityMutator::validateResults($result);
37 37
 
38
-                do_action(
39
-                    'AHEE__EventEspresso_core_domain_services_graphql_mutators_form_section_delete',
40
-                    $entity,
41
-                    $input
42
-                );
43
-            } catch (Exception $exception) {
44
-                EntityMutator::handleExceptions(
45
-                    $exception,
46
-                    esc_html__(
47
-                        'The form section could not be deleted because of the following error(s)',
48
-                        'event_espresso'
49
-                    )
50
-                );
51
-            }
38
+				do_action(
39
+					'AHEE__EventEspresso_core_domain_services_graphql_mutators_form_section_delete',
40
+					$entity,
41
+					$input
42
+				);
43
+			} catch (Exception $exception) {
44
+				EntityMutator::handleExceptions(
45
+					$exception,
46
+					esc_html__(
47
+						'The form section could not be deleted because of the following error(s)',
48
+						'event_espresso'
49
+					)
50
+				);
51
+			}
52 52
 
53
-            return [
54
-                'deleted' => $entity,
55
-            ];
56
-        };
57
-    }
53
+			return [
54
+				'deleted' => $entity,
55
+			];
56
+		};
57
+	}
58 58
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
          * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
28 28
          * @return array
29 29
          */
30
-        return static function (array $input, AppContext $context, ResolveInfo $info) use ($model): array {
30
+        return static function(array $input, AppContext $context, ResolveInfo $info) use ($model): array {
31 31
             try {
32 32
                 /** @var EE_Form_Section $entity */
33 33
                 $entity = EntityMutator::getEntityFromInputData($model, $input);
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      * Defines the mutation data modification closure.
18 18
      *
19 19
      * @param EEM_Form_Section $model
20
-     * @return callable
20
+     * @return \Closure
21 21
      */
22 22
     public static function mutateAndGetPayload(EEM_Form_Section $model)
23 23
     {
Please login to merge, or discard this patch.
core/domain/services/graphql/mutators/DatetimeUpdate.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -15,59 +15,59 @@
 block discarded – undo
15 15
 class DatetimeUpdate extends EntityMutator
16 16
 {
17 17
 
18
-    /**
19
-     * Defines the mutation data modification closure.
20
-     *
21
-     * @param EEM_Datetime $model
22
-     * @param Datetime     $type
23
-     * @return callable
24
-     */
25
-    public static function mutateAndGetPayload(EEM_Datetime $model, Datetime $type)
26
-    {
27
-        /**
28
-         * Updates an entity.
29
-         *
30
-         * @param array       $input   The input for the mutation
31
-         * @param AppContext  $context The AppContext passed down to all resolvers
32
-         * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
33
-         * @return array
34
-         * @throws EE_Error
35
-         * @throws ReflectionException
36
-         */
37
-        return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
38
-            try {
39
-                /** @var EE_Datetime $entity */
40
-                $entity = EntityMutator::getEntityFromInputData($model, $input);
18
+	/**
19
+	 * Defines the mutation data modification closure.
20
+	 *
21
+	 * @param EEM_Datetime $model
22
+	 * @param Datetime     $type
23
+	 * @return callable
24
+	 */
25
+	public static function mutateAndGetPayload(EEM_Datetime $model, Datetime $type)
26
+	{
27
+		/**
28
+		 * Updates an entity.
29
+		 *
30
+		 * @param array       $input   The input for the mutation
31
+		 * @param AppContext  $context The AppContext passed down to all resolvers
32
+		 * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
33
+		 * @return array
34
+		 * @throws EE_Error
35
+		 * @throws ReflectionException
36
+		 */
37
+		return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
38
+			try {
39
+				/** @var EE_Datetime $entity */
40
+				$entity = EntityMutator::getEntityFromInputData($model, $input);
41 41
 
42
-                $tickets = [];
43
-                $args = DatetimeMutation::prepareFields($input);
42
+				$tickets = [];
43
+				$args = DatetimeMutation::prepareFields($input);
44 44
 
45
-                if (isset($args['tickets'])) {
46
-                    $tickets = $args['tickets'];
47
-                    unset($args['tickets']);
48
-                }
45
+				if (isset($args['tickets'])) {
46
+					$tickets = $args['tickets'];
47
+					unset($args['tickets']);
48
+				}
49 49
 
50
-                // Update the entity
51
-                $entity->save($args);
50
+				// Update the entity
51
+				$entity->save($args);
52 52
 
53
-                if (! empty($tickets)) {
54
-                    DatetimeMutation::setRelatedTickets($entity, $tickets);
55
-                }
53
+				if (! empty($tickets)) {
54
+					DatetimeMutation::setRelatedTickets($entity, $tickets);
55
+				}
56 56
 
57
-                do_action('AHEE__EventEspresso_core_domain_services_graphql_mutators_datetime_update', $entity, $input);
58
-            } catch (Exception $exception) {
59
-                EntityMutator::handleExceptions(
60
-                    $exception,
61
-                    esc_html__(
62
-                        'The datetime could not be updated because of the following error(s)',
63
-                        'event_espresso'
64
-                    )
65
-                );
66
-            }
57
+				do_action('AHEE__EventEspresso_core_domain_services_graphql_mutators_datetime_update', $entity, $input);
58
+			} catch (Exception $exception) {
59
+				EntityMutator::handleExceptions(
60
+					$exception,
61
+					esc_html__(
62
+						'The datetime could not be updated because of the following error(s)',
63
+						'event_espresso'
64
+					)
65
+				);
66
+			}
67 67
 
68
-            return [
69
-                'id' => $entity->ID(),
70
-            ];
71
-        };
72
-    }
68
+			return [
69
+				'id' => $entity->ID(),
70
+			];
71
+		};
72
+	}
73 73
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
          * @throws EE_Error
35 35
          * @throws ReflectionException
36 36
          */
37
-        return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
37
+        return static function(array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
38 38
             try {
39 39
                 /** @var EE_Datetime $entity */
40 40
                 $entity = EntityMutator::getEntityFromInputData($model, $input);
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 // Update the entity
51 51
                 $entity->save($args);
52 52
 
53
-                if (! empty($tickets)) {
53
+                if ( ! empty($tickets)) {
54 54
                     DatetimeMutation::setRelatedTickets($entity, $tickets);
55 55
                 }
56 56
 
Please login to merge, or discard this patch.
core/domain/services/graphql/mutators/TicketCreate.php 2 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -13,68 +13,68 @@
 block discarded – undo
13 13
 class TicketCreate extends EntityMutator
14 14
 {
15 15
 
16
-    /**
17
-     * Defines the mutation data modification closure.
18
-     *
19
-     * @param EEM_Ticket $model
20
-     * @param Ticket     $type
21
-     * @return callable
22
-     */
23
-    public static function mutateAndGetPayload(EEM_Ticket $model, Ticket $type)
24
-    {
25
-        /**
26
-         * Creates an entity.
27
-         *
28
-         * @param array       $input   The input for the mutation
29
-         * @param AppContext  $context The AppContext passed down to all resolvers
30
-         * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
31
-         * @return array
32
-         */
33
-        return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
34
-            $id = null;
35
-            try {
36
-                EntityMutator::checkPermissions($model);
16
+	/**
17
+	 * Defines the mutation data modification closure.
18
+	 *
19
+	 * @param EEM_Ticket $model
20
+	 * @param Ticket     $type
21
+	 * @return callable
22
+	 */
23
+	public static function mutateAndGetPayload(EEM_Ticket $model, Ticket $type)
24
+	{
25
+		/**
26
+		 * Creates an entity.
27
+		 *
28
+		 * @param array       $input   The input for the mutation
29
+		 * @param AppContext  $context The AppContext passed down to all resolvers
30
+		 * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
31
+		 * @return array
32
+		 */
33
+		return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
34
+			$id = null;
35
+			try {
36
+				EntityMutator::checkPermissions($model);
37 37
 
38
-                $datetimes = [];
39
-                $prices = [];
38
+				$datetimes = [];
39
+				$prices = [];
40 40
 
41
-                $args = TicketMutation::prepareFields($input);
41
+				$args = TicketMutation::prepareFields($input);
42 42
 
43
-                if (isset($args['datetimes'])) {
44
-                    $datetimes = $args['datetimes'];
45
-                    unset($args['datetimes']);
46
-                }
47
-                if (isset($args['prices'])) {
48
-                    $prices = $args['prices'];
49
-                    unset($args['prices']);
50
-                }
43
+				if (isset($args['datetimes'])) {
44
+					$datetimes = $args['datetimes'];
45
+					unset($args['datetimes']);
46
+				}
47
+				if (isset($args['prices'])) {
48
+					$prices = $args['prices'];
49
+					unset($args['prices']);
50
+				}
51 51
 
52
-                $entity = EE_Ticket::new_instance($args);
53
-                $id = $entity->save();
54
-                EntityMutator::validateResults($id);
52
+				$entity = EE_Ticket::new_instance($args);
53
+				$id = $entity->save();
54
+				EntityMutator::validateResults($id);
55 55
 
56
-                if (! empty($datetimes)) {
57
-                    TicketMutation::setRelatedDatetimes($entity, $datetimes);
58
-                }
59
-                // if prices are passed.
60
-                if (! empty($prices)) {
61
-                    TicketMutation::setRelatedPrices($entity, $prices);
62
-                }
56
+				if (! empty($datetimes)) {
57
+					TicketMutation::setRelatedDatetimes($entity, $datetimes);
58
+				}
59
+				// if prices are passed.
60
+				if (! empty($prices)) {
61
+					TicketMutation::setRelatedPrices($entity, $prices);
62
+				}
63 63
 
64
-                do_action('AHEE__EventEspresso_core_domain_services_graphql_mutators_ticket_create', $entity, $input);
65
-            } catch (Exception $exception) {
66
-                EntityMutator::handleExceptions(
67
-                    $exception,
68
-                    esc_html__(
69
-                        'The ticket could not be created because of the following error(s)',
70
-                        'event_espresso'
71
-                    )
72
-                );
73
-            }
64
+				do_action('AHEE__EventEspresso_core_domain_services_graphql_mutators_ticket_create', $entity, $input);
65
+			} catch (Exception $exception) {
66
+				EntityMutator::handleExceptions(
67
+					$exception,
68
+					esc_html__(
69
+						'The ticket could not be created because of the following error(s)',
70
+						'event_espresso'
71
+					)
72
+				);
73
+			}
74 74
 
75
-            return [
76
-                'id' => $id,
77
-            ];
78
-        };
79
-    }
75
+			return [
76
+				'id' => $id,
77
+			];
78
+		};
79
+	}
80 80
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
          * @param ResolveInfo $info    The ResolveInfo passed down to all resolvers
31 31
          * @return array
32 32
          */
33
-        return static function (array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
33
+        return static function(array $input, AppContext $context, ResolveInfo $info) use ($model, $type): array {
34 34
             $id = null;
35 35
             try {
36 36
                 EntityMutator::checkPermissions($model);
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
                 $id = $entity->save();
54 54
                 EntityMutator::validateResults($id);
55 55
 
56
-                if (! empty($datetimes)) {
56
+                if ( ! empty($datetimes)) {
57 57
                     TicketMutation::setRelatedDatetimes($entity, $datetimes);
58 58
                 }
59 59
                 // if prices are passed.
60
-                if (! empty($prices)) {
60
+                if ( ! empty($prices)) {
61 61
                     TicketMutation::setRelatedPrices($entity, $prices);
62 62
                 }
63 63
 
Please login to merge, or discard this patch.