Completed
Branch FET/attendee-importer (7f98c3)
by
unknown
45:19 queued 36:19
created
core/services/commands/ticket/CreateTicketLineItemCommandHandler.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -19,41 +19,41 @@
 block discarded – undo
19 19
 {
20 20
 
21 21
 
22
-    /**
23
-     * @var CreateTicketLineItemService $factory
24
-     */
25
-    private $factory;
26
-
27
-
28
-    /**
29
-     * Command constructor
30
-     *
31
-     * @param CreateTicketLineItemService $factory
32
-     */
33
-    public function __construct(CreateTicketLineItemService $factory)
34
-    {
35
-        $this->factory = $factory;
36
-    }
37
-
38
-
39
-    /**
40
-     * @param \EventEspresso\core\services\commands\CommandInterface $command
41
-     * @return \EE_Line_Item
42
-     * @throws \EventEspresso\core\exceptions\InvalidEntityException
43
-     * @throws \EventEspresso\core\exceptions\UnexpectedEntityException
44
-     * @throws \EE_Error
45
-     */
46
-    public function handle(CommandInterface $command)
47
-    {
48
-        /** @var CreateTicketLineItemCommand $command */
49
-        if (! $command instanceof CreateTicketLineItemCommand) {
50
-            throw new InvalidEntityException(get_class($command), 'CreateTicketLineItemCommand');
51
-        }
52
-        // create new line item for ticket
53
-        return $this->factory->create(
54
-            $command->transaction(),
55
-            $command->ticket(),
56
-            $command->quantity()
57
-        );
58
-    }
22
+	/**
23
+	 * @var CreateTicketLineItemService $factory
24
+	 */
25
+	private $factory;
26
+
27
+
28
+	/**
29
+	 * Command constructor
30
+	 *
31
+	 * @param CreateTicketLineItemService $factory
32
+	 */
33
+	public function __construct(CreateTicketLineItemService $factory)
34
+	{
35
+		$this->factory = $factory;
36
+	}
37
+
38
+
39
+	/**
40
+	 * @param \EventEspresso\core\services\commands\CommandInterface $command
41
+	 * @return \EE_Line_Item
42
+	 * @throws \EventEspresso\core\exceptions\InvalidEntityException
43
+	 * @throws \EventEspresso\core\exceptions\UnexpectedEntityException
44
+	 * @throws \EE_Error
45
+	 */
46
+	public function handle(CommandInterface $command)
47
+	{
48
+		/** @var CreateTicketLineItemCommand $command */
49
+		if (! $command instanceof CreateTicketLineItemCommand) {
50
+			throw new InvalidEntityException(get_class($command), 'CreateTicketLineItemCommand');
51
+		}
52
+		// create new line item for ticket
53
+		return $this->factory->create(
54
+			$command->transaction(),
55
+			$command->ticket(),
56
+			$command->quantity()
57
+		);
58
+	}
59 59
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     public function handle(CommandInterface $command)
53 53
     {
54 54
         /** @var CreateTicketLineItemCommand $command */
55
-        if (! $command instanceof CreateTicketLineItemCommand) {
55
+        if ( ! $command instanceof CreateTicketLineItemCommand) {
56 56
             throw new InvalidEntityException(get_class($command), 'CreateTicketLineItemCommand');
57 57
         }
58 58
         // create new line item for ticket
Please login to merge, or discard this patch.
core/services/commands/ticket/CancelTicketLineItemCommand.php 1 patch
Indentation   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -16,112 +16,112 @@
 block discarded – undo
16 16
 {
17 17
 
18 18
 
19
-    /**
20
-     * @var \EE_Transaction $transaction
21
-     */
22
-    private $transaction;
23
-
24
-    /**
25
-     * @var \EE_Ticket $ticket
26
-     */
27
-    private $ticket;
28
-
29
-    /**
30
-     * @var \EE_Line_Item $ticket_line_item
31
-     */
32
-    protected $ticket_line_item;
33
-
34
-    /**
35
-     * @var int $quantity
36
-     */
37
-    protected $quantity;
38
-
39
-
40
-    /**
41
-     * @param \EE_Registration $registration
42
-     * @param int              $quantity
43
-     */
44
-    public static function fromRegistration(\EE_Registration $registration, $quantity = 1)
45
-    {
46
-        new self(
47
-            $registration->transaction(),
48
-            $registration->ticket(),
49
-            1,
50
-            $registration->ticket_line_item()
51
-        );
52
-    }
53
-
54
-
55
-    /**
56
-     * @param \EE_Line_Item $ticket_line_item
57
-     * @param int           $quantity
58
-     */
59
-    public static function fromTicketLineItem(
60
-        \EE_Line_Item $ticket_line_item,
61
-        $quantity = 1
62
-    ) {
63
-        new self(
64
-            $ticket_line_item->transaction(),
65
-            $ticket_line_item->ticket(),
66
-            $quantity,
67
-            $ticket_line_item
68
-        );
69
-    }
70
-
71
-
72
-    /**
73
-     * CancelTicketLineItemCommand constructor.
74
-     *
75
-     * @param \EE_Transaction $transaction
76
-     * @param \EE_Ticket      $ticket
77
-     * @param int             $quantity
78
-     * @param \EE_Line_Item   $ticket_line_item
79
-     */
80
-    public function __construct(
81
-        \EE_Transaction $transaction,
82
-        \EE_Ticket $ticket,
83
-        $quantity = 1,
84
-        \EE_Line_Item $ticket_line_item = null
85
-    ) {
86
-        $this->transaction = $transaction;
87
-        $this->ticket = $ticket;
88
-        $this->quantity = min(1, absint($quantity));
89
-        $this->ticket_line_item = $ticket_line_item;
90
-    }
91
-
92
-
93
-    /**
94
-     * @return \EE_Transaction
95
-     */
96
-    public function transaction()
97
-    {
98
-        return $this->transaction;
99
-    }
100
-
101
-
102
-    /**
103
-     * @return \EE_Ticket
104
-     */
105
-    public function ticket()
106
-    {
107
-        return $this->ticket;
108
-    }
109
-
110
-
111
-    /**
112
-     * @return \EE_Line_Item
113
-     */
114
-    public function ticketLineItem()
115
-    {
116
-        return $this->ticket_line_item;
117
-    }
118
-
119
-
120
-    /**
121
-     * @return int
122
-     */
123
-    public function quantity()
124
-    {
125
-        return $this->quantity;
126
-    }
19
+	/**
20
+	 * @var \EE_Transaction $transaction
21
+	 */
22
+	private $transaction;
23
+
24
+	/**
25
+	 * @var \EE_Ticket $ticket
26
+	 */
27
+	private $ticket;
28
+
29
+	/**
30
+	 * @var \EE_Line_Item $ticket_line_item
31
+	 */
32
+	protected $ticket_line_item;
33
+
34
+	/**
35
+	 * @var int $quantity
36
+	 */
37
+	protected $quantity;
38
+
39
+
40
+	/**
41
+	 * @param \EE_Registration $registration
42
+	 * @param int              $quantity
43
+	 */
44
+	public static function fromRegistration(\EE_Registration $registration, $quantity = 1)
45
+	{
46
+		new self(
47
+			$registration->transaction(),
48
+			$registration->ticket(),
49
+			1,
50
+			$registration->ticket_line_item()
51
+		);
52
+	}
53
+
54
+
55
+	/**
56
+	 * @param \EE_Line_Item $ticket_line_item
57
+	 * @param int           $quantity
58
+	 */
59
+	public static function fromTicketLineItem(
60
+		\EE_Line_Item $ticket_line_item,
61
+		$quantity = 1
62
+	) {
63
+		new self(
64
+			$ticket_line_item->transaction(),
65
+			$ticket_line_item->ticket(),
66
+			$quantity,
67
+			$ticket_line_item
68
+		);
69
+	}
70
+
71
+
72
+	/**
73
+	 * CancelTicketLineItemCommand constructor.
74
+	 *
75
+	 * @param \EE_Transaction $transaction
76
+	 * @param \EE_Ticket      $ticket
77
+	 * @param int             $quantity
78
+	 * @param \EE_Line_Item   $ticket_line_item
79
+	 */
80
+	public function __construct(
81
+		\EE_Transaction $transaction,
82
+		\EE_Ticket $ticket,
83
+		$quantity = 1,
84
+		\EE_Line_Item $ticket_line_item = null
85
+	) {
86
+		$this->transaction = $transaction;
87
+		$this->ticket = $ticket;
88
+		$this->quantity = min(1, absint($quantity));
89
+		$this->ticket_line_item = $ticket_line_item;
90
+	}
91
+
92
+
93
+	/**
94
+	 * @return \EE_Transaction
95
+	 */
96
+	public function transaction()
97
+	{
98
+		return $this->transaction;
99
+	}
100
+
101
+
102
+	/**
103
+	 * @return \EE_Ticket
104
+	 */
105
+	public function ticket()
106
+	{
107
+		return $this->ticket;
108
+	}
109
+
110
+
111
+	/**
112
+	 * @return \EE_Line_Item
113
+	 */
114
+	public function ticketLineItem()
115
+	{
116
+		return $this->ticket_line_item;
117
+	}
118
+
119
+
120
+	/**
121
+	 * @return int
122
+	 */
123
+	public function quantity()
124
+	{
125
+		return $this->quantity;
126
+	}
127 127
 }
Please login to merge, or discard this patch.
core/services/commands/ticket/CancelTicketLineItemCommandHandler.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -22,38 +22,38 @@
 block discarded – undo
22 22
 {
23 23
 
24 24
 
25
-    /**
26
-     * @var CancelTicketLineItemService $cancel_ticket_line_item_service
27
-     */
28
-    private $cancel_ticket_line_item_service;
29
-
30
-
31
-    /**
32
-     * Command constructor
33
-     *
34
-     * @param CancelTicketLineItemService $cancel_ticket_line_item_service
35
-     */
36
-    public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service)
37
-    {
38
-        $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service;
39
-    }
40
-
41
-
42
-    /**
43
-     * @param \EventEspresso\core\services\commands\CommandInterface $command
44
-     * @return mixed
45
-     */
46
-    public function handle(CommandInterface $command)
47
-    {
48
-        /** @var CancelTicketLineItemCommand $command */
49
-        if (! $command instanceof CancelTicketLineItemCommand) {
50
-            throw new InvalidEntityException(get_class($command), 'CancelTicketLineItemCommand');
51
-        }
52
-        return $this->cancel_ticket_line_item_service->cancel(
53
-            $command->transaction(),
54
-            $command->ticket(),
55
-            $command->quantity(),
56
-            $command->ticketLineItem()
57
-        );
58
-    }
25
+	/**
26
+	 * @var CancelTicketLineItemService $cancel_ticket_line_item_service
27
+	 */
28
+	private $cancel_ticket_line_item_service;
29
+
30
+
31
+	/**
32
+	 * Command constructor
33
+	 *
34
+	 * @param CancelTicketLineItemService $cancel_ticket_line_item_service
35
+	 */
36
+	public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service)
37
+	{
38
+		$this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service;
39
+	}
40
+
41
+
42
+	/**
43
+	 * @param \EventEspresso\core\services\commands\CommandInterface $command
44
+	 * @return mixed
45
+	 */
46
+	public function handle(CommandInterface $command)
47
+	{
48
+		/** @var CancelTicketLineItemCommand $command */
49
+		if (! $command instanceof CancelTicketLineItemCommand) {
50
+			throw new InvalidEntityException(get_class($command), 'CancelTicketLineItemCommand');
51
+		}
52
+		return $this->cancel_ticket_line_item_service->cancel(
53
+			$command->transaction(),
54
+			$command->ticket(),
55
+			$command->quantity(),
56
+			$command->ticketLineItem()
57
+		);
58
+	}
59 59
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     public function handle(CommandInterface $command)
52 52
     {
53 53
         /** @var CancelTicketLineItemCommand $command */
54
-        if (! $command instanceof CancelTicketLineItemCommand) {
54
+        if ( ! $command instanceof CancelTicketLineItemCommand) {
55 55
             throw new InvalidEntityException(get_class($command), 'CancelTicketLineItemCommand');
56 56
         }
57 57
         return $this->cancel_ticket_line_item_service->cancel(
Please login to merge, or discard this patch.
core/services/commands/ticket/CreateTicketLineItemCommand.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -16,77 +16,77 @@
 block discarded – undo
16 16
 {
17 17
 
18 18
 
19
-    /**
20
-     * @var \EE_Transaction $transaction
21
-     */
22
-    private $transaction;
23
-
24
-    /**
25
-     * @var \EE_Ticket $ticket
26
-     */
27
-    private $ticket;
28
-
29
-    /**
30
-     * @var int $quantity
31
-     */
32
-    private $quantity = 1;
33
-
34
-    /**
35
-     * @var \EE_Line_Item $ticket_line_item
36
-     */
37
-    protected $ticket_line_item;
38
-
39
-
40
-    /**
41
-     * CreateTicketLineItemCommand constructor.
42
-     *
43
-     * @param \EE_Transaction $transaction
44
-     * @param \EE_Ticket      $ticket
45
-     * @param int             $quantity
46
-     */
47
-    public function __construct(
48
-        \EE_Transaction $transaction,
49
-        \EE_Ticket $ticket,
50
-        $quantity = 1
51
-    ) {
52
-        $this->transaction = $transaction;
53
-        $this->ticket = $ticket;
54
-        $this->quantity = $quantity;
55
-    }
56
-
57
-
58
-    /**
59
-     * @return \EE_Transaction
60
-     */
61
-    public function transaction()
62
-    {
63
-        return $this->transaction;
64
-    }
65
-
66
-
67
-    /**
68
-     * @return \EE_Ticket
69
-     */
70
-    public function ticket()
71
-    {
72
-        return $this->ticket;
73
-    }
74
-
75
-
76
-    /**
77
-     * @return int
78
-     */
79
-    public function quantity()
80
-    {
81
-        return $this->quantity;
82
-    }
83
-
84
-
85
-    /**
86
-     * @return \EE_Line_Item
87
-     */
88
-    public function ticketLineItem()
89
-    {
90
-        return $this->ticket_line_item;
91
-    }
19
+	/**
20
+	 * @var \EE_Transaction $transaction
21
+	 */
22
+	private $transaction;
23
+
24
+	/**
25
+	 * @var \EE_Ticket $ticket
26
+	 */
27
+	private $ticket;
28
+
29
+	/**
30
+	 * @var int $quantity
31
+	 */
32
+	private $quantity = 1;
33
+
34
+	/**
35
+	 * @var \EE_Line_Item $ticket_line_item
36
+	 */
37
+	protected $ticket_line_item;
38
+
39
+
40
+	/**
41
+	 * CreateTicketLineItemCommand constructor.
42
+	 *
43
+	 * @param \EE_Transaction $transaction
44
+	 * @param \EE_Ticket      $ticket
45
+	 * @param int             $quantity
46
+	 */
47
+	public function __construct(
48
+		\EE_Transaction $transaction,
49
+		\EE_Ticket $ticket,
50
+		$quantity = 1
51
+	) {
52
+		$this->transaction = $transaction;
53
+		$this->ticket = $ticket;
54
+		$this->quantity = $quantity;
55
+	}
56
+
57
+
58
+	/**
59
+	 * @return \EE_Transaction
60
+	 */
61
+	public function transaction()
62
+	{
63
+		return $this->transaction;
64
+	}
65
+
66
+
67
+	/**
68
+	 * @return \EE_Ticket
69
+	 */
70
+	public function ticket()
71
+	{
72
+		return $this->ticket;
73
+	}
74
+
75
+
76
+	/**
77
+	 * @return int
78
+	 */
79
+	public function quantity()
80
+	{
81
+		return $this->quantity;
82
+	}
83
+
84
+
85
+	/**
86
+	 * @return \EE_Line_Item
87
+	 */
88
+	public function ticketLineItem()
89
+	{
90
+		return $this->ticket_line_item;
91
+	}
92 92
 }
Please login to merge, or discard this patch.
core/services/commands/attendee/CreateAttendeeCommandHandler.php 2 patches
Indentation   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -21,138 +21,138 @@
 block discarded – undo
21 21
 {
22 22
 
23 23
 
24
-    /**
25
-     * @var EEM_Attendee $attendee_model
26
-     */
27
-    protected $attendee_model;
24
+	/**
25
+	 * @var EEM_Attendee $attendee_model
26
+	 */
27
+	protected $attendee_model;
28 28
 
29 29
 
30
-    /**
31
-     * @param EEM_Attendee $attendee_model
32
-     */
33
-    public function __construct(EEM_Attendee $attendee_model)
34
-    {
35
-        $this->attendee_model = $attendee_model;
36
-    }
30
+	/**
31
+	 * @param EEM_Attendee $attendee_model
32
+	 */
33
+	public function __construct(EEM_Attendee $attendee_model)
34
+	{
35
+		$this->attendee_model = $attendee_model;
36
+	}
37 37
 
38 38
 
39
-    /**
40
-     * @param CommandInterface $command
41
-     * @return EE_Attendee
42
-     * @throws EE_Error
43
-     * @throws InvalidEntityException
44
-     */
45
-    public function handle(CommandInterface $command)
46
-    {
47
-        /** @var CreateAttendeeCommand $command */
48
-        if (! $command instanceof CreateAttendeeCommand) {
49
-            throw new InvalidEntityException(get_class($command), 'CreateAttendeeCommand');
50
-        }
51
-        // have we met before?
52
-        $attendee = $this->findExistingAttendee(
53
-            $command->registration(),
54
-            $command->attendeeDetails()
55
-        );
56
-        // did we find an already existing record for this attendee ?
57
-        if ($attendee instanceof EE_Attendee) {
58
-            $attendee = $this->updateExistingAttendeeData(
59
-                $attendee,
60
-                $command->attendeeDetails()
61
-            );
62
-        } else {
63
-            $attendee = $this->createNewAttendee(
64
-                $command->registration(),
65
-                $command->attendeeDetails()
66
-            );
67
-        }
68
-        return $attendee;
69
-    }
39
+	/**
40
+	 * @param CommandInterface $command
41
+	 * @return EE_Attendee
42
+	 * @throws EE_Error
43
+	 * @throws InvalidEntityException
44
+	 */
45
+	public function handle(CommandInterface $command)
46
+	{
47
+		/** @var CreateAttendeeCommand $command */
48
+		if (! $command instanceof CreateAttendeeCommand) {
49
+			throw new InvalidEntityException(get_class($command), 'CreateAttendeeCommand');
50
+		}
51
+		// have we met before?
52
+		$attendee = $this->findExistingAttendee(
53
+			$command->registration(),
54
+			$command->attendeeDetails()
55
+		);
56
+		// did we find an already existing record for this attendee ?
57
+		if ($attendee instanceof EE_Attendee) {
58
+			$attendee = $this->updateExistingAttendeeData(
59
+				$attendee,
60
+				$command->attendeeDetails()
61
+			);
62
+		} else {
63
+			$attendee = $this->createNewAttendee(
64
+				$command->registration(),
65
+				$command->attendeeDetails()
66
+			);
67
+		}
68
+		return $attendee;
69
+	}
70 70
 
71 71
 
72
-    /**
73
-     * find_existing_attendee
74
-     *
75
-     * @param EE_Registration $registration
76
-     * @param  array          $attendee_data
77
-     * @return EE_Attendee
78
-     */
79
-    private function findExistingAttendee(EE_Registration $registration, array $attendee_data)
80
-    {
81
-        $existing_attendee = null;
82
-        // does this attendee already exist in the db ?
83
-        // we're searching using a combination of first name, last name, AND email address
84
-        $ATT_fname = ! empty($attendee_data['ATT_fname'])
85
-            ? $attendee_data['ATT_fname']
86
-            : '';
87
-        $ATT_lname = ! empty($attendee_data['ATT_lname'])
88
-            ? $attendee_data['ATT_lname']
89
-            : '';
90
-        $ATT_email = ! empty($attendee_data['ATT_email'])
91
-            ? $attendee_data['ATT_email']
92
-            : '';
93
-        // but only if those have values
94
-        if ($ATT_fname && $ATT_lname && $ATT_email) {
95
-            $existing_attendee = $this->attendee_model->find_existing_attendee(
96
-                array(
97
-                    'ATT_fname' => $ATT_fname,
98
-                    'ATT_lname' => $ATT_lname,
99
-                    'ATT_email' => $ATT_email,
100
-                )
101
-            );
102
-        }
103
-        return apply_filters(
104
-            'FHEE_EventEspresso_core_services_commands_attendee_CreateAttendeeCommandHandler__findExistingAttendee__existing_attendee',
105
-            $existing_attendee,
106
-            $registration,
107
-            $attendee_data
108
-        );
109
-    }
72
+	/**
73
+	 * find_existing_attendee
74
+	 *
75
+	 * @param EE_Registration $registration
76
+	 * @param  array          $attendee_data
77
+	 * @return EE_Attendee
78
+	 */
79
+	private function findExistingAttendee(EE_Registration $registration, array $attendee_data)
80
+	{
81
+		$existing_attendee = null;
82
+		// does this attendee already exist in the db ?
83
+		// we're searching using a combination of first name, last name, AND email address
84
+		$ATT_fname = ! empty($attendee_data['ATT_fname'])
85
+			? $attendee_data['ATT_fname']
86
+			: '';
87
+		$ATT_lname = ! empty($attendee_data['ATT_lname'])
88
+			? $attendee_data['ATT_lname']
89
+			: '';
90
+		$ATT_email = ! empty($attendee_data['ATT_email'])
91
+			? $attendee_data['ATT_email']
92
+			: '';
93
+		// but only if those have values
94
+		if ($ATT_fname && $ATT_lname && $ATT_email) {
95
+			$existing_attendee = $this->attendee_model->find_existing_attendee(
96
+				array(
97
+					'ATT_fname' => $ATT_fname,
98
+					'ATT_lname' => $ATT_lname,
99
+					'ATT_email' => $ATT_email,
100
+				)
101
+			);
102
+		}
103
+		return apply_filters(
104
+			'FHEE_EventEspresso_core_services_commands_attendee_CreateAttendeeCommandHandler__findExistingAttendee__existing_attendee',
105
+			$existing_attendee,
106
+			$registration,
107
+			$attendee_data
108
+		);
109
+	}
110 110
 
111 111
 
112
-    /**
113
-     * _update_existing_attendee_data
114
-     * in case it has changed since last time they registered for an event
115
-     *
116
-     * @param EE_Attendee $existing_attendee
117
-     * @param  array      $attendee_data
118
-     * @return EE_Attendee
119
-     * @throws EE_Error
120
-     */
121
-    private function updateExistingAttendeeData(EE_Attendee $existing_attendee, array $attendee_data)
122
-    {
123
-        // first remove fname, lname, and email from attendee data
124
-        // because these properties will be exactly the same as the returned attendee object,
125
-        // since they were used in the query to get the attendee object in the first place
126
-        $dont_set = array('ATT_fname', 'ATT_lname', 'ATT_email');
127
-        // now loop thru what's left and add to attendee CPT
128
-        foreach ($attendee_data as $property_name => $property_value) {
129
-            if (! in_array($property_name, $dont_set, true)
130
-                && $this->attendee_model->has_field($property_name)
131
-            ) {
132
-                $existing_attendee->set($property_name, $property_value);
133
-            }
134
-        }
135
-        // better save that now
136
-        $existing_attendee->save();
137
-        return $existing_attendee;
138
-    }
112
+	/**
113
+	 * _update_existing_attendee_data
114
+	 * in case it has changed since last time they registered for an event
115
+	 *
116
+	 * @param EE_Attendee $existing_attendee
117
+	 * @param  array      $attendee_data
118
+	 * @return EE_Attendee
119
+	 * @throws EE_Error
120
+	 */
121
+	private function updateExistingAttendeeData(EE_Attendee $existing_attendee, array $attendee_data)
122
+	{
123
+		// first remove fname, lname, and email from attendee data
124
+		// because these properties will be exactly the same as the returned attendee object,
125
+		// since they were used in the query to get the attendee object in the first place
126
+		$dont_set = array('ATT_fname', 'ATT_lname', 'ATT_email');
127
+		// now loop thru what's left and add to attendee CPT
128
+		foreach ($attendee_data as $property_name => $property_value) {
129
+			if (! in_array($property_name, $dont_set, true)
130
+				&& $this->attendee_model->has_field($property_name)
131
+			) {
132
+				$existing_attendee->set($property_name, $property_value);
133
+			}
134
+		}
135
+		// better save that now
136
+		$existing_attendee->save();
137
+		return $existing_attendee;
138
+	}
139 139
 
140 140
 
141
-    /**
142
-     * create_new_attendee
143
-     *
144
-     * @param EE_Registration $registration
145
-     * @param  array          $attendee_data
146
-     * @return EE_Attendee
147
-     * @throws EE_Error
148
-     */
149
-    private function createNewAttendee(EE_Registration $registration, array $attendee_data)
150
-    {
151
-        // create new attendee object
152
-        $new_attendee = EE_Attendee::new_instance($attendee_data);
153
-        // set author to event creator
154
-        $new_attendee->set('ATT_author', $registration->event()->wp_user());
155
-        $new_attendee->save();
156
-        return $new_attendee;
157
-    }
141
+	/**
142
+	 * create_new_attendee
143
+	 *
144
+	 * @param EE_Registration $registration
145
+	 * @param  array          $attendee_data
146
+	 * @return EE_Attendee
147
+	 * @throws EE_Error
148
+	 */
149
+	private function createNewAttendee(EE_Registration $registration, array $attendee_data)
150
+	{
151
+		// create new attendee object
152
+		$new_attendee = EE_Attendee::new_instance($attendee_data);
153
+		// set author to event creator
154
+		$new_attendee->set('ATT_author', $registration->event()->wp_user());
155
+		$new_attendee->save();
156
+		return $new_attendee;
157
+	}
158 158
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function handle(CommandInterface $command)
46 46
     {
47 47
         /** @var CreateAttendeeCommand $command */
48
-        if (! $command instanceof CreateAttendeeCommand) {
48
+        if ( ! $command instanceof CreateAttendeeCommand) {
49 49
             throw new InvalidEntityException(get_class($command), 'CreateAttendeeCommand');
50 50
         }
51 51
         // have we met before?
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $dont_set = array('ATT_fname', 'ATT_lname', 'ATT_email');
127 127
         // now loop thru what's left and add to attendee CPT
128 128
         foreach ($attendee_data as $property_name => $property_value) {
129
-            if (! in_array($property_name, $dont_set, true)
129
+            if ( ! in_array($property_name, $dont_set, true)
130 130
                 && $this->attendee_model->has_field($property_name)
131 131
             ) {
132 132
                 $existing_attendee->set($property_name, $property_value);
Please login to merge, or discard this patch.
core/libraries/form_sections/form_handlers/InvalidFormHandlerException.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -13,25 +13,25 @@
 block discarded – undo
13 13
 class InvalidFormHandlerException extends \UnexpectedValueException
14 14
 {
15 15
 
16
-    /**
17
-     * InvalidFormHandlerException constructor.
18
-     *
19
-     * @param string     $actual the FormHandler object that was received
20
-     * @param string     $message
21
-     * @param int        $code
22
-     * @param \Exception $previous
23
-     */
24
-    public function __construct($actual, $message = '', $code = 0, \Exception $previous = null)
25
-    {
26
-        if (empty($message)) {
27
-            $message = sprintf(
28
-                __(
29
-                    'A valid Form Handler was expected but instead "%1$s" was received.',
30
-                    'event_espresso'
31
-                ),
32
-                $actual
33
-            );
34
-        }
35
-        parent::__construct($message, $code, $previous);
36
-    }
16
+	/**
17
+	 * InvalidFormHandlerException constructor.
18
+	 *
19
+	 * @param string     $actual the FormHandler object that was received
20
+	 * @param string     $message
21
+	 * @param int        $code
22
+	 * @param \Exception $previous
23
+	 */
24
+	public function __construct($actual, $message = '', $code = 0, \Exception $previous = null)
25
+	{
26
+		if (empty($message)) {
27
+			$message = sprintf(
28
+				__(
29
+					'A valid Form Handler was expected but instead "%1$s" was received.',
30
+					'event_espresso'
31
+				),
32
+				$actual
33
+			);
34
+		}
35
+		parent::__construct($message, $code, $previous);
36
+	}
37 37
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/strategies/filter/FormHtmlFilter.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
 abstract class FormHtmlFilter
15 15
 {
16 16
 
17
-    /**
18
-     * @param                             $html
19
-     * @param EE_Form_Section_Validatable $form_section
20
-     * @return string
21
-     */
22
-    abstract public function filterHtml($html, EE_Form_Section_Validatable $form_section);
17
+	/**
18
+	 * @param                             $html
19
+	 * @param EE_Form_Section_Validatable $form_section
20
+	 * @return string
21
+	 */
22
+	abstract public function filterHtml($html, EE_Form_Section_Validatable $form_section);
23 23
 }
Please login to merge, or discard this patch.
core/libraries/iframe_display/EventListIframeEmbedButton.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -12,49 +12,49 @@
 block discarded – undo
12 12
 class EventListIframeEmbedButton extends IframeEmbedButton
13 13
 {
14 14
 
15
-    /**
16
-     * EventListIframeEmbedButton constructor.
17
-     */
18
-    public function __construct()
19
-    {
20
-        parent::__construct(
21
-            esc_html__('Upcoming Event List', 'event_espresso'),
22
-            'event_list'
23
-        );
24
-    }
15
+	/**
16
+	 * EventListIframeEmbedButton constructor.
17
+	 */
18
+	public function __construct()
19
+	{
20
+		parent::__construct(
21
+			esc_html__('Upcoming Event List', 'event_espresso'),
22
+			'event_list'
23
+		);
24
+	}
25 25
 
26 26
 
27
-    public function addEmbedButton()
28
-    {
29
-        add_filter(
30
-            'FHEE__EE_Admin_Page___display_admin_list_table_page__after_list_table__template_args_array',
31
-            array($this, 'addEventListIframeEmbedButtonSection')
32
-        );
33
-        add_action(
34
-            'admin_enqueue_scripts',
35
-            array($this, 'embedButtonAssets'),
36
-            10
37
-        );
38
-    }
27
+	public function addEmbedButton()
28
+	{
29
+		add_filter(
30
+			'FHEE__EE_Admin_Page___display_admin_list_table_page__after_list_table__template_args_array',
31
+			array($this, 'addEventListIframeEmbedButtonSection')
32
+		);
33
+		add_action(
34
+			'admin_enqueue_scripts',
35
+			array($this, 'embedButtonAssets'),
36
+			10
37
+		);
38
+	}
39 39
 
40 40
 
41
-    /**
42
-     * Adds an iframe embed code button to the Event editor.
43
-     * return string
44
-     *
45
-     * @param array $after_list_table
46
-     * @return array
47
-     */
48
-    public function addEventListIframeEmbedButtonSection(array $after_list_table)
49
-    {
50
-        return \EEH_Array::insert_into_array(
51
-            $after_list_table,
52
-            array(
53
-                'iframe_embed_buttons' => $this->addIframeEmbedButtonsSection(
54
-                    array('event_list' => $this->embedButtonHtml())
55
-                ),
56
-            ),
57
-            'legend'
58
-        );
59
-    }
41
+	/**
42
+	 * Adds an iframe embed code button to the Event editor.
43
+	 * return string
44
+	 *
45
+	 * @param array $after_list_table
46
+	 * @return array
47
+	 */
48
+	public function addEventListIframeEmbedButtonSection(array $after_list_table)
49
+	{
50
+		return \EEH_Array::insert_into_array(
51
+			$after_list_table,
52
+			array(
53
+				'iframe_embed_buttons' => $this->addIframeEmbedButtonsSection(
54
+					array('event_list' => $this->embedButtonHtml())
55
+				),
56
+			),
57
+			'legend'
58
+		);
59
+	}
60 60
 }
Please login to merge, or discard this patch.
core/libraries/rest_api/RestException.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -14,54 +14,54 @@
 block discarded – undo
14 14
 class RestException extends \EE_Error
15 15
 {
16 16
 
17
-    /**
18
-     * @var array
19
-     */
20
-    protected $wp_error_data = array();
17
+	/**
18
+	 * @var array
19
+	 */
20
+	protected $wp_error_data = array();
21 21
 
22
-    protected $wp_error_code = '';
22
+	protected $wp_error_code = '';
23 23
 
24 24
 
25 25
 
26
-    public function __construct($string_code, $message, $wp_error_data = array(), $previous = null)
27
-    {
28
-        if (is_array($wp_error_data)
29
-            && isset($wp_error_data['status'])
30
-        ) {
31
-            $http_status_number = $wp_error_data['status'];
32
-        } else {
33
-            $http_status_number = 500;
34
-        }
35
-        parent::__construct(
36
-            $message,
37
-            $http_status_number,
38
-            $previous
39
-        );
40
-        $this->wp_error_data = $wp_error_data;
41
-        $this->wp_error_code = $string_code;
42
-    }
26
+	public function __construct($string_code, $message, $wp_error_data = array(), $previous = null)
27
+	{
28
+		if (is_array($wp_error_data)
29
+			&& isset($wp_error_data['status'])
30
+		) {
31
+			$http_status_number = $wp_error_data['status'];
32
+		} else {
33
+			$http_status_number = 500;
34
+		}
35
+		parent::__construct(
36
+			$message,
37
+			$http_status_number,
38
+			$previous
39
+		);
40
+		$this->wp_error_data = $wp_error_data;
41
+		$this->wp_error_code = $string_code;
42
+	}
43 43
 
44 44
 
45 45
 
46
-    /**
47
-     * Array of data that may have been set during the constructor, intended for WP_Error's data
48
-     *
49
-     * @return array
50
-     */
51
-    public function getData()
52
-    {
53
-        return $this->wp_error_data;
54
-    }
46
+	/**
47
+	 * Array of data that may have been set during the constructor, intended for WP_Error's data
48
+	 *
49
+	 * @return array
50
+	 */
51
+	public function getData()
52
+	{
53
+		return $this->wp_error_data;
54
+	}
55 55
 
56 56
 
57 57
 
58
-    /**
59
-     * Gets the error string
60
-     *
61
-     * @return string
62
-     */
63
-    public function getStringCode()
64
-    {
65
-        return $this->wp_error_code;
66
-    }
58
+	/**
59
+	 * Gets the error string
60
+	 *
61
+	 * @return string
62
+	 */
63
+	public function getStringCode()
64
+	{
65
+		return $this->wp_error_code;
66
+	}
67 67
 }
Please login to merge, or discard this patch.