Completed
Branch dependabot/composer/wp-graphql... (655d30)
by
unknown
09:38 queued 06:09
created
core/services/container/NewCoffeeMaker.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             case 'new_instance':
45 45
             case 'new_instance_from_db':
46 46
                 $injector = $this->injector();
47
-                $closure = function ($arguments) use ($recipe, $reflector, $method, $injector) {
47
+                $closure = function($arguments) use ($recipe, $reflector, $method, $injector) {
48 48
                     return call_user_func_array(
49 49
                         array($reflector->getName(), $method),
50 50
                         $injector->resolveDependencies($recipe, $reflector, $arguments)
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
                 };
53 53
                 break;
54 54
             case 'newInstance':
55
-                $closure = function () use ($reflector) {
55
+                $closure = function() use ($reflector) {
56 56
                     return $reflector->newInstance();
57 57
                 };
58 58
                 break;
59 59
             case 'newInstanceArgs':
60 60
             default:
61 61
                 $injector = $this->injector();
62
-                $closure = function ($arguments) use ($recipe, $reflector, $injector) {
62
+                $closure = function($arguments) use ($recipe, $reflector, $injector) {
63 63
                     return $reflector->newInstanceArgs(
64 64
                         $injector->resolveDependencies($recipe, $reflector, $arguments)
65 65
                     );
Please login to merge, or discard this patch.
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -18,51 +18,51 @@
 block discarded – undo
18 18
  */
19 19
 class NewCoffeeMaker extends CoffeeMaker
20 20
 {
21
-    /**
22
-     * @return string
23
-     */
24
-    public function type()
25
-    {
26
-        return CoffeeMaker::BREW_NEW;
27
-    }
21
+	/**
22
+	 * @return string
23
+	 */
24
+	public function type()
25
+	{
26
+		return CoffeeMaker::BREW_NEW;
27
+	}
28 28
 
29 29
 
30
-    /**
31
-     * @param RecipeInterface $recipe
32
-     * @param array           $arguments
33
-     * @return mixed
34
-     */
35
-    public function brew(RecipeInterface $recipe, $arguments = array())
36
-    {
37
-        $this->resolveClassAndFilepath($recipe);
38
-        $reflector = $this->injector()->getReflectionClass($recipe->fqcn());
39
-        $method = $this->resolveInstantiationMethod($reflector);
40
-        switch ($method) {
41
-            case 'instance':
42
-            case 'new_instance':
43
-            case 'new_instance_from_db':
44
-                $injector = $this->injector();
45
-                $closure = function ($arguments) use ($recipe, $reflector, $method, $injector) {
46
-                    return call_user_func_array(
47
-                        array($reflector->getName(), $method),
48
-                        $injector->resolveDependencies($recipe, $reflector, $arguments)
49
-                    );
50
-                };
51
-                break;
52
-            case 'newInstance':
53
-                $closure = function () use ($reflector) {
54
-                    return $reflector->newInstance();
55
-                };
56
-                break;
57
-            case 'newInstanceArgs':
58
-            default:
59
-                $injector = $this->injector();
60
-                $closure = function ($arguments) use ($recipe, $reflector, $injector) {
61
-                    return $reflector->newInstanceArgs(
62
-                        $injector->resolveDependencies($recipe, $reflector, $arguments)
63
-                    );
64
-                };
65
-        }
66
-        return $this->coffeePot()->addClosure($recipe->identifier(), $closure);
67
-    }
30
+	/**
31
+	 * @param RecipeInterface $recipe
32
+	 * @param array           $arguments
33
+	 * @return mixed
34
+	 */
35
+	public function brew(RecipeInterface $recipe, $arguments = array())
36
+	{
37
+		$this->resolveClassAndFilepath($recipe);
38
+		$reflector = $this->injector()->getReflectionClass($recipe->fqcn());
39
+		$method = $this->resolveInstantiationMethod($reflector);
40
+		switch ($method) {
41
+			case 'instance':
42
+			case 'new_instance':
43
+			case 'new_instance_from_db':
44
+				$injector = $this->injector();
45
+				$closure = function ($arguments) use ($recipe, $reflector, $method, $injector) {
46
+					return call_user_func_array(
47
+						array($reflector->getName(), $method),
48
+						$injector->resolveDependencies($recipe, $reflector, $arguments)
49
+					);
50
+				};
51
+				break;
52
+			case 'newInstance':
53
+				$closure = function () use ($reflector) {
54
+					return $reflector->newInstance();
55
+				};
56
+				break;
57
+			case 'newInstanceArgs':
58
+			default:
59
+				$injector = $this->injector();
60
+				$closure = function ($arguments) use ($recipe, $reflector, $injector) {
61
+					return $reflector->newInstanceArgs(
62
+						$injector->resolveDependencies($recipe, $reflector, $arguments)
63
+					);
64
+				};
65
+		}
66
+		return $this->coffeePot()->addClosure($recipe->identifier(), $closure);
67
+	}
68 68
 }
Please login to merge, or discard this patch.
core/services/commands/registration/CreateRegistrationCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     ) {
80 80
         // grab the related ticket object for this line_item
81 81
         $this->ticket = $ticket_line_item->ticket();
82
-        if (! $this->ticket instanceof EE_Ticket) {
82
+        if ( ! $this->ticket instanceof EE_Ticket) {
83 83
             throw new InvalidEntityException(
84 84
                 is_object($this->ticket) ? get_class($this->ticket) : gettype($this->ticket),
85 85
                 'EE_Ticket',
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function getCapCheck()
105 105
     {
106
-        if (! $this->cap_check instanceof CapCheckInterface) {
106
+        if ( ! $this->cap_check instanceof CapCheckInterface) {
107 107
             return new CapCheck('ee_edit_registrations', 'create_new_registration');
108 108
         }
109 109
         return $this->cap_check;
Please login to merge, or discard this patch.
Indentation   +147 added lines, -147 removed lines patch added patch discarded remove patch
@@ -25,151 +25,151 @@
 block discarded – undo
25 25
  */
26 26
 class CreateRegistrationCommand extends Command implements CommandRequiresCapCheckInterface
27 27
 {
28
-    /**
29
-     * @var EE_Transaction $transaction
30
-     */
31
-    private $transaction;
32
-
33
-    /**
34
-     * @var EE_Ticket $ticket
35
-     */
36
-    private $ticket;
37
-
38
-    /**
39
-     * @var EE_Line_Item $ticket_line_item
40
-     */
41
-    private $ticket_line_item;
42
-
43
-    /**
44
-     * @var int $reg_count
45
-     */
46
-    private $reg_count;
47
-
48
-    /**
49
-     * @var int $reg_group_size
50
-     */
51
-    private $reg_group_size;
52
-
53
-    /**
54
-     * @var string $reg_status
55
-     */
56
-    private $reg_status;
57
-
58
-    /**
59
-     * @var EE_Registration $registration
60
-     */
61
-    protected $registration;
62
-
63
-
64
-    /**
65
-     * CreateRegistrationCommand constructor.
66
-     *
67
-     * @param EE_Transaction $transaction
68
-     * @param EE_Line_Item   $ticket_line_item
69
-     * @param int            $reg_count
70
-     * @param int            $reg_group_size
71
-     * @param string         $reg_status
72
-     * @throws InvalidEntityException
73
-     */
74
-    public function __construct(
75
-        EE_Transaction $transaction,
76
-        EE_Line_Item $ticket_line_item,
77
-        $reg_count = 1,
78
-        $reg_group_size = 0,
79
-        $reg_status = RegStatus::INCOMPLETE
80
-    ) {
81
-        // grab the related ticket object for this line_item
82
-        $this->ticket = $ticket_line_item->ticket();
83
-        if (! $this->ticket instanceof EE_Ticket) {
84
-            throw new InvalidEntityException(
85
-                is_object($this->ticket) ? get_class($this->ticket) : gettype($this->ticket),
86
-                'EE_Ticket',
87
-                sprintf(
88
-                    esc_html__('Line item %s did not contain a valid ticket', 'event_espresso'),
89
-                    $ticket_line_item->ID()
90
-                )
91
-            );
92
-        }
93
-        $this->transaction = $transaction;
94
-        $this->ticket_line_item = $ticket_line_item;
95
-        $this->reg_count = absint($reg_count);
96
-        $this->reg_group_size = absint($reg_group_size);
97
-        $this->reg_status = $reg_status;
98
-    }
99
-
100
-
101
-    /**
102
-     * @return CapCheckInterface
103
-     * @throws InvalidDataTypeException
104
-     */
105
-    public function getCapCheck()
106
-    {
107
-        if (! $this->cap_check instanceof CapCheckInterface) {
108
-            return new CapCheck('ee_edit_registrations', 'create_new_registration');
109
-        }
110
-        return $this->cap_check;
111
-    }
112
-
113
-
114
-    /**
115
-     * @return EE_Transaction
116
-     */
117
-    public function transaction()
118
-    {
119
-        return $this->transaction;
120
-    }
121
-
122
-
123
-    /**
124
-     * @return EE_Ticket
125
-     */
126
-    public function ticket()
127
-    {
128
-        return $this->ticket;
129
-    }
130
-
131
-
132
-    /**
133
-     * @return EE_Line_Item
134
-     */
135
-    public function ticketLineItem()
136
-    {
137
-        return $this->ticket_line_item;
138
-    }
139
-
140
-
141
-    /**
142
-     * @return int
143
-     */
144
-    public function regCount()
145
-    {
146
-        return $this->reg_count;
147
-    }
148
-
149
-
150
-    /**
151
-     * @return int
152
-     */
153
-    public function regGroupSize()
154
-    {
155
-        return $this->reg_group_size;
156
-    }
157
-
158
-
159
-    /**
160
-     * @return string
161
-     */
162
-    public function regStatus()
163
-    {
164
-        return $this->reg_status;
165
-    }
166
-
167
-
168
-    /**
169
-     * @return EE_Registration
170
-     */
171
-    public function registration()
172
-    {
173
-        return $this->registration;
174
-    }
28
+	/**
29
+	 * @var EE_Transaction $transaction
30
+	 */
31
+	private $transaction;
32
+
33
+	/**
34
+	 * @var EE_Ticket $ticket
35
+	 */
36
+	private $ticket;
37
+
38
+	/**
39
+	 * @var EE_Line_Item $ticket_line_item
40
+	 */
41
+	private $ticket_line_item;
42
+
43
+	/**
44
+	 * @var int $reg_count
45
+	 */
46
+	private $reg_count;
47
+
48
+	/**
49
+	 * @var int $reg_group_size
50
+	 */
51
+	private $reg_group_size;
52
+
53
+	/**
54
+	 * @var string $reg_status
55
+	 */
56
+	private $reg_status;
57
+
58
+	/**
59
+	 * @var EE_Registration $registration
60
+	 */
61
+	protected $registration;
62
+
63
+
64
+	/**
65
+	 * CreateRegistrationCommand constructor.
66
+	 *
67
+	 * @param EE_Transaction $transaction
68
+	 * @param EE_Line_Item   $ticket_line_item
69
+	 * @param int            $reg_count
70
+	 * @param int            $reg_group_size
71
+	 * @param string         $reg_status
72
+	 * @throws InvalidEntityException
73
+	 */
74
+	public function __construct(
75
+		EE_Transaction $transaction,
76
+		EE_Line_Item $ticket_line_item,
77
+		$reg_count = 1,
78
+		$reg_group_size = 0,
79
+		$reg_status = RegStatus::INCOMPLETE
80
+	) {
81
+		// grab the related ticket object for this line_item
82
+		$this->ticket = $ticket_line_item->ticket();
83
+		if (! $this->ticket instanceof EE_Ticket) {
84
+			throw new InvalidEntityException(
85
+				is_object($this->ticket) ? get_class($this->ticket) : gettype($this->ticket),
86
+				'EE_Ticket',
87
+				sprintf(
88
+					esc_html__('Line item %s did not contain a valid ticket', 'event_espresso'),
89
+					$ticket_line_item->ID()
90
+				)
91
+			);
92
+		}
93
+		$this->transaction = $transaction;
94
+		$this->ticket_line_item = $ticket_line_item;
95
+		$this->reg_count = absint($reg_count);
96
+		$this->reg_group_size = absint($reg_group_size);
97
+		$this->reg_status = $reg_status;
98
+	}
99
+
100
+
101
+	/**
102
+	 * @return CapCheckInterface
103
+	 * @throws InvalidDataTypeException
104
+	 */
105
+	public function getCapCheck()
106
+	{
107
+		if (! $this->cap_check instanceof CapCheckInterface) {
108
+			return new CapCheck('ee_edit_registrations', 'create_new_registration');
109
+		}
110
+		return $this->cap_check;
111
+	}
112
+
113
+
114
+	/**
115
+	 * @return EE_Transaction
116
+	 */
117
+	public function transaction()
118
+	{
119
+		return $this->transaction;
120
+	}
121
+
122
+
123
+	/**
124
+	 * @return EE_Ticket
125
+	 */
126
+	public function ticket()
127
+	{
128
+		return $this->ticket;
129
+	}
130
+
131
+
132
+	/**
133
+	 * @return EE_Line_Item
134
+	 */
135
+	public function ticketLineItem()
136
+	{
137
+		return $this->ticket_line_item;
138
+	}
139
+
140
+
141
+	/**
142
+	 * @return int
143
+	 */
144
+	public function regCount()
145
+	{
146
+		return $this->reg_count;
147
+	}
148
+
149
+
150
+	/**
151
+	 * @return int
152
+	 */
153
+	public function regGroupSize()
154
+	{
155
+		return $this->reg_group_size;
156
+	}
157
+
158
+
159
+	/**
160
+	 * @return string
161
+	 */
162
+	public function regStatus()
163
+	{
164
+		return $this->reg_status;
165
+	}
166
+
167
+
168
+	/**
169
+	 * @return EE_Registration
170
+	 */
171
+	public function registration()
172
+	{
173
+		return $this->registration;
174
+	}
175 175
 }
Please login to merge, or discard this patch.
core/libraries/rest_api/controllers/rpc/Checkin.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             $force = false;
57 57
         }
58 58
         $reg = EEM_Registration::instance()->get_one_by_ID($reg_id);
59
-        if (! $reg instanceof EE_Registration) {
59
+        if ( ! $reg instanceof EE_Registration) {
60 60
             return $this->sendResponse(
61 61
                 new WP_Error(
62 62
                     'rest_registration_toggle_checkin_invalid_id',
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 )
72 72
             );
73 73
         }
74
-        if (! EE_Capabilities::instance()->current_user_can('ee_edit_checkin', 'rest_api_checkin_endpoint', $reg_id)) {
74
+        if ( ! EE_Capabilities::instance()->current_user_can('ee_edit_checkin', 'rest_api_checkin_endpoint', $reg_id)) {
75 75
             return $this->sendResponse(
76 76
                 new WP_Error(
77 77
                     'rest_user_cannot_toggle_checkin',
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         $success = $reg->toggle_checkin_status($dtt_id, ! $force);
87 87
         if ($success === false) {
88 88
             // check if we know they can't check in because they're not approved and we aren't forcing
89
-            if (! $reg->is_approved() && ! $force) {
89
+            if ( ! $reg->is_approved() && ! $force) {
90 90
                 // rely on EE_Error::add_error messages to have been added to give more data about why it failed
91 91
                 return $this->sendResponse(
92 92
                     new WP_Error(
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 ),
119 119
             )
120 120
         );
121
-        if (! $checkin instanceof EE_Checkin) {
121
+        if ( ! $checkin instanceof EE_Checkin) {
122 122
             return $this->sendResponse(
123 123
                 new WP_Error(
124 124
                     'rest_toggle_checkin_error',
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         }
138 138
         $get_request = new WP_REST_Request(
139 139
             'GET',
140
-            '/' . EED_Core_Rest_Api::ee_api_namespace . 'v' . $version . '/checkins/' . $checkin->ID()
140
+            '/'.EED_Core_Rest_Api::ee_api_namespace.'v'.$version.'/checkins/'.$checkin->ID()
141 141
         );
142 142
         $get_request->set_url_params(
143 143
             array(
Please login to merge, or discard this patch.
Indentation   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -25,124 +25,124 @@
 block discarded – undo
25 25
  */
26 26
 class Checkin extends Base
27 27
 {
28
-    /**
29
-     * @param WP_REST_Request $request
30
-     * @param string          $version
31
-     * @return WP_Error|WP_REST_Response
32
-     */
33
-    public static function handleRequestToggleCheckin(WP_REST_Request $request, $version)
34
-    {
35
-        $controller = new Checkin();
36
-        return $controller->createCheckinCheckoutObject($request, $version);
37
-    }
28
+	/**
29
+	 * @param WP_REST_Request $request
30
+	 * @param string          $version
31
+	 * @return WP_Error|WP_REST_Response
32
+	 */
33
+	public static function handleRequestToggleCheckin(WP_REST_Request $request, $version)
34
+	{
35
+		$controller = new Checkin();
36
+		return $controller->createCheckinCheckoutObject($request, $version);
37
+	}
38 38
 
39 39
 
40
-    /**
41
-     * Toggles whether the user is checked in or not.
42
-     *
43
-     * @param WP_REST_Request $request
44
-     * @param string          $version
45
-     * @return WP_Error|WP_REST_Response
46
-     */
47
-    protected function createCheckinCheckoutObject(WP_REST_Request $request, $version)
48
-    {
49
-        $reg_id = $request->get_param('REG_ID');
50
-        $dtt_id = $request->get_param('DTT_ID');
51
-        $force = $request->get_param('force');
52
-        if ($force == 'true') {
53
-            $force = true;
54
-        } else {
55
-            $force = false;
56
-        }
57
-        $reg = EEM_Registration::instance()->get_one_by_ID($reg_id);
58
-        if (! $reg instanceof EE_Registration) {
59
-            return $this->sendResponse(
60
-                new WP_Error(
61
-                    'rest_registration_toggle_checkin_invalid_id',
62
-                    sprintf(
63
-                        esc_html__(
64
-                            'You cannot checkin registration with ID %1$s because it doesn\'t exist.',
65
-                            'event_espresso'
66
-                        ),
67
-                        $reg_id
68
-                    ),
69
-                    array('status' => 422)
70
-                )
71
-            );
72
-        }
73
-        if (! EE_Capabilities::instance()->current_user_can('ee_edit_checkin', 'rest_api_checkin_endpoint', $reg_id)) {
74
-            return $this->sendResponse(
75
-                new WP_Error(
76
-                    'rest_user_cannot_toggle_checkin',
77
-                    sprintf(
78
-                        esc_html__('You are not allowed to checkin registration with ID %1$s.', 'event_espresso'),
79
-                        $reg_id
80
-                    ),
81
-                    array('status' => 403)
82
-                )
83
-            );
84
-        }
85
-        $success = $reg->toggle_checkin_status($dtt_id, ! $force);
86
-        if ($success === false) {
87
-            // check if we know they can't check in because they're not approved and we aren't forcing
88
-            if (! $reg->is_approved() && ! $force) {
89
-                // rely on EE_Error::add_error messages to have been added to give more data about why it failed
90
-                return $this->sendResponse(
91
-                    new WP_Error(
92
-                        'rest_toggle_checkin_failed',
93
-                        esc_html__(
94
-                        // @codingStandardsIgnoreStart
95
-                            'Registration check-in failed because the registration is not approved / awaiting review. You may attempt to force checking in though.',
96
-                            // @codingStandardsIgnoreEnd
97
-                            'event_espresso'
98
-                        )
99
-                    )
100
-                );
101
-            }
102
-            return $this->sendResponse(
103
-                new WP_Error(
104
-                    'rest_toggle_checkin_failed_not_forceable',
105
-                    esc_html__('Registration checkin failed. Please see additional error data.', 'event_espresso')
106
-                )
107
-            );
108
-        }
109
-        $checkin = EEM_Checkin::instance()->get_one(
110
-            array(
111
-                array(
112
-                    'REG_ID' => $reg_id,
113
-                    'DTT_ID' => $dtt_id,
114
-                ),
115
-                'order_by' => array(
116
-                    'CHK_timestamp' => 'DESC',
117
-                ),
118
-            )
119
-        );
120
-        if (! $checkin instanceof EE_Checkin) {
121
-            return $this->sendResponse(
122
-                new WP_Error(
123
-                    'rest_toggle_checkin_error',
124
-                    sprintf(
125
-                        esc_html__(
126
-                        // @codingStandardsIgnoreStart
127
-                            'Supposedly we created a new checkin object for registration %1$s at datetime %2$s, but we can\'t find it.',
128
-                            // @codingStandardsIgnoreEnd
129
-                            'event_espresso'
130
-                        ),
131
-                        $reg_id,
132
-                        $dtt_id
133
-                    )
134
-                )
135
-            );
136
-        }
137
-        $get_request = new WP_REST_Request(
138
-            'GET',
139
-            '/' . EED_Core_Rest_Api::ee_api_namespace . 'v' . $version . '/checkins/' . $checkin->ID()
140
-        );
141
-        $get_request->set_url_params(
142
-            array(
143
-                'id' => $checkin->ID(),
144
-            )
145
-        );
146
-        return Read::handleRequestGetOne($get_request, $version, 'Checkin');
147
-    }
40
+	/**
41
+	 * Toggles whether the user is checked in or not.
42
+	 *
43
+	 * @param WP_REST_Request $request
44
+	 * @param string          $version
45
+	 * @return WP_Error|WP_REST_Response
46
+	 */
47
+	protected function createCheckinCheckoutObject(WP_REST_Request $request, $version)
48
+	{
49
+		$reg_id = $request->get_param('REG_ID');
50
+		$dtt_id = $request->get_param('DTT_ID');
51
+		$force = $request->get_param('force');
52
+		if ($force == 'true') {
53
+			$force = true;
54
+		} else {
55
+			$force = false;
56
+		}
57
+		$reg = EEM_Registration::instance()->get_one_by_ID($reg_id);
58
+		if (! $reg instanceof EE_Registration) {
59
+			return $this->sendResponse(
60
+				new WP_Error(
61
+					'rest_registration_toggle_checkin_invalid_id',
62
+					sprintf(
63
+						esc_html__(
64
+							'You cannot checkin registration with ID %1$s because it doesn\'t exist.',
65
+							'event_espresso'
66
+						),
67
+						$reg_id
68
+					),
69
+					array('status' => 422)
70
+				)
71
+			);
72
+		}
73
+		if (! EE_Capabilities::instance()->current_user_can('ee_edit_checkin', 'rest_api_checkin_endpoint', $reg_id)) {
74
+			return $this->sendResponse(
75
+				new WP_Error(
76
+					'rest_user_cannot_toggle_checkin',
77
+					sprintf(
78
+						esc_html__('You are not allowed to checkin registration with ID %1$s.', 'event_espresso'),
79
+						$reg_id
80
+					),
81
+					array('status' => 403)
82
+				)
83
+			);
84
+		}
85
+		$success = $reg->toggle_checkin_status($dtt_id, ! $force);
86
+		if ($success === false) {
87
+			// check if we know they can't check in because they're not approved and we aren't forcing
88
+			if (! $reg->is_approved() && ! $force) {
89
+				// rely on EE_Error::add_error messages to have been added to give more data about why it failed
90
+				return $this->sendResponse(
91
+					new WP_Error(
92
+						'rest_toggle_checkin_failed',
93
+						esc_html__(
94
+						// @codingStandardsIgnoreStart
95
+							'Registration check-in failed because the registration is not approved / awaiting review. You may attempt to force checking in though.',
96
+							// @codingStandardsIgnoreEnd
97
+							'event_espresso'
98
+						)
99
+					)
100
+				);
101
+			}
102
+			return $this->sendResponse(
103
+				new WP_Error(
104
+					'rest_toggle_checkin_failed_not_forceable',
105
+					esc_html__('Registration checkin failed. Please see additional error data.', 'event_espresso')
106
+				)
107
+			);
108
+		}
109
+		$checkin = EEM_Checkin::instance()->get_one(
110
+			array(
111
+				array(
112
+					'REG_ID' => $reg_id,
113
+					'DTT_ID' => $dtt_id,
114
+				),
115
+				'order_by' => array(
116
+					'CHK_timestamp' => 'DESC',
117
+				),
118
+			)
119
+		);
120
+		if (! $checkin instanceof EE_Checkin) {
121
+			return $this->sendResponse(
122
+				new WP_Error(
123
+					'rest_toggle_checkin_error',
124
+					sprintf(
125
+						esc_html__(
126
+						// @codingStandardsIgnoreStart
127
+							'Supposedly we created a new checkin object for registration %1$s at datetime %2$s, but we can\'t find it.',
128
+							// @codingStandardsIgnoreEnd
129
+							'event_espresso'
130
+						),
131
+						$reg_id,
132
+						$dtt_id
133
+					)
134
+				)
135
+			);
136
+		}
137
+		$get_request = new WP_REST_Request(
138
+			'GET',
139
+			'/' . EED_Core_Rest_Api::ee_api_namespace . 'v' . $version . '/checkins/' . $checkin->ID()
140
+		);
141
+		$get_request->set_url_params(
142
+			array(
143
+				'id' => $checkin->ID(),
144
+			)
145
+		);
146
+		return Read::handleRequestGetOne($get_request, $version, 'Checkin');
147
+	}
148 148
 }
Please login to merge, or discard this patch.
core/libraries/batch/Helpers/BatchRequestException.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,5 +14,5 @@
 block discarded – undo
14 14
  */
15 15
 class BatchRequestException extends \Exception
16 16
 {
17
-    // so far the same as exception
17
+	// so far the same as exception
18 18
 }
Please login to merge, or discard this patch.
core/domain/CaffeinatedInterface.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
  */
13 13
 interface CaffeinatedInterface
14 14
 {
15
-    /**
16
-     * Used to indicate when functionality is caffeinated or not.
17
-     * @return bool
18
-     */
19
-    public function isCaffeinated();
15
+	/**
16
+	 * Used to indicate when functionality is caffeinated or not.
17
+	 * @return bool
18
+	 */
19
+	public function isCaffeinated();
20 20
 }
Please login to merge, or discard this patch.
core/domain/services/session/SessionIdentifierInterface.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 interface SessionIdentifierInterface
6 6
 {
7 7
 
8
-    /**
9
-     * @return    string
10
-     */
11
-    public function id();
8
+	/**
9
+	 * @return    string
10
+	 */
11
+	public function id();
12 12
 }
Please login to merge, or discard this patch.
core/domain/services/ticket/CreateTicketLineItemService.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $quantity = 1
31 31
     ) {
32 32
         $total_line_item = $transaction->total_line_item();
33
-        if (! $total_line_item instanceof \EE_Line_Item) {
33
+        if ( ! $total_line_item instanceof \EE_Line_Item) {
34 34
             throw new UnexpectedEntityException($total_line_item, 'EE_Line_Item');
35 35
         }
36 36
         // create new line item for ticket
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             $ticket,
40 40
             $quantity
41 41
         );
42
-        if (! $ticket_line_item instanceof \EE_Line_Item) {
42
+        if ( ! $ticket_line_item instanceof \EE_Line_Item) {
43 43
             throw new UnexpectedEntityException($ticket_line_item, 'EE_Line_Item');
44 44
         }
45 45
         $total_line_item->save_this_and_descendants_to_txn($transaction->ID());
Please login to merge, or discard this patch.
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -15,41 +15,41 @@
 block discarded – undo
15 15
  */
16 16
 class CreateTicketLineItemService extends DomainService
17 17
 {
18
-    /**
19
-     * @param \EE_Transaction $transaction
20
-     * @param \EE_Ticket      $ticket
21
-     * @param int             $quantity
22
-     * @return \EE_Line_Item
23
-     * @throws \EE_Error
24
-     * @throws UnexpectedEntityException
25
-     */
26
-    public function create(
27
-        \EE_Transaction $transaction,
28
-        \EE_Ticket $ticket,
29
-        $quantity = 1
30
-    ) {
31
-        $total_line_item = $transaction->total_line_item();
32
-        if (! $total_line_item instanceof \EE_Line_Item) {
33
-            throw new UnexpectedEntityException($total_line_item, 'EE_Line_Item');
34
-        }
35
-        // create new line item for ticket
36
-        $ticket_line_item = \EEH_Line_Item::add_ticket_purchase(
37
-            $total_line_item,
38
-            $ticket,
39
-            $quantity
40
-        );
41
-        if (! $ticket_line_item instanceof \EE_Line_Item) {
42
-            throw new UnexpectedEntityException($ticket_line_item, 'EE_Line_Item');
43
-        }
44
-        $total_line_item->save_this_and_descendants_to_txn($transaction->ID());
45
-        // apply any applicable promotions that were initially used during registration to new line items
46
-        do_action(
47
-            'AHEE__\EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler__handle__new_ticket_line_item_added',
48
-            $total_line_item,
49
-            $ticket,
50
-            $transaction,
51
-            $quantity
52
-        );
53
-        return $ticket_line_item;
54
-    }
18
+	/**
19
+	 * @param \EE_Transaction $transaction
20
+	 * @param \EE_Ticket      $ticket
21
+	 * @param int             $quantity
22
+	 * @return \EE_Line_Item
23
+	 * @throws \EE_Error
24
+	 * @throws UnexpectedEntityException
25
+	 */
26
+	public function create(
27
+		\EE_Transaction $transaction,
28
+		\EE_Ticket $ticket,
29
+		$quantity = 1
30
+	) {
31
+		$total_line_item = $transaction->total_line_item();
32
+		if (! $total_line_item instanceof \EE_Line_Item) {
33
+			throw new UnexpectedEntityException($total_line_item, 'EE_Line_Item');
34
+		}
35
+		// create new line item for ticket
36
+		$ticket_line_item = \EEH_Line_Item::add_ticket_purchase(
37
+			$total_line_item,
38
+			$ticket,
39
+			$quantity
40
+		);
41
+		if (! $ticket_line_item instanceof \EE_Line_Item) {
42
+			throw new UnexpectedEntityException($ticket_line_item, 'EE_Line_Item');
43
+		}
44
+		$total_line_item->save_this_and_descendants_to_txn($transaction->ID());
45
+		// apply any applicable promotions that were initially used during registration to new line items
46
+		do_action(
47
+			'AHEE__\EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler__handle__new_ticket_line_item_added',
48
+			$total_line_item,
49
+			$ticket,
50
+			$transaction,
51
+			$quantity
52
+		);
53
+		return $ticket_line_item;
54
+	}
55 55
 }
Please login to merge, or discard this patch.
core/domain/SetHooksInterface.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -4,31 +4,31 @@
 block discarded – undo
4 4
 interface SetHooksInterface
5 5
 {
6 6
 
7
-    /**
8
-     * a place to add action and filter hooks for regular frontend requests
9
-     *
10
-     * @return void
11
-     */
12
-    public function setHooks();
7
+	/**
8
+	 * a place to add action and filter hooks for regular frontend requests
9
+	 *
10
+	 * @return void
11
+	 */
12
+	public function setHooks();
13 13
 
14
-    /**
15
-     * a place to add action and filter hooks for regular WP admin requests
16
-     *
17
-     * @return void
18
-     */
19
-    public function setAdminHooks();
14
+	/**
15
+	 * a place to add action and filter hooks for regular WP admin requests
16
+	 *
17
+	 * @return void
18
+	 */
19
+	public function setAdminHooks();
20 20
 
21
-    /**
22
-     * a place to add action and filter hooks for AJAX requests
23
-     *
24
-     * @return void
25
-     */
26
-    public function setAjaxHooks();
21
+	/**
22
+	 * a place to add action and filter hooks for AJAX requests
23
+	 *
24
+	 * @return void
25
+	 */
26
+	public function setAjaxHooks();
27 27
 
28
-    /**
29
-     * a place to add action and filter hooks for REST API requests
30
-     *
31
-     * @return void
32
-     */
33
-    public function setApiHooks();
28
+	/**
29
+	 * a place to add action and filter hooks for REST API requests
30
+	 *
31
+	 * @return void
32
+	 */
33
+	public function setApiHooks();
34 34
 }
Please login to merge, or discard this patch.
core/domain/CapabilitiesActionRestrictionInterface.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -14,34 +14,34 @@
 block discarded – undo
14 14
  */
15 15
 interface CapabilitiesActionRestrictionInterface
16 16
 {
17
-    /**
18
-     * Return whether the item can be edited for the given context.
19
-     * @param Context $context
20
-     * @return bool
21
-     */
22
-    public function canEdit(Context $context);
23
-
24
-
25
-    /**
26
-     * Return whether the item can be read for the given context.
27
-     * @param Context $context
28
-     * @return bool
29
-     */
30
-    public function canRead(Context $context);
31
-
32
-
33
-    /**
34
-     * Return whether the item can be deleted for the given context.
35
-     * @param Context $context
36
-     * @return bool
37
-     */
38
-    public function canDelete(Context $context);
39
-
40
-
41
-    /**
42
-     * Return whether the item can be created for the given context
43
-     * @param Context $context
44
-     * @return bool
45
-     */
46
-    public function canCreate(Context $context);
17
+	/**
18
+	 * Return whether the item can be edited for the given context.
19
+	 * @param Context $context
20
+	 * @return bool
21
+	 */
22
+	public function canEdit(Context $context);
23
+
24
+
25
+	/**
26
+	 * Return whether the item can be read for the given context.
27
+	 * @param Context $context
28
+	 * @return bool
29
+	 */
30
+	public function canRead(Context $context);
31
+
32
+
33
+	/**
34
+	 * Return whether the item can be deleted for the given context.
35
+	 * @param Context $context
36
+	 * @return bool
37
+	 */
38
+	public function canDelete(Context $context);
39
+
40
+
41
+	/**
42
+	 * Return whether the item can be created for the given context
43
+	 * @param Context $context
44
+	 * @return bool
45
+	 */
46
+	public function canCreate(Context $context);
47 47
 }
Please login to merge, or discard this patch.