Completed
Branch Gutenberg/create-ee_core-data-... (409285)
by
unknown
106:15 queued 93:05
created
core/domain/services/custom_post_types/RegisterCustomTaxonomies.php 1 patch
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -17,97 +17,97 @@
 block discarded – undo
17 17
 class RegisterCustomTaxonomies
18 18
 {
19 19
 
20
-    /**
21
-     * @var CustomTaxonomyDefinitions $custom_taxonomies
22
-     */
23
-    public $custom_taxonomies;
20
+	/**
21
+	 * @var CustomTaxonomyDefinitions $custom_taxonomies
22
+	 */
23
+	public $custom_taxonomies;
24 24
 
25 25
 
26
-    /**
27
-     * RegisterCustomTaxonomies constructor.
28
-     *
29
-     * @param CustomTaxonomyDefinitions $custom_taxonomies
30
-     */
31
-    public function __construct(CustomTaxonomyDefinitions $custom_taxonomies)
32
-    {
33
-        $this->custom_taxonomies = $custom_taxonomies;
34
-    }
26
+	/**
27
+	 * RegisterCustomTaxonomies constructor.
28
+	 *
29
+	 * @param CustomTaxonomyDefinitions $custom_taxonomies
30
+	 */
31
+	public function __construct(CustomTaxonomyDefinitions $custom_taxonomies)
32
+	{
33
+		$this->custom_taxonomies = $custom_taxonomies;
34
+	}
35 35
 
36 36
 
37
-    /**
38
-     * @return void
39
-     * @throws DomainException
40
-     */
41
-    public function registerCustomTaxonomies()
42
-    {
43
-        $custom_taxonomies = $this->custom_taxonomies->getCustomTaxonomyDefinitions();
44
-        foreach ($custom_taxonomies as $taxonomy => $tax) {
45
-            $this->registerCustomTaxonomy(
46
-                $taxonomy,
47
-                $tax['singular_name'],
48
-                $tax['plural_name'],
49
-                $tax['args']
50
-            );
51
-        }
52
-    }
37
+	/**
38
+	 * @return void
39
+	 * @throws DomainException
40
+	 */
41
+	public function registerCustomTaxonomies()
42
+	{
43
+		$custom_taxonomies = $this->custom_taxonomies->getCustomTaxonomyDefinitions();
44
+		foreach ($custom_taxonomies as $taxonomy => $tax) {
45
+			$this->registerCustomTaxonomy(
46
+				$taxonomy,
47
+				$tax['singular_name'],
48
+				$tax['plural_name'],
49
+				$tax['args']
50
+			);
51
+		}
52
+	}
53 53
 
54 54
 
55
-    /**
56
-     * Registers a custom taxonomy. Should be called before registering custom post types,
57
-     * otherwise you should link the taxonomy to the custom post type using 'register_taxonomy_for_object_type'.
58
-     *
59
-     * @param string $taxonomy_name      , eg 'books'
60
-     * @param string $singular_name      internationalized singular name
61
-     * @param string $plural_name        internationalized plural name
62
-     * @param array  $override_arguments like $args on http://codex.wordpress.org/Function_Reference/register_taxonomy
63
-     * @throws DomainException
64
-     */
65
-    public function registerCustomTaxonomy($taxonomy_name, $singular_name, $plural_name, array $override_arguments)
66
-    {
67
-        $result = register_taxonomy(
68
-            $taxonomy_name,
69
-            null,
70
-            $this->prepareArguments(
71
-                $singular_name,
72
-                $plural_name,
73
-                $override_arguments
74
-            )
75
-        );
76
-        if ($result instanceof WP_Error) {
77
-            throw new DomainException($result->get_error_message());
78
-        }
79
-    }
55
+	/**
56
+	 * Registers a custom taxonomy. Should be called before registering custom post types,
57
+	 * otherwise you should link the taxonomy to the custom post type using 'register_taxonomy_for_object_type'.
58
+	 *
59
+	 * @param string $taxonomy_name      , eg 'books'
60
+	 * @param string $singular_name      internationalized singular name
61
+	 * @param string $plural_name        internationalized plural name
62
+	 * @param array  $override_arguments like $args on http://codex.wordpress.org/Function_Reference/register_taxonomy
63
+	 * @throws DomainException
64
+	 */
65
+	public function registerCustomTaxonomy($taxonomy_name, $singular_name, $plural_name, array $override_arguments)
66
+	{
67
+		$result = register_taxonomy(
68
+			$taxonomy_name,
69
+			null,
70
+			$this->prepareArguments(
71
+				$singular_name,
72
+				$plural_name,
73
+				$override_arguments
74
+			)
75
+		);
76
+		if ($result instanceof WP_Error) {
77
+			throw new DomainException($result->get_error_message());
78
+		}
79
+	}
80 80
 
81 81
 
82
-    /**
83
-     * @param string $singular_name
84
-     * @param string $plural_name
85
-     * @param array  $override_arguments
86
-     * @since $VID:$
87
-     * @return array
88
-     */
89
-    protected function prepareArguments($singular_name, $plural_name, array $override_arguments)
90
-    {
91
-        $arguments = array(
92
-            'hierarchical'      => true,
93
-            'labels'            => array(
94
-                'name'          => $plural_name,
95
-                'singular_name' => $singular_name,
96
-            ),
97
-            'show_ui'           => true,
98
-            'show_ee_ui'        => true,
99
-            'show_admin_column' => true,
100
-            'query_var'         => true,
101
-            'show_in_nav_menus' => false,
102
-            'map_meta_cap'      => true,
103
-        );
104
-        if ($override_arguments) {
105
-            if (isset($override_args['labels'])) {
106
-                $labels = array_merge($arguments['labels'], $override_arguments['labels']);
107
-                $arguments['labels'] = $labels;
108
-            }
109
-            $arguments = array_merge($arguments, $override_arguments);
110
-        }
111
-        return $arguments;
112
-    }
82
+	/**
83
+	 * @param string $singular_name
84
+	 * @param string $plural_name
85
+	 * @param array  $override_arguments
86
+	 * @since $VID:$
87
+	 * @return array
88
+	 */
89
+	protected function prepareArguments($singular_name, $plural_name, array $override_arguments)
90
+	{
91
+		$arguments = array(
92
+			'hierarchical'      => true,
93
+			'labels'            => array(
94
+				'name'          => $plural_name,
95
+				'singular_name' => $singular_name,
96
+			),
97
+			'show_ui'           => true,
98
+			'show_ee_ui'        => true,
99
+			'show_admin_column' => true,
100
+			'query_var'         => true,
101
+			'show_in_nav_menus' => false,
102
+			'map_meta_cap'      => true,
103
+		);
104
+		if ($override_arguments) {
105
+			if (isset($override_args['labels'])) {
106
+				$labels = array_merge($arguments['labels'], $override_arguments['labels']);
107
+				$arguments['labels'] = $labels;
108
+			}
109
+			$arguments = array_merge($arguments, $override_arguments);
110
+		}
111
+		return $arguments;
112
+	}
113 113
 }
