Completed
Branch EDTR/standardize-dom-data (4f6981)
by
unknown
10:02 queued 59s
created
core/domain/entities/routing/handlers/admin/EspressoEventEditor.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -17,109 +17,109 @@
 block discarded – undo
17 17
 class EspressoEventEditor extends EspressoEventsAdmin
18 18
 {
19 19
 
20
-    /**
21
-     * returns true if the current request matches this route
22
-     *
23
-     * @return bool
24
-     * @since   $VID:$
25
-     */
26
-    public function matchesCurrentRequest()
27
-    {
28
-        return parent::matchesCurrentRequest()
29
-               && $this->admin_config->useAdvancedEditor()
30
-               && (
31
-                $this->request->getRequestParam('action') === 'create_new'
32
-                || $this->request->getRequestParam('action') === 'edit'
33
-            );
34
-    }
20
+	/**
21
+	 * returns true if the current request matches this route
22
+	 *
23
+	 * @return bool
24
+	 * @since   $VID:$
25
+	 */
26
+	public function matchesCurrentRequest()
27
+	{
28
+		return parent::matchesCurrentRequest()
29
+			   && $this->admin_config->useAdvancedEditor()
30
+			   && (
31
+				$this->request->getRequestParam('action') === 'create_new'
32
+				|| $this->request->getRequestParam('action') === 'edit'
33
+			);
34
+	}
35 35
 
36 36
 
37
-    /**
38
-     * @since $VID:$
39
-     */
40
-    protected function registerDependencies()
41
-    {
42
-        $this->dependency_map->registerDependencies(
43
-            'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData',
44
-            [
45
-                'EventEspresso\core\domain\entities\admin\GraphQLData\Datetimes'                 => EE_Dependency_Map::load_from_cache,
46
-                'EventEspresso\core\domain\entities\admin\GraphQLData\Prices'                    => EE_Dependency_Map::load_from_cache,
47
-                'EventEspresso\core\domain\entities\admin\GraphQLData\PriceTypes'                => EE_Dependency_Map::load_from_cache,
48
-                'EventEspresso\core\domain\entities\admin\GraphQLData\Tickets'                   => EE_Dependency_Map::load_from_cache,
49
-                'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities' => EE_Dependency_Map::load_from_cache,
50
-                'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations'    => EE_Dependency_Map::load_from_cache,
51
-            ]
52
-        );
53
-        $this->dependency_map->registerDependencies(
54
-            'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations',
55
-            [
56
-                'EEM_Datetime'   => EE_Dependency_Map::load_from_cache,
57
-                'EEM_Event'      => EE_Dependency_Map::load_from_cache,
58
-                'EEM_Price'      => EE_Dependency_Map::load_from_cache,
59
-                'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
60
-                'EEM_Ticket'     => EE_Dependency_Map::load_from_cache,
61
-            ]
62
-        );
63
-        $this->dependency_map->registerDependencies(
64
-            'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities',
65
-            [
66
-                'EEM_Datetime'                                                       => EE_Dependency_Map::load_from_cache,
67
-                'EEM_Event'                                                          => EE_Dependency_Map::load_from_cache,
68
-                'EEM_Price'                                                          => EE_Dependency_Map::load_from_cache,
69
-                'EEM_Price_Type'                                                     => EE_Dependency_Map::load_from_cache,
70
-                'EEM_Ticket'                                                         => EE_Dependency_Map::load_from_cache,
71
-                'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes' => EE_Dependency_Map::load_from_cache,
72
-            ]
73
-        );
74
-        $this->dependency_map->registerDependencies(
75
-            'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes',
76
-            [
77
-                'EventEspresso\core\domain\services\admin\entities\DefaultTickets' => EE_Dependency_Map::load_from_cache,
78
-                'EEM_Datetime'                                                     => EE_Dependency_Map::load_from_cache,
79
-            ]
80
-        );
81
-        $this->dependency_map->registerDependencies(
82
-            'EventEspresso\core\domain\services\admin\entities\DefaultTickets',
83
-            [
84
-                'EventEspresso\core\domain\services\admin\entities\DefaultPrices' => EE_Dependency_Map::load_from_cache,
85
-                'EEM_Ticket'                                                      => EE_Dependency_Map::load_from_cache,
86
-            ]
87
-        );
88
-        $this->dependency_map->registerDependencies(
89
-            'EventEspresso\core\domain\services\admin\entities\DefaultPrices',
90
-            [
91
-                'EEM_Price'      => EE_Dependency_Map::load_from_cache,
92
-                'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
93
-            ]
94
-        );
95
-        $this->dependency_map->registerDependencies(
96
-            'EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor',
97
-            [
98
-                'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData' => EE_Dependency_Map::load_from_cache,
99
-                'EventEspresso\core\services\json\JsonDataNodeValidator'                        => EE_Dependency_Map::load_from_cache,
100
-            ]
101
-        );
102
-        /** @var EventEditor $data_node */
103
-        $data_node = $this->loader->getShared('EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor');
104
-        $this->setDataNode($data_node);
105
-    }
37
+	/**
38
+	 * @since $VID:$
39
+	 */
40
+	protected function registerDependencies()
41
+	{
42
+		$this->dependency_map->registerDependencies(
43
+			'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData',
44
+			[
45
+				'EventEspresso\core\domain\entities\admin\GraphQLData\Datetimes'                 => EE_Dependency_Map::load_from_cache,
46
+				'EventEspresso\core\domain\entities\admin\GraphQLData\Prices'                    => EE_Dependency_Map::load_from_cache,
47
+				'EventEspresso\core\domain\entities\admin\GraphQLData\PriceTypes'                => EE_Dependency_Map::load_from_cache,
48
+				'EventEspresso\core\domain\entities\admin\GraphQLData\Tickets'                   => EE_Dependency_Map::load_from_cache,
49
+				'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities' => EE_Dependency_Map::load_from_cache,
50
+				'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations'    => EE_Dependency_Map::load_from_cache,
51
+			]
52
+		);
53
+		$this->dependency_map->registerDependencies(
54
+			'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations',
55
+			[
56
+				'EEM_Datetime'   => EE_Dependency_Map::load_from_cache,
57
+				'EEM_Event'      => EE_Dependency_Map::load_from_cache,
58
+				'EEM_Price'      => EE_Dependency_Map::load_from_cache,
59
+				'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
60
+				'EEM_Ticket'     => EE_Dependency_Map::load_from_cache,
61
+			]
62
+		);
63
+		$this->dependency_map->registerDependencies(
64
+			'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities',
65
+			[
66
+				'EEM_Datetime'                                                       => EE_Dependency_Map::load_from_cache,
67
+				'EEM_Event'                                                          => EE_Dependency_Map::load_from_cache,
68
+				'EEM_Price'                                                          => EE_Dependency_Map::load_from_cache,
69
+				'EEM_Price_Type'                                                     => EE_Dependency_Map::load_from_cache,
70
+				'EEM_Ticket'                                                         => EE_Dependency_Map::load_from_cache,
71
+				'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes' => EE_Dependency_Map::load_from_cache,
72
+			]
73
+		);
74
+		$this->dependency_map->registerDependencies(
75
+			'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes',
76
+			[
77
+				'EventEspresso\core\domain\services\admin\entities\DefaultTickets' => EE_Dependency_Map::load_from_cache,
78
+				'EEM_Datetime'                                                     => EE_Dependency_Map::load_from_cache,
79
+			]
80
+		);
81
+		$this->dependency_map->registerDependencies(
82
+			'EventEspresso\core\domain\services\admin\entities\DefaultTickets',
83
+			[
84
+				'EventEspresso\core\domain\services\admin\entities\DefaultPrices' => EE_Dependency_Map::load_from_cache,
85
+				'EEM_Ticket'                                                      => EE_Dependency_Map::load_from_cache,
86
+			]
87
+		);
88
+		$this->dependency_map->registerDependencies(
89
+			'EventEspresso\core\domain\services\admin\entities\DefaultPrices',
90
+			[
91
+				'EEM_Price'      => EE_Dependency_Map::load_from_cache,
92
+				'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
93
+			]
94
+		);
95
+		$this->dependency_map->registerDependencies(
96
+			'EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor',
97
+			[
98
+				'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData' => EE_Dependency_Map::load_from_cache,
99
+				'EventEspresso\core\services\json\JsonDataNodeValidator'                        => EE_Dependency_Map::load_from_cache,
100
+			]
101
+		);
102
+		/** @var EventEditor $data_node */
103
+		$data_node = $this->loader->getShared('EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor');
104
+		$this->setDataNode($data_node);
105
+	}
106 106
 
107 107
 
108
-    /**
109
-     * implements logic required to run during request
110
-     *
111
-     * @return bool
112
-     * @since   $VID:$
113
-     */
114
-    protected function requestHandler()
115
-    {
116
-        /** @var GraphQLManager $graphQL_manager */
117
-        $graphQL_manager = $this->loader->getShared('EventEspresso\core\services\graphql\GraphQLManager');
118
-        $graphQL_manager->init();
119
-        $this->asset_manager = $this->loader->getShared(
120
-            'EventEspresso\core\domain\services\assets\EspressoCoreAppAssetManager'
121
-        );
122
-        add_action('admin_enqueue_scripts', [$this->asset_manager, 'enqueueBrowserAssets'], 100);
123
-        return true;
124
-    }
108
+	/**
109
+	 * implements logic required to run during request
110
+	 *
111
+	 * @return bool
112
+	 * @since   $VID:$
113
+	 */
114
+	protected function requestHandler()
115
+	{
116
+		/** @var GraphQLManager $graphQL_manager */
117
+		$graphQL_manager = $this->loader->getShared('EventEspresso\core\services\graphql\GraphQLManager');
118
+		$graphQL_manager->init();
119
+		$this->asset_manager = $this->loader->getShared(
120
+			'EventEspresso\core\domain\services\assets\EspressoCoreAppAssetManager'
121
+		);
122
+		add_action('admin_enqueue_scripts', [$this->asset_manager, 'enqueueBrowserAssets'], 100);
123
+		return true;
124
+	}
125 125
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/handlers/admin/EspressoLegacyAdmin.php 1 patch
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -16,140 +16,140 @@
 block discarded – undo
16 16
 class EspressoLegacyAdmin extends AdminRoute
17 17
 {
18 18
 
19
-    /**
20
-     * @var LegacyAccountingAssetManager $asset_manager
21
-     */
22
-    protected $asset_manager;
19
+	/**
20
+	 * @var LegacyAccountingAssetManager $asset_manager
21
+	 */
22
+	protected $asset_manager;
23 23
 
24 24
 
25
-    /**
26
-     * returns true if the current request matches this route
27
-     *
28
-     * @return bool
29
-     * @since   $VID:$
30
-     */
31
-    public function matchesCurrentRequest()
32
-    {
33
-        return parent::matchesCurrentRequest() || $this->request->isAdminAjax();
34
-    }
25
+	/**
26
+	 * returns true if the current request matches this route
27
+	 *
28
+	 * @return bool
29
+	 * @since   $VID:$
30
+	 */
31
+	public function matchesCurrentRequest()
32
+	{
33
+		return parent::matchesCurrentRequest() || $this->request->isAdminAjax();
34
+	}
35 35
 
36 36
 
37
-    /**
38
-     * @since $VID:$
39
-     */
40
-    protected function registerDependencies()
41
-    {
42
-        $this->dependency_map->registerDependencies(
43
-            'EventEspresso\core\domain\services\assets\EspressoLegacyAdminAssetManager',
44
-            [
45
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
46
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
47
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
48
-            ]
49
-        );
50
-        $this->dependency_map->registerDependencies(
51
-            'EventEspresso\core\domain\services\assets\LegacyAccountingAssetManager',
52
-            [
53
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
54
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
55
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
56
-                'EE_Currency_Config'                                 => EE_Dependency_Map::load_from_cache,
57
-            ]
58
-        );
59
-        $this->dependency_map->registerDependencies(
60
-            'EE_Admin_Transactions_List_Table',
61
-            [
62
-                null,
63
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
64
-            ]
65
-        );
66
-        $this->dependency_map->registerDependencies(
67
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings',
68
-            ['EE_Registration_Config' => EE_Dependency_Map::load_from_cache]
69
-        );
70
-        $this->dependency_map->registerDependencies(
71
-            'EventEspresso\admin_pages\general_settings\OrganizationSettings',
72
-            [
73
-                'EE_Registry'                                             => EE_Dependency_Map::load_from_cache,
74
-                'EE_Organization_Config'                                  => EE_Dependency_Map::load_from_cache,
75
-                'EE_Core_Config'                                          => EE_Dependency_Map::load_from_cache,
76
-                'EE_Network_Core_Config'                                  => EE_Dependency_Map::load_from_cache,
77
-                'EventEspresso\core\services\address\CountrySubRegionDao' => EE_Dependency_Map::load_from_cache,
78
-            ]
79
-        );
80
-        $this->dependency_map->registerDependencies(
81
-            'EventEspresso\core\services\address\CountrySubRegionDao',
82
-            [
83
-                'EEM_State'                                            => EE_Dependency_Map::load_from_cache,
84
-                'EventEspresso\core\services\validators\JsonValidator' => EE_Dependency_Map::load_from_cache
85
-            ]
86
-        );
87
-        $this->dependency_map->registerDependencies(
88
-            'EventEspresso\core\domain\services\admin\registrations\list_table\QueryBuilder',
89
-            [
90
-                null,
91
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
92
-                'EEM_Registration'                            => EE_Dependency_Map::load_from_cache,
93
-            ]
94
-        );
95
-        $this->dependency_map->registerDependencies(
96
-            'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\AttendeeFilterHeader',
97
-            [
98
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
99
-                'EEM_Attendee'                                => EE_Dependency_Map::load_from_cache,
100
-            ]
101
-        );
102
-        $this->dependency_map->registerDependencies(
103
-            'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\DateFilterHeader',
104
-            [
105
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
106
-                'EEM_Datetime'                                => EE_Dependency_Map::load_from_cache,
107
-            ]
108
-        );
109
-        $this->dependency_map->registerDependencies(
110
-            'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\EventFilterHeader',
111
-            [
112
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
113
-                'EEM_Event'                                   => EE_Dependency_Map::load_from_cache,
114
-            ]
115
-        );
116
-        $this->dependency_map->registerDependencies(
117
-            'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\TicketFilterHeader',
118
-            [
119
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
120
-                'EEM_Ticket'                                  => EE_Dependency_Map::load_from_cache,
121
-            ]
122
-        );
123
-    }
37
+	/**
38
+	 * @since $VID:$
39
+	 */
40
+	protected function registerDependencies()
41
+	{
42
+		$this->dependency_map->registerDependencies(
43
+			'EventEspresso\core\domain\services\assets\EspressoLegacyAdminAssetManager',
44
+			[
45
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
46
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
47
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
48
+			]
49
+		);
50
+		$this->dependency_map->registerDependencies(
51
+			'EventEspresso\core\domain\services\assets\LegacyAccountingAssetManager',
52
+			[
53
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
54
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
55
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
56
+				'EE_Currency_Config'                                 => EE_Dependency_Map::load_from_cache,
57
+			]
58
+		);
59
+		$this->dependency_map->registerDependencies(
60
+			'EE_Admin_Transactions_List_Table',
61
+			[
62
+				null,
63
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
64
+			]
65
+		);
66
+		$this->dependency_map->registerDependencies(
67
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings',
68
+			['EE_Registration_Config' => EE_Dependency_Map::load_from_cache]
69
+		);
70
+		$this->dependency_map->registerDependencies(
71
+			'EventEspresso\admin_pages\general_settings\OrganizationSettings',
72
+			[
73
+				'EE_Registry'                                             => EE_Dependency_Map::load_from_cache,
74
+				'EE_Organization_Config'                                  => EE_Dependency_Map::load_from_cache,
75
+				'EE_Core_Config'                                          => EE_Dependency_Map::load_from_cache,
76
+				'EE_Network_Core_Config'                                  => EE_Dependency_Map::load_from_cache,
77
+				'EventEspresso\core\services\address\CountrySubRegionDao' => EE_Dependency_Map::load_from_cache,
78
+			]
79
+		);
80
+		$this->dependency_map->registerDependencies(
81
+			'EventEspresso\core\services\address\CountrySubRegionDao',
82
+			[
83
+				'EEM_State'                                            => EE_Dependency_Map::load_from_cache,
84
+				'EventEspresso\core\services\validators\JsonValidator' => EE_Dependency_Map::load_from_cache
85
+			]
86
+		);
87
+		$this->dependency_map->registerDependencies(
88
+			'EventEspresso\core\domain\services\admin\registrations\list_table\QueryBuilder',
89
+			[
90
+				null,
91
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
92
+				'EEM_Registration'                            => EE_Dependency_Map::load_from_cache,
93
+			]
94
+		);
95
+		$this->dependency_map->registerDependencies(
96
+			'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\AttendeeFilterHeader',
97
+			[
98
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
99
+				'EEM_Attendee'                                => EE_Dependency_Map::load_from_cache,
100
+			]
101
+		);
102
+		$this->dependency_map->registerDependencies(
103
+			'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\DateFilterHeader',
104
+			[
105
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
106
+				'EEM_Datetime'                                => EE_Dependency_Map::load_from_cache,
107
+			]
108
+		);
109
+		$this->dependency_map->registerDependencies(
110
+			'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\EventFilterHeader',
111
+			[
112
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
113
+				'EEM_Event'                                   => EE_Dependency_Map::load_from_cache,
114
+			]
115
+		);
116
+		$this->dependency_map->registerDependencies(
117
+			'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\TicketFilterHeader',
118
+			[
119
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
120
+				'EEM_Ticket'                                  => EE_Dependency_Map::load_from_cache,
121
+			]
122
+		);
123
+	}
124 124
 
125 125
 
126
-    /**
127
-     * implements logic required to run during request
128
-     *
129
-     * @return bool
130
-     * @since   $VID:$
131
-     */
132
-    protected function requestHandler()
133
-    {
134
-        do_action('AHEE__EE_System__load_controllers__load_admin_controllers');
135
-        $this->loader->getShared('EventEspresso\core\domain\services\assets\EspressoLegacyAdminAssetManager');
136
-        $this->asset_manager = $this->loader->getShared(
137
-            'EventEspresso\core\domain\services\assets\LegacyAccountingAssetManager'
138
-        );
139
-        $this->loader->getShared('EE_Admin');
140
-        add_action('admin_enqueue_scripts', [$this, 'enqueueLegacyAccountingAssets'], 100);
141
-        return true;
142
-    }
126
+	/**
127
+	 * implements logic required to run during request
128
+	 *
129
+	 * @return bool
130
+	 * @since   $VID:$
131
+	 */
132
+	protected function requestHandler()
133
+	{
134
+		do_action('AHEE__EE_System__load_controllers__load_admin_controllers');
135
+		$this->loader->getShared('EventEspresso\core\domain\services\assets\EspressoLegacyAdminAssetManager');
136
+		$this->asset_manager = $this->loader->getShared(
137
+			'EventEspresso\core\domain\services\assets\LegacyAccountingAssetManager'
138
+		);
139
+		$this->loader->getShared('EE_Admin');
140
+		add_action('admin_enqueue_scripts', [$this, 'enqueueLegacyAccountingAssets'], 100);
141
+		return true;
142
+	}
143 143
 
144 144
 
145
-    /**
146
-     * enqueue_scripts - Load the scripts and css
147
-     *
148
-     * @return void
149
-     */
150
-    public function enqueueLegacyAccountingAssets()
151
-    {
152
-        $this->asset_manager->enqueueBrowserAssets();
153
-        wp_enqueue_script('ee-accounting');
154
-    }
145
+	/**
146
+	 * enqueue_scripts - Load the scripts and css
147
+	 *
148
+	 * @return void
149
+	 */
150
+	public function enqueueLegacyAccountingAssets()
151
+	{
152
+		$this->asset_manager->enqueueBrowserAssets();
153
+		wp_enqueue_script('ee-accounting');
154
+	}
155 155
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/handlers/frontend/FrontendRequests.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -16,46 +16,46 @@
 block discarded – undo
16 16
 {
17 17
 
18 18
 
19
-    /**
20
-     * returns true if the current request matches this route
21
-     * child classes can override and use Request directly to match route with request
22
-     * or supply a RouteMatchSpecification class and just use the below
23
-     *
24
-     * @return bool
25
-     * @since   $VID:$
26
-     */
27
-    public function matchesCurrentRequest()
28
-    {
29
-        return ($this->request->isFrontend() || $this->request->isFrontAjax()) && ! $this->maintenance_mode->level();
30
-    }
31
-
32
-
33
-    /**
34
-     * @since $VID:$
35
-     */
36
-    protected function registerDependencies()
37
-    {
38
-        $this->dependency_map->registerDependencies(
39
-            'EE_Front_Controller',
40
-            [
41
-                'EE_Registry'              => EE_Dependency_Map::load_from_cache,
42
-                'EE_Request_Handler'       => EE_Dependency_Map::load_from_cache,
43
-                'EE_Module_Request_Router' => EE_Dependency_Map::load_from_cache,
44
-            ]
45
-        );
46
-    }
47
-
48
-
49
-    /**
50
-     * implements logic required to run during request
51
-     *
52
-     * @return bool
53
-     * @since   $VID:$
54
-     */
55
-    protected function requestHandler()
56
-    {
57
-        do_action('AHEE__EE_System__load_controllers__load_front_controllers');
58
-        $this->loader->getShared('EE_Front_Controller');
59
-        return true;
60
-    }
19
+	/**
20
+	 * returns true if the current request matches this route
21
+	 * child classes can override and use Request directly to match route with request
22
+	 * or supply a RouteMatchSpecification class and just use the below
23
+	 *
24
+	 * @return bool
25
+	 * @since   $VID:$
26
+	 */
27
+	public function matchesCurrentRequest()
28
+	{
29
+		return ($this->request->isFrontend() || $this->request->isFrontAjax()) && ! $this->maintenance_mode->level();
30
+	}
31
+
32
+
33
+	/**
34
+	 * @since $VID:$
35
+	 */
36
+	protected function registerDependencies()
37
+	{
38
+		$this->dependency_map->registerDependencies(
39
+			'EE_Front_Controller',
40
+			[
41
+				'EE_Registry'              => EE_Dependency_Map::load_from_cache,
42
+				'EE_Request_Handler'       => EE_Dependency_Map::load_from_cache,
43
+				'EE_Module_Request_Router' => EE_Dependency_Map::load_from_cache,
44
+			]
45
+		);
46
+	}
47
+
48
+
49
+	/**
50
+	 * implements logic required to run during request
51
+	 *
52
+	 * @return bool
53
+	 * @since   $VID:$
54
+	 */
55
+	protected function requestHandler()
56
+	{
57
+		do_action('AHEE__EE_System__load_controllers__load_front_controllers');
58
+		$this->loader->getShared('EE_Front_Controller');
59
+		return true;
60
+	}
61 61
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/handlers/frontend/PublicRoute.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -25,31 +25,31 @@
 block discarded – undo
25 25
 abstract class PublicRoute extends Route
26 26
 {
27 27
 
28
-    /**
29
-     * @var EE_Maintenance_Mode $maintenance_mode
30
-     */
31
-    protected $maintenance_mode;
28
+	/**
29
+	 * @var EE_Maintenance_Mode $maintenance_mode
30
+	 */
31
+	protected $maintenance_mode;
32 32
 
33 33
 
34
-    /**
35
-     * FrontendRequests constructor.
36
-     *
37
-     * @param EE_Maintenance_Mode $maintenance_mode
38
-     * @param EE_Dependency_Map   $dependency_map
39
-     * @param LoaderInterface     $loader
40
-     * @param RequestInterface    $request
41
-     * @param JsonDataNode        $data_node
42
-     * @param RouteMatchSpecificationInterface $specification
43
-     */
44
-    public function __construct(
45
-        EE_Maintenance_Mode $maintenance_mode,
46
-        EE_Dependency_Map $dependency_map,
47
-        LoaderInterface $loader,
48
-        RequestInterface $request,
49
-        JsonDataNode $data_node = null,
50
-        RouteMatchSpecificationInterface $specification = null
51
-    ) {
52
-        $this->maintenance_mode = $maintenance_mode;
53
-        parent::__construct($dependency_map, $loader, $request, $data_node, $specification);
54
-    }
34
+	/**
35
+	 * FrontendRequests constructor.
36
+	 *
37
+	 * @param EE_Maintenance_Mode $maintenance_mode
38
+	 * @param EE_Dependency_Map   $dependency_map
39
+	 * @param LoaderInterface     $loader
40
+	 * @param RequestInterface    $request
41
+	 * @param JsonDataNode        $data_node
42
+	 * @param RouteMatchSpecificationInterface $specification
43
+	 */
44
+	public function __construct(
45
+		EE_Maintenance_Mode $maintenance_mode,
46
+		EE_Dependency_Map $dependency_map,
47
+		LoaderInterface $loader,
48
+		RequestInterface $request,
49
+		JsonDataNode $data_node = null,
50
+		RouteMatchSpecificationInterface $specification = null
51
+	) {
52
+		$this->maintenance_mode = $maintenance_mode;
53
+		parent::__construct($dependency_map, $loader, $request, $data_node, $specification);
54
+	}
55 55
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/handlers/shared/RoutingRequests.php 1 patch
Indentation   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -16,124 +16,124 @@
 block discarded – undo
16 16
 class RoutingRequests extends Route
17 17
 {
18 18
 
19
-    /**
20
-     * called just before matchesCurrentRequest()
21
-     * and allows Route to perform any setup required such as calling setSpecification()
22
-     *
23
-     * @since $VID:$
24
-     */
25
-    public function initialize()
26
-    {
27
-        $basic_nodes = [
28
-            'EventEspresso\core\domain\entities\routing\data_nodes\core\Api',
29
-            'EventEspresso\core\domain\entities\routing\data_nodes\core\CurrentUser',
30
-            'EventEspresso\core\domain\entities\routing\data_nodes\core\GeneralSettings',
31
-            'EventEspresso\core\domain\entities\routing\data_nodes\core\Locale',
32
-            'EventEspresso\core\domain\entities\routing\data_nodes\core\SiteUrls',
33
-        ];
34
-        foreach ($basic_nodes as $basic_node) {
35
-            $this->dependency_map->registerDependencies(
36
-                $basic_node,
37
-                ['EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache]
38
-            );
39
-        }
40
-        $this->dependency_map->registerDependencies(
41
-            'EventEspresso\core\domain\entities\routing\data_nodes\EventEspressoData',
42
-            [
43
-                'EventEspresso\core\domain\entities\routing\data_nodes\core\Api'    => EE_Dependency_Map::load_from_cache,
44
-                'EventEspresso\core\domain\entities\routing\data_nodes\core\Config' => EE_Dependency_Map::load_from_cache,
45
-                'EventEspresso\core\services\assets\JedLocaleData'                  => EE_Dependency_Map::load_from_cache,
46
-                'EventEspresso\core\services\json\JsonDataNodeValidator'            => EE_Dependency_Map::load_from_cache,
47
-            ]
48
-        );
49
-        $this->dependency_map->registerDependencies(
50
-            'EventEspresso\core\domain\entities\routing\data_nodes\core\Config',
51
-            [
52
-                'EventEspresso\core\domain\entities\routing\data_nodes\core\CurrentUser'        => EE_Dependency_Map::load_from_cache,
53
-                'EventEspresso\core\domain\entities\routing\data_nodes\core\EspressoCoreDomain' => EE_Dependency_Map::load_from_cache,
54
-                'EventEspresso\core\domain\entities\routing\data_nodes\core\GeneralSettings'    => EE_Dependency_Map::load_from_cache,
55
-                'EventEspresso\core\domain\entities\routing\data_nodes\core\Locale'             => EE_Dependency_Map::load_from_cache,
56
-                'EventEspresso\core\domain\entities\routing\data_nodes\core\SiteCurrency'       => EE_Dependency_Map::load_from_cache,
57
-                'EventEspresso\core\domain\entities\routing\data_nodes\core\SiteUrls'           => EE_Dependency_Map::load_from_cache,
58
-                'EventEspresso\core\services\json\JsonDataNodeValidator'                        => EE_Dependency_Map::load_from_cache,
59
-            ]
60
-        );
61
-        $this->dependency_map->registerDependencies(
62
-            'EventEspresso\core\domain\entities\routing\data_nodes\core\EspressoCoreDomain',
63
-            [
64
-                'EventEspresso\core\domain\Domain'                       => EE_Dependency_Map::load_from_cache,
65
-                'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache,
66
-            ]
67
-        );
68
-        $this->dependency_map->registerDependencies(
69
-            'EventEspresso\core\domain\entities\routing\data_nodes\core\SiteCurrency',
70
-            [
71
-                'EE_Currency_Config'                                     => EE_Dependency_Map::load_from_cache,
72
-                'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache,
73
-            ]
74
-        );
75
-        $this->setDataNode(
76
-            $this->loader->getShared('EventEspresso\core\domain\entities\routing\data_nodes\EventEspressoData')
77
-        );
78
-    }
19
+	/**
20
+	 * called just before matchesCurrentRequest()
21
+	 * and allows Route to perform any setup required such as calling setSpecification()
22
+	 *
23
+	 * @since $VID:$
24
+	 */
25
+	public function initialize()
26
+	{
27
+		$basic_nodes = [
28
+			'EventEspresso\core\domain\entities\routing\data_nodes\core\Api',
29
+			'EventEspresso\core\domain\entities\routing\data_nodes\core\CurrentUser',
30
+			'EventEspresso\core\domain\entities\routing\data_nodes\core\GeneralSettings',
31
+			'EventEspresso\core\domain\entities\routing\data_nodes\core\Locale',
32
+			'EventEspresso\core\domain\entities\routing\data_nodes\core\SiteUrls',
33
+		];
34
+		foreach ($basic_nodes as $basic_node) {
35
+			$this->dependency_map->registerDependencies(
36
+				$basic_node,
37
+				['EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache]
38
+			);
39
+		}
40
+		$this->dependency_map->registerDependencies(
41
+			'EventEspresso\core\domain\entities\routing\data_nodes\EventEspressoData',
42
+			[
43
+				'EventEspresso\core\domain\entities\routing\data_nodes\core\Api'    => EE_Dependency_Map::load_from_cache,
44
+				'EventEspresso\core\domain\entities\routing\data_nodes\core\Config' => EE_Dependency_Map::load_from_cache,
45
+				'EventEspresso\core\services\assets\JedLocaleData'                  => EE_Dependency_Map::load_from_cache,
46
+				'EventEspresso\core\services\json\JsonDataNodeValidator'            => EE_Dependency_Map::load_from_cache,
47
+			]
48
+		);
49
+		$this->dependency_map->registerDependencies(
50
+			'EventEspresso\core\domain\entities\routing\data_nodes\core\Config',
51
+			[
52
+				'EventEspresso\core\domain\entities\routing\data_nodes\core\CurrentUser'        => EE_Dependency_Map::load_from_cache,
53
+				'EventEspresso\core\domain\entities\routing\data_nodes\core\EspressoCoreDomain' => EE_Dependency_Map::load_from_cache,
54
+				'EventEspresso\core\domain\entities\routing\data_nodes\core\GeneralSettings'    => EE_Dependency_Map::load_from_cache,
55
+				'EventEspresso\core\domain\entities\routing\data_nodes\core\Locale'             => EE_Dependency_Map::load_from_cache,
56
+				'EventEspresso\core\domain\entities\routing\data_nodes\core\SiteCurrency'       => EE_Dependency_Map::load_from_cache,
57
+				'EventEspresso\core\domain\entities\routing\data_nodes\core\SiteUrls'           => EE_Dependency_Map::load_from_cache,
58
+				'EventEspresso\core\services\json\JsonDataNodeValidator'                        => EE_Dependency_Map::load_from_cache,
59
+			]
60
+		);
61
+		$this->dependency_map->registerDependencies(
62
+			'EventEspresso\core\domain\entities\routing\data_nodes\core\EspressoCoreDomain',
63
+			[
64
+				'EventEspresso\core\domain\Domain'                       => EE_Dependency_Map::load_from_cache,
65
+				'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache,
66
+			]
67
+		);
68
+		$this->dependency_map->registerDependencies(
69
+			'EventEspresso\core\domain\entities\routing\data_nodes\core\SiteCurrency',
70
+			[
71
+				'EE_Currency_Config'                                     => EE_Dependency_Map::load_from_cache,
72
+				'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache,
73
+			]
74
+		);
75
+		$this->setDataNode(
76
+			$this->loader->getShared('EventEspresso\core\domain\entities\routing\data_nodes\EventEspressoData')
77
+		);
78
+	}
79 79
 
80 80
 
81
-    /**
82
-     * returns true if the current request matches this route
83
-     *
84
-     * @return bool
85
-     * @since   $VID:$
86
-     */
87
-    public function matchesCurrentRequest()
88
-    {
89
-        return ! $this->request->isActivation() || $this->request->isUnitTesting();
90
-    }
81
+	/**
82
+	 * returns true if the current request matches this route
83
+	 *
84
+	 * @return bool
85
+	 * @since   $VID:$
86
+	 */
87
+	public function matchesCurrentRequest()
88
+	{
89
+		return ! $this->request->isActivation() || $this->request->isUnitTesting();
90
+	}
91 91
 
92 92
 
93
-    /**
94
-     * @since $VID:$
95
-     */
96
-    protected function registerDependencies()
97
-    {
98
-        $default = [
99
-            'EE_Dependency_Map'                           => EE_Dependency_Map::load_from_cache,
100
-            'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
101
-            'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
102
-        ];
103
-        $admin = ['EE_Admin_Config' => EE_Dependency_Map::load_from_cache] + $default;
104
-        $public = ['EE_Maintenance_Mode' => EE_Dependency_Map::load_from_cache] + $default;
105
-        $default_routes = [
106
-            // default dependencies
107
-            'EventEspresso\core\domain\entities\routing\handlers\admin\PueRequests'          => $default,
108
-            'EventEspresso\core\domain\entities\routing\handlers\admin\WordPressPluginsPage' => $default,
109
-            'EventEspresso\core\domain\entities\routing\handlers\frontend\ShortcodeRequests' => $default,
110
-            'EventEspresso\core\domain\entities\routing\handlers\shared\AssetRequests'       => $default,
111
-            'EventEspresso\core\domain\entities\routing\handlers\shared\GQLRequests'         => $default,
112
-            'EventEspresso\core\domain\entities\routing\handlers\shared\RestApiRequests'     => $default,
113
-            'EventEspresso\core\domain\entities\routing\handlers\shared\SessionRequests'     => $default,
114
-            'EventEspresso\core\domain\entities\routing\handlers\shared\WordPressHeartbeat'  => $default,
115
-            // admin dependencies
116
-            'EventEspresso\core\domain\entities\routing\handlers\admin\EspressoEventsAdmin'  => $admin,
117
-            'EventEspresso\core\domain\entities\routing\handlers\admin\EspressoEventEditor'  => $admin,
118
-            'EventEspresso\core\domain\entities\routing\handlers\admin\EspressoLegacyAdmin'  => $admin,
119
-            // public dependencies
120
-            'EventEspresso\core\domain\entities\routing\handlers\admin\PersonalDataRequests' => $public,
121
-            'EventEspresso\core\domain\entities\routing\handlers\frontend\FrontendRequests'  => $public,
122
-        ];
123
-        foreach ($default_routes as $route => $dependencies) {
124
-            $this->dependency_map->registerDependencies($route, $dependencies);
125
-        }
126
-    }
93
+	/**
94
+	 * @since $VID:$
95
+	 */
96
+	protected function registerDependencies()
97
+	{
98
+		$default = [
99
+			'EE_Dependency_Map'                           => EE_Dependency_Map::load_from_cache,
100
+			'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
101
+			'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
102
+		];
103
+		$admin = ['EE_Admin_Config' => EE_Dependency_Map::load_from_cache] + $default;
104
+		$public = ['EE_Maintenance_Mode' => EE_Dependency_Map::load_from_cache] + $default;
105
+		$default_routes = [
106
+			// default dependencies
107
+			'EventEspresso\core\domain\entities\routing\handlers\admin\PueRequests'          => $default,
108
+			'EventEspresso\core\domain\entities\routing\handlers\admin\WordPressPluginsPage' => $default,
109
+			'EventEspresso\core\domain\entities\routing\handlers\frontend\ShortcodeRequests' => $default,
110
+			'EventEspresso\core\domain\entities\routing\handlers\shared\AssetRequests'       => $default,
111
+			'EventEspresso\core\domain\entities\routing\handlers\shared\GQLRequests'         => $default,
112
+			'EventEspresso\core\domain\entities\routing\handlers\shared\RestApiRequests'     => $default,
113
+			'EventEspresso\core\domain\entities\routing\handlers\shared\SessionRequests'     => $default,
114
+			'EventEspresso\core\domain\entities\routing\handlers\shared\WordPressHeartbeat'  => $default,
115
+			// admin dependencies
116
+			'EventEspresso\core\domain\entities\routing\handlers\admin\EspressoEventsAdmin'  => $admin,
117
+			'EventEspresso\core\domain\entities\routing\handlers\admin\EspressoEventEditor'  => $admin,
118
+			'EventEspresso\core\domain\entities\routing\handlers\admin\EspressoLegacyAdmin'  => $admin,
119
+			// public dependencies
120
+			'EventEspresso\core\domain\entities\routing\handlers\admin\PersonalDataRequests' => $public,
121
+			'EventEspresso\core\domain\entities\routing\handlers\frontend\FrontendRequests'  => $public,
122
+		];
123
+		foreach ($default_routes as $route => $dependencies) {
124
+			$this->dependency_map->registerDependencies($route, $dependencies);
125
+		}
126
+	}
127 127
 
128 128
 
129
-    /**
130
-     * implements logic required to run during request
131
-     *
132
-     * @return bool
133
-     * @since   $VID:$
134
-     */
135
-    protected function requestHandler()
136
-    {
137
-        return true;
138
-    }
129
+	/**
130
+	 * implements logic required to run during request
131
+	 *
132
+	 * @return bool
133
+	 * @since   $VID:$
134
+	 */
135
+	protected function requestHandler()
136
+	{
137
+		return true;
138
+	}
139 139
 }
Please login to merge, or discard this patch.
core/services/options/JsonWpOptionManager.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -16,39 +16,39 @@
 block discarded – undo
16 16
  */
17 17
 class JsonWpOptionManager
18 18
 {
19
-    /**
20
-     * Updates the object with what's in the DB (specifically, the wp_options table). If nothing is in the DB, leaves
21
-     * the object alone and returns false.
22
-     * @since 4.9.80.p
23
-     * @param JsonWpOptionSerializableInterface $obj
24
-     * @return bool
25
-     */
26
-    public function populateFromDb(JsonWpOptionSerializableInterface $obj)
27
-    {
28
-        $option = get_option($obj->getWpOptionName());
29
-        if ($option) {
30
-            $json = json_decode($option, false);
31
-            if ($json instanceof stdClass) {
32
-                return $obj->fromJsonSerializedData($json);
33
-            }
34
-        }
35
-        return false;
36
-    }
19
+	/**
20
+	 * Updates the object with what's in the DB (specifically, the wp_options table). If nothing is in the DB, leaves
21
+	 * the object alone and returns false.
22
+	 * @since 4.9.80.p
23
+	 * @param JsonWpOptionSerializableInterface $obj
24
+	 * @return bool
25
+	 */
26
+	public function populateFromDb(JsonWpOptionSerializableInterface $obj)
27
+	{
28
+		$option = get_option($obj->getWpOptionName());
29
+		if ($option) {
30
+			$json = json_decode($option, false);
31
+			if ($json instanceof stdClass) {
32
+				return $obj->fromJsonSerializedData($json);
33
+			}
34
+		}
35
+		return false;
36
+	}
37 37
 
38
-    /**
39
-     * Saves the object's data to the wp_options table for later use.
40
-     * @since 4.9.80.p
41
-     * @param JsonWpOptionSerializableInterface $obj
42
-     * @return bool
43
-     */
44
-    public function saveToDb(JsonWpOptionSerializableInterface $obj)
45
-    {
46
-        return update_option(
47
-            $obj->getWpOptionName(),
48
-            wp_json_encode($obj->toJsonSerializableData()),
49
-            false
50
-        );
51
-    }
38
+	/**
39
+	 * Saves the object's data to the wp_options table for later use.
40
+	 * @since 4.9.80.p
41
+	 * @param JsonWpOptionSerializableInterface $obj
42
+	 * @return bool
43
+	 */
44
+	public function saveToDb(JsonWpOptionSerializableInterface $obj)
45
+	{
46
+		return update_option(
47
+			$obj->getWpOptionName(),
48
+			wp_json_encode($obj->toJsonSerializableData()),
49
+			false
50
+		);
51
+	}
52 52
 }
53 53
 // End of file JsonWpOptionManager.php
54 54
 // Location: EventEspresso\core\services\options/JsonWpOptionManager.php
Please login to merge, or discard this patch.
core/services/json/JsonDataNodeValidator.php 2 patches
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -14,76 +14,76 @@
 block discarded – undo
14 14
 class JsonDataNodeValidator
15 15
 {
16 16
 
17
-    /**
18
-     * @param array  $data      data array to check for property key
19
-     * @param string $key       value for the key being checked for
20
-     * @param string $type      the type of key and/or the data being checked
21
-     * @return bool             returns true if property is safe to write, false if overwrite will occur
22
-     * @throws DomainException  throws exception if WP_DEBUG is true
23
-     */
24
-    public function propertyNotSet(array $data, $key, $type = 'key')
25
-    {
26
-        if (isset($data[ $key ])) {
27
-            $this->overwriteError($key, $type);
28
-            return false;
29
-        }
30
-        return true;
31
-    }
17
+	/**
18
+	 * @param array  $data      data array to check for property key
19
+	 * @param string $key       value for the key being checked for
20
+	 * @param string $type      the type of key and/or the data being checked
21
+	 * @return bool             returns true if property is safe to write, false if overwrite will occur
22
+	 * @throws DomainException  throws exception if WP_DEBUG is true
23
+	 */
24
+	public function propertyNotSet(array $data, $key, $type = 'key')
25
+	{
26
+		if (isset($data[ $key ])) {
27
+			$this->overwriteError($key, $type);
28
+			return false;
29
+		}
30
+		return true;
31
+	}
32 32
 
33 33
 
34
-    /**
35
-     * @param string $key       value for the key being checked for
36
-     * @param string $type      the type of key and/or the data being checked
37
-     * @throws DomainException  throws exception if WP_DEBUG is true
38
-     */
39
-    public function overwriteError($key, $type)
40
-    {
41
-        if (WP_DEBUG) {
42
-            throw new DomainException(
43
-                sprintf(
44
-                /*
34
+	/**
35
+	 * @param string $key       value for the key being checked for
36
+	 * @param string $type      the type of key and/or the data being checked
37
+	 * @throws DomainException  throws exception if WP_DEBUG is true
38
+	 */
39
+	public function overwriteError($key, $type)
40
+	{
41
+		if (WP_DEBUG) {
42
+			throw new DomainException(
43
+				sprintf(
44
+				/*
45 45
                  * translators:
46 46
                  * 'The "i18n" JsonDataNode key is already set and would be overwritten by the current action.'
47 47
                  */
48
-                    esc_html__(
49
-                        'The "%1$s" JsonDataNode %2$s is already set and would be overwritten by the current action.',
50
-                        'event_espresso'
51
-                    ),
52
-                    $key,
53
-                    $type
54
-                )
55
-            );
56
-        }
57
-    }
48
+					esc_html__(
49
+						'The "%1$s" JsonDataNode %2$s is already set and would be overwritten by the current action.',
50
+						'event_espresso'
51
+					),
52
+					$key,
53
+					$type
54
+				)
55
+			);
56
+		}
57
+	}
58 58
 
59 59
 
60
-    /**
61
-     * @param string $property  name for the key being checked for
62
-     * @param string $type      the type of key and/or the data being checked
63
-     * @param bool   $throw     if true [default] and WP_DEBUG is also true, then will throw exceptions
64
-     * @return bool             returns true if property is set, false if property is missing
65
-     * @throws DomainException  throws exception if WP_DEBUG is true
66
-     */
67
-    public function validateCriticalProperty($property, $type, $throw = true)
68
-    {
69
-        if (empty($property)) {
70
-            if (WP_DEBUG && $throw) {
71
-                throw new DomainException(
72
-                    sprintf(
73
-                    /*
60
+	/**
61
+	 * @param string $property  name for the key being checked for
62
+	 * @param string $type      the type of key and/or the data being checked
63
+	 * @param bool   $throw     if true [default] and WP_DEBUG is also true, then will throw exceptions
64
+	 * @return bool             returns true if property is set, false if property is missing
65
+	 * @throws DomainException  throws exception if WP_DEBUG is true
66
+	 */
67
+	public function validateCriticalProperty($property, $type, $throw = true)
68
+	{
69
+		if (empty($property)) {
70
+			if (WP_DEBUG && $throw) {
71
+				throw new DomainException(
72
+					sprintf(
73
+					/*
74 74
                      * translators:
75 75
                      * 'The JsonDataNodeHandler domain route is a required property but has not been set.'
76 76
                      */
77
-                        esc_html__(
78
-                            'The JsonDataNodeHandler %1$s is a required property but has not been set.',
79
-                            'event_espresso'
80
-                        ),
81
-                        $type
82
-                    )
83
-                );
84
-            }
85
-            return false;
86
-        }
87
-        return true;
88
-    }
77
+						esc_html__(
78
+							'The JsonDataNodeHandler %1$s is a required property but has not been set.',
79
+							'event_espresso'
80
+						),
81
+						$type
82
+					)
83
+				);
84
+			}
85
+			return false;
86
+		}
87
+		return true;
88
+	}
89 89
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function propertyNotSet(array $data, $key, $type = 'key')
25 25
     {
26
-        if (isset($data[ $key ])) {
26
+        if (isset($data[$key])) {
27 27
             $this->overwriteError($key, $type);
28 28
             return false;
29 29
         }
Please login to merge, or discard this patch.
core/services/json/JsonDataNodeHandler.php 2 patches
Indentation   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -18,129 +18,129 @@
 block discarded – undo
18 18
 class JsonDataNodeHandler
19 19
 {
20 20
 
21
-    /**
22
-     * @var PrimaryJsonDataNode $primary_data_node
23
-     */
24
-    private $primary_data_node;
25
-
26
-    /**
27
-     * @var JsonDataNodeValidator $validator
28
-     */
29
-    private $validator;
30
-
31
-
32
-    /**
33
-     * JsonDataNodeHandler constructor.
34
-     *
35
-     * @param JsonDataNodeValidator $validator
36
-     */
37
-    public function __construct(JsonDataNodeValidator $validator)
38
-    {
39
-        $this->validator = $validator;
40
-    }
41
-
42
-
43
-    /**
44
-     * @param JsonDataNode $data_node
45
-     * @throws DomainException
46
-     */
47
-    public function addDataNode(JsonDataNode $data_node)
48
-    {
49
-        if ($data_node->isNotInitialized()) {
50
-            $this->validatePrimaryDataNode($data_node);
51
-            $this->primary_data_node->addDataNode($data_node);
52
-        }
53
-    }
54
-
55
-
56
-    /**
57
-     * @param PrimaryJsonDataNode $primary_data_node
58
-     */
59
-    public function setPrimaryDataNode(PrimaryJsonDataNode $primary_data_node)
60
-    {
61
-        $this->primary_data_node = $primary_data_node;
62
-    }
63
-
64
-
65
-    /**
66
-     * @param JsonDataNode $data_node
67
-     * @param int                $depth
68
-     * @return mixed
69
-     * @since $VID:$
70
-     */
71
-    private function initializeDataNodes(JsonDataNode $data_node, $depth = 0)
72
-    {
73
-        $depth++;
74
-        $data = [];
75
-        // initialize the data node if not done already
76
-        if ($data_node->isNotInitialized()) {
77
-            $data_node->initialize();
78
-            // grab the data node's data array
79
-            $data_node_data = $data_node->data();
80
-            foreach ($data_node_data as $child_node_name => $child_node) {
81
-                // don't parse node if it's the primary, OR if depth has exceeded wp_json_encode() limit
82
-                if ($child_node instanceof PrimaryJsonDataNode || $depth > 512) {
83
-                    continue;
84
-                }
85
-                if ($child_node instanceof JsonDataNode) {
86
-                    // feed data node back into this function
87
-                    $data[ $child_node_name ] = $this->initializeDataNodes($child_node, $depth);
88
-                } else {
89
-                    // or assign data directly
90
-                    $data[ $child_node_name ] = $child_node;
91
-                }
92
-            }
93
-        }
94
-        return $data;
95
-    }
96
-
97
-
98
-    /**
99
-     * @throws DomainException
100
-     * @since $VID:$
101
-     */
102
-    public function printDataNode()
103
-    {
104
-        // validate that the domain, node name, and target script are set
105
-        $domain = $this->primary_data_node->domain();
106
-        $node_name = $this->primary_data_node->nodeName();
107
-        $target_script = $this->primary_data_node->targetScript();
108
-        $data_valid =  $this->validator->validateCriticalProperty($domain, 'domain route', false)
109
-                       && $this->validator->validateCriticalProperty($node_name, 'node name', false)
110
-                       && $this->validator->validateCriticalProperty($target_script, 'target script', false);
111
-        if (! $data_valid) {
112
-            return;
113
-        }
114
-        // initialize and parse data from primary data node
115
-        $data = $this->initializeDataNodes($this->primary_data_node);
116
-        // this prepends the current domain "use case" to the front of the array
117
-        $data = ['domain' => $domain] + $data;
118
-        // add legacy i18n strings
119
-        $data['eei18n'] = EE_Registry::$i18n_js_strings;
120
-        // and finally JSON encode the data and attach to the target script
121
-        $data = json_encode($data);
122
-        wp_add_inline_script($target_script, "var {$node_name}={$data};", 'before');
123
-    }
124
-
125
-
126
-    /**
127
-     * @param JsonDataNode $data_node
128
-     * @throws DomainException
129
-     */
130
-    private function validatePrimaryDataNode(JsonDataNode $data_node)
131
-    {
132
-        // set primary data node if that's what the incoming node is
133
-        if ($data_node instanceof PrimaryJsonDataNode) {
134
-            $this->setPrimaryDataNode($data_node);
135
-        }
136
-        // and don't allow other nodes to be set until a primary is set
137
-        if (! $this->primary_data_node instanceof PrimaryJsonDataNode) {
138
-            throw new DomainException(
139
-                esc_html__(
140
-                    'A PrimaryJsonDataNode needs to be set before data nodes can be added.',
141
-                    'event_espresso'
142
-                )
143
-            );
144
-        }
145
-    }
21
+	/**
22
+	 * @var PrimaryJsonDataNode $primary_data_node
23
+	 */
24
+	private $primary_data_node;
25
+
26
+	/**
27
+	 * @var JsonDataNodeValidator $validator
28
+	 */
29
+	private $validator;
30
+
31
+
32
+	/**
33
+	 * JsonDataNodeHandler constructor.
34
+	 *
35
+	 * @param JsonDataNodeValidator $validator
36
+	 */
37
+	public function __construct(JsonDataNodeValidator $validator)
38
+	{
39
+		$this->validator = $validator;
40
+	}
41
+
42
+
43
+	/**
44
+	 * @param JsonDataNode $data_node
45
+	 * @throws DomainException
46
+	 */
47
+	public function addDataNode(JsonDataNode $data_node)
48
+	{
49
+		if ($data_node->isNotInitialized()) {
50
+			$this->validatePrimaryDataNode($data_node);
51
+			$this->primary_data_node->addDataNode($data_node);
52
+		}
53
+	}
54
+
55
+
56
+	/**
57
+	 * @param PrimaryJsonDataNode $primary_data_node
58
+	 */
59
+	public function setPrimaryDataNode(PrimaryJsonDataNode $primary_data_node)
60
+	{
61
+		$this->primary_data_node = $primary_data_node;
62
+	}
63
+
64
+
65
+	/**
66
+	 * @param JsonDataNode $data_node
67
+	 * @param int                $depth
68
+	 * @return mixed
69
+	 * @since $VID:$
70
+	 */
71
+	private function initializeDataNodes(JsonDataNode $data_node, $depth = 0)
72
+	{
73
+		$depth++;
74
+		$data = [];
75
+		// initialize the data node if not done already
76
+		if ($data_node->isNotInitialized()) {
77
+			$data_node->initialize();
78
+			// grab the data node's data array
79
+			$data_node_data = $data_node->data();
80
+			foreach ($data_node_data as $child_node_name => $child_node) {
81
+				// don't parse node if it's the primary, OR if depth has exceeded wp_json_encode() limit
82
+				if ($child_node instanceof PrimaryJsonDataNode || $depth > 512) {
83
+					continue;
84
+				}
85
+				if ($child_node instanceof JsonDataNode) {
86
+					// feed data node back into this function
87
+					$data[ $child_node_name ] = $this->initializeDataNodes($child_node, $depth);
88
+				} else {
89
+					// or assign data directly
90
+					$data[ $child_node_name ] = $child_node;
91
+				}
92
+			}
93
+		}
94
+		return $data;
95
+	}
96
+
97
+
98
+	/**
99
+	 * @throws DomainException
100
+	 * @since $VID:$
101
+	 */
102
+	public function printDataNode()
103
+	{
104
+		// validate that the domain, node name, and target script are set
105
+		$domain = $this->primary_data_node->domain();
106
+		$node_name = $this->primary_data_node->nodeName();
107
+		$target_script = $this->primary_data_node->targetScript();
108
+		$data_valid =  $this->validator->validateCriticalProperty($domain, 'domain route', false)
109
+					   && $this->validator->validateCriticalProperty($node_name, 'node name', false)
110
+					   && $this->validator->validateCriticalProperty($target_script, 'target script', false);
111
+		if (! $data_valid) {
112
+			return;
113
+		}
114
+		// initialize and parse data from primary data node
115
+		$data = $this->initializeDataNodes($this->primary_data_node);
116
+		// this prepends the current domain "use case" to the front of the array
117
+		$data = ['domain' => $domain] + $data;
118
+		// add legacy i18n strings
119
+		$data['eei18n'] = EE_Registry::$i18n_js_strings;
120
+		// and finally JSON encode the data and attach to the target script
121
+		$data = json_encode($data);
122
+		wp_add_inline_script($target_script, "var {$node_name}={$data};", 'before');
123
+	}
124
+
125
+
126
+	/**
127
+	 * @param JsonDataNode $data_node
128
+	 * @throws DomainException
129
+	 */
130
+	private function validatePrimaryDataNode(JsonDataNode $data_node)
131
+	{
132
+		// set primary data node if that's what the incoming node is
133
+		if ($data_node instanceof PrimaryJsonDataNode) {
134
+			$this->setPrimaryDataNode($data_node);
135
+		}
136
+		// and don't allow other nodes to be set until a primary is set
137
+		if (! $this->primary_data_node instanceof PrimaryJsonDataNode) {
138
+			throw new DomainException(
139
+				esc_html__(
140
+					'A PrimaryJsonDataNode needs to be set before data nodes can be added.',
141
+					'event_espresso'
142
+				)
143
+			);
144
+		}
145
+	}
146 146
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
                 }
85 85
                 if ($child_node instanceof JsonDataNode) {
86 86
                     // feed data node back into this function
87
-                    $data[ $child_node_name ] = $this->initializeDataNodes($child_node, $depth);
87
+                    $data[$child_node_name] = $this->initializeDataNodes($child_node, $depth);
88 88
                 } else {
89 89
                     // or assign data directly
90
-                    $data[ $child_node_name ] = $child_node;
90
+                    $data[$child_node_name] = $child_node;
91 91
                 }
92 92
             }
93 93
         }
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
         $domain = $this->primary_data_node->domain();
106 106
         $node_name = $this->primary_data_node->nodeName();
107 107
         $target_script = $this->primary_data_node->targetScript();
108
-        $data_valid =  $this->validator->validateCriticalProperty($domain, 'domain route', false)
108
+        $data_valid = $this->validator->validateCriticalProperty($domain, 'domain route', false)
109 109
                        && $this->validator->validateCriticalProperty($node_name, 'node name', false)
110 110
                        && $this->validator->validateCriticalProperty($target_script, 'target script', false);
111
-        if (! $data_valid) {
111
+        if ( ! $data_valid) {
112 112
             return;
113 113
         }
114 114
         // initialize and parse data from primary data node
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             $this->setPrimaryDataNode($data_node);
135 135
         }
136 136
         // and don't allow other nodes to be set until a primary is set
137
-        if (! $this->primary_data_node instanceof PrimaryJsonDataNode) {
137
+        if ( ! $this->primary_data_node instanceof PrimaryJsonDataNode) {
138 138
             throw new DomainException(
139 139
                 esc_html__(
140 140
                     'A PrimaryJsonDataNode needs to be set before data nodes can be added.',
Please login to merge, or discard this patch.
core/services/json/JsonDataNodeInterface.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -20,61 +20,61 @@
 block discarded – undo
20 20
 interface JsonDataNodeInterface extends JsonSerializable
21 21
 {
22 22
 
23
-    /**
24
-     * @param JsonDataNode $data_node
25
-     * @throws DomainException
26
-     */
27
-    public function addDataNode(JsonDataNode $data_node);
28
-
29
-
30
-    /**
31
-     * the actual data in key value array format
32
-     *
33
-     * @return array
34
-     */
35
-    public function data();
36
-
37
-
38
-    /**
39
-     * specifies the domain (use case) that this route defines
40
-     * ! IMPORTANT !
41
-     * only one domain can be set pre request
42
-     *
43
-     * @return string
44
-     */
45
-    public function domain();
46
-
47
-
48
-    /**
49
-     * !!! IMPORTANT !!!
50
-     * JsonDataNode::setInitialized(true) needs to be called once initialization is complete
51
-     * else you're a bad person and bad things will happen to you !!!
52
-     *
53
-     * @since $VID:$
54
-     */
55
-    public function initialize();
56
-
57
-
58
-    /**
59
-     * true if the data node has been initialized,
60
-     * which entails retrieving the required data and adding it to the data node data array
61
-     *
62
-     * @return bool
63
-     */
64
-    public function isInitialized();
65
-
66
-
67
-    /**
68
-     * true if the data node has NOT been initialized
69
-     *
70
-     * @return bool
71
-     */
72
-    public function isNotInitialized();
73
-
74
-
75
-    /**
76
-     * @return string
77
-     * @since $VID:$
78
-     */
79
-    public function nodeName();
23
+	/**
24
+	 * @param JsonDataNode $data_node
25
+	 * @throws DomainException
26
+	 */
27
+	public function addDataNode(JsonDataNode $data_node);
28
+
29
+
30
+	/**
31
+	 * the actual data in key value array format
32
+	 *
33
+	 * @return array
34
+	 */
35
+	public function data();
36
+
37
+
38
+	/**
39
+	 * specifies the domain (use case) that this route defines
40
+	 * ! IMPORTANT !
41
+	 * only one domain can be set pre request
42
+	 *
43
+	 * @return string
44
+	 */
45
+	public function domain();
46
+
47
+
48
+	/**
49
+	 * !!! IMPORTANT !!!
50
+	 * JsonDataNode::setInitialized(true) needs to be called once initialization is complete
51
+	 * else you're a bad person and bad things will happen to you !!!
52
+	 *
53
+	 * @since $VID:$
54
+	 */
55
+	public function initialize();
56
+
57
+
58
+	/**
59
+	 * true if the data node has been initialized,
60
+	 * which entails retrieving the required data and adding it to the data node data array
61
+	 *
62
+	 * @return bool
63
+	 */
64
+	public function isInitialized();
65
+
66
+
67
+	/**
68
+	 * true if the data node has NOT been initialized
69
+	 *
70
+	 * @return bool
71
+	 */
72
+	public function isNotInitialized();
73
+
74
+
75
+	/**
76
+	 * @return string
77
+	 * @since $VID:$
78
+	 */
79
+	public function nodeName();
80 80
 }
81 81
\ No newline at end of file
Please login to merge, or discard this patch.