Please login to merge, or discard this patch.
core/domain/services/custom_post_types/RewriteRules.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,30 +13,30 @@
 block discarded – undo
13 13
 class RewriteRules
14 14
 {
15 15
 
16
-    const OPTION_KEY_FLUSH_REWRITE_RULES = 'ee_flush_rewrite_rules';
16
+	const OPTION_KEY_FLUSH_REWRITE_RULES = 'ee_flush_rewrite_rules';
17 17
 
18 18
 
19
-    /**
20
-     * This will flush rewrite rules on demand.  This actually gets called around wp init priority level 100.
21
-     *
22
-     * @return void
23
-     */
24
-    public function flush()
25
-    {
26
-        update_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, true);
27
-    }
19
+	/**
20
+	 * This will flush rewrite rules on demand.  This actually gets called around wp init priority level 100.
21
+	 *
22
+	 * @return void
23
+	 */
24
+	public function flush()
25
+	{
26
+		update_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, true);
27
+	}
28 28
 
29 29
 
30
-    /**
31
-     * This will flush rewrite rules on demand.  This actually gets called around wp init priority level 100.
32
-     *
33
-     * @return void
34
-     */
35
-    public function flushRewriteRules()
36
-    {
37
-        if (get_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, true)) {
38
-            flush_rewrite_rules();
39
-            update_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, false);
40
-        }
41
-    }
30
+	/**
31
+	 * This will flush rewrite rules on demand.  This actually gets called around wp init priority level 100.
32
+	 *
33
+	 * @return void
34
+	 */
35
+	public function flushRewriteRules()
36
+	{
37
+		if (get_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, true)) {
38
+			flush_rewrite_rules();
39
+			update_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, false);
40
+		}
41
+	}
42 42
 }
Please login to merge, or discard this patch.
core/domain/services/capabilities/CapabilitiesCheckerInterface.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -16,25 +16,25 @@
 block discarded – undo
16 16
 interface CapabilitiesCheckerInterface
17 17
 {
18 18
 
19
-    /**
20
-     * Verifies that the current user has ALL of the capabilities listed in the CapCheck DTO.
21
-     * If any of the individual capability checks fails, then the command will NOT be executed.
22
-     *
23
-     * @param CapCheckInterface|CapCheckInterface[] $cap_check
24
-     * @return bool
25
-     * @throws InvalidClassException
26
-     * @throws InsufficientPermissionsException
27
-     */
28
-    public function processCapCheck($cap_check);
19
+	/**
20
+	 * Verifies that the current user has ALL of the capabilities listed in the CapCheck DTO.
21
+	 * If any of the individual capability checks fails, then the command will NOT be executed.
22
+	 *
23
+	 * @param CapCheckInterface|CapCheckInterface[] $cap_check
24
+	 * @return bool
25
+	 * @throws InvalidClassException
26
+	 * @throws InsufficientPermissionsException
27
+	 */
28
+	public function processCapCheck($cap_check);
29 29
 
30 30
 
31
-    /**
32
-     * @param string $capability - the capability to be checked, like: 'ee_edit_registrations'
33
-     * @param string $context    - what the user is attempting to do, like: 'Edit Registration'
34
-     * @param int    $ID         - (optional) ID for item where current_user_can is being called from
35
-     * @return bool
36
-     * @throws InsufficientPermissionsException
37
-     * @throws InvalidClassException
38
-     */
39
-    public function process($capability, $context, $ID = 0);
31
+	/**
32
+	 * @param string $capability - the capability to be checked, like: 'ee_edit_registrations'
33
+	 * @param string $context    - what the user is attempting to do, like: 'Edit Registration'
34
+	 * @param int    $ID         - (optional) ID for item where current_user_can is being called from
35
+	 * @return bool
36
+	 * @throws InsufficientPermissionsException
37
+	 * @throws InvalidClassException
38
+	 */
39
+	public function process($capability, $context, $ID = 0);
40 40
 }
Please login to merge, or discard this patch.
core/domain/services/capabilities/RequiresCapCheckInterface.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
 interface RequiresCapCheckInterface
12 12
 {
13 13
 
14
-    /**
15
-     * @return CapCheckInterface
16
-     */
17
-    public function getCapCheck();
14
+	/**
15
+	 * @return CapCheckInterface
16
+	 */
17
+	public function getCapCheck();
18 18
 }
Please login to merge, or discard this patch.
core/domain/services/capabilities/CapCheckInterface.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,18 +12,18 @@
 block discarded – undo
12 12
 interface CapCheckInterface
13 13
 {
14 14
 
15
-    /**
16
-     * @return string
17
-     */
18
-    public function capability();
15
+	/**
16
+	 * @return string
17
+	 */
18
+	public function capability();
19 19
 
20
-    /**
21
-     * @return string
22
-     */
23
-    public function context();
20
+	/**
21
+	 * @return string
22
+	 */
23
+	public function context();
24 24
 
25
-    /**
26
-     * @return int|string
27
-     */
28
-    public function ID();
25
+	/**
26
+	 * @return int|string
27
+	 */
28
+	public function ID();
29 29
 }
Please login to merge, or discard this patch.
core/domain/services/factories/EmailAddressFactory.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -19,19 +19,19 @@
 block discarded – undo
19 19
 class EmailAddressFactory implements FactoryInterface
20 20
 {
21 21
 
22
-    /**
23
-     * @param string $email_address
24
-     * @return EmailAddress
25
-     * @throws EmailValidationException
26
-     * @throws InvalidDataTypeException
27
-     * @throws InvalidInterfaceException
28
-     * @throws InvalidArgumentException
29
-     */
30
-    public static function create($email_address)
31
-    {
32
-        return LoaderFactory::getLoader()->getNew(
33
-            'EventEspresso\core\domain\values\EmailAddress',
34
-            array($email_address)
35
-        );
36
-    }
22
+	/**
23
+	 * @param string $email_address
24
+	 * @return EmailAddress
25
+	 * @throws EmailValidationException
26
+	 * @throws InvalidDataTypeException
27
+	 * @throws InvalidInterfaceException
28
+	 * @throws InvalidArgumentException
29
+	 */
30
+	public static function create($email_address)
31
+	{
32
+		return LoaderFactory::getLoader()->getNew(
33
+			'EventEspresso\core\domain\values\EmailAddress',
34
+			array($email_address)
35
+		);
36
+	}
37 37
 }
Please login to merge, or discard this patch.
core/domain/services/ticket/CreateTicketLineItemService.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -16,41 +16,41 @@
 block discarded – undo
16 16
 class CreateTicketLineItemService extends DomainService
17 17
 {
18 18
 
19
-    /**
20
-     * @param \EE_Transaction $transaction
21
-     * @param \EE_Ticket      $ticket
22
-     * @param int             $quantity
23
-     * @return \EE_Line_Item
24
-     * @throws \EE_Error
25
-     * @throws UnexpectedEntityException
26
-     */
27
-    public function create(
28
-        \EE_Transaction $transaction,
29
-        \EE_Ticket $ticket,
30
-        $quantity = 1
31
-    ) {
32
-        $total_line_item = $transaction->total_line_item();
33
-        if (! $total_line_item instanceof \EE_Line_Item) {
34
-            throw new UnexpectedEntityException($total_line_item, 'EE_Line_Item');
35
-        }
36
-        // create new line item for ticket
37
-        $ticket_line_item = \EEH_Line_Item::add_ticket_purchase(
38
-            $total_line_item,
39
-            $ticket,
40
-            $quantity
41
-        );
42
-        if (! $ticket_line_item instanceof \EE_Line_Item) {
43
-            throw new UnexpectedEntityException($ticket_line_item, 'EE_Line_Item');
44
-        }
45
-        $total_line_item->save_this_and_descendants_to_txn($transaction->ID());
46
-        // apply any applicable promotions that were initially used during registration to new line items
47
-        do_action(
48
-            'AHEE__\EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler__handle__new_ticket_line_item_added',
49
-            $total_line_item,
50
-            $ticket,
51
-            $transaction,
52
-            $quantity
53
-        );
54
-        return $ticket_line_item;
55
-    }
19
+	/**
20
+	 * @param \EE_Transaction $transaction
21
+	 * @param \EE_Ticket      $ticket
22
+	 * @param int             $quantity
23
+	 * @return \EE_Line_Item
24
+	 * @throws \EE_Error
25
+	 * @throws UnexpectedEntityException
26
+	 */
27
+	public function create(
28
+		\EE_Transaction $transaction,
29
+		\EE_Ticket $ticket,
30
+		$quantity = 1
31
+	) {
32
+		$total_line_item = $transaction->total_line_item();
33
+		if (! $total_line_item instanceof \EE_Line_Item) {
34
+			throw new UnexpectedEntityException($total_line_item, 'EE_Line_Item');
35
+		}
36
+		// create new line item for ticket
37
+		$ticket_line_item = \EEH_Line_Item::add_ticket_purchase(
38
+			$total_line_item,
39
+			$ticket,
40
+			$quantity
41
+		);
42
+		if (! $ticket_line_item instanceof \EE_Line_Item) {
43
+			throw new UnexpectedEntityException($ticket_line_item, 'EE_Line_Item');
44
+		}
45
+		$total_line_item->save_this_and_descendants_to_txn($transaction->ID());
46
+		// apply any applicable promotions that were initially used during registration to new line items
47
+		do_action(
48
+			'AHEE__\EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler__handle__new_ticket_line_item_added',
49
+			$total_line_item,
50
+			$ticket,
51
+			$transaction,
52
+			$quantity
53
+		);
54
+		return $ticket_line_item;
55
+	}
56 56
 }
Please login to merge, or discard this patch.
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.
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/RequiresDependencyMapInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@
 block discarded – undo
16 16
 interface RequiresDependencyMapInterface
17 17
 {
18 18
 
19
-    /**
20
-     * @param EE_Dependency_Map $dependency_map
21
-     */
22
-    public function setDependencyMap($dependency_map);
19
+	/**
20
+	 * @param EE_Dependency_Map $dependency_map
21
+	 */
22
+	public function setDependencyMap($dependency_map);
23 23
 
24
-    /**
25
-     * @return EE_Dependency_Map
26
-     */
27
-    public function dependencyMap();
24
+	/**
25
+	 * @return EE_Dependency_Map
26
+	 */
27
+	public function dependencyMap();
28 28
 }
Please login to merge, or discard this patch.