Completed
Pull Request — Gutenberg/master (#479)
by
unknown
14:24
created
entities/route_match/specifications/admin/WordPressPostTypeEditor.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@
 block discarded – undo
15 15
  */
16 16
 class WordPressPostTypeEditor extends RouteMatchSpecification
17 17
 {
18
-    /**
19
-     * returns true if current request matches specification
20
-     *
21
-     * @since $VID:$
22
-     * @return boolean
23
-     */
24
-    public function isMatchingRoute()
25
-    {
26
-        return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false;
27
-    }
18
+	/**
19
+	 * returns true if current request matches specification
20
+	 *
21
+	 * @since $VID:$
22
+	 * @return boolean
23
+	 */
24
+	public function isMatchingRoute()
25
+	{
26
+		return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false;
27
+	}
28 28
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/WordPressPageEditorEdit.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -15,23 +15,23 @@
 block discarded – undo
15 15
  */
16 16
 class WordPressPageEditorEdit extends RouteMatchSpecification
17 17
 {
18
-    /**
19
-     * returns true if current request matches specification
20
-     *
21
-     * @since $VID:$
22
-     * @return boolean
23
-     */
24
-    public function isMatchingRoute()
25
-    {
26
-        global $post;
27
-        return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false
28
-            && (
29
-                $this->request->getRequestParam('post_type', 'post') === 'page'
30
-                || (
31
-                    $post instanceof WP_Post
32
-                    && $post->post_type === 'page'
33
-                )
34
-            )
35
-            && $this->request->getRequestParam('action') === 'edit';
36
-    }
18
+	/**
19
+	 * returns true if current request matches specification
20
+	 *
21
+	 * @since $VID:$
22
+	 * @return boolean
23
+	 */
24
+	public function isMatchingRoute()
25
+	{
26
+		global $post;
27
+		return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false
28
+			&& (
29
+				$this->request->getRequestParam('post_type', 'post') === 'page'
30
+				|| (
31
+					$post instanceof WP_Post
32
+					&& $post->post_type === 'page'
33
+				)
34
+			)
35
+			&& $this->request->getRequestParam('action') === 'edit';
36
+	}
37 37
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/EspressoVenueEditorEdit.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
  */
15 15
 class EspressoVenueEditorEdit extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since $VID:$
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        return $this->request->getRequestParam('page') === 'espresso_venues'
26
-            && $this->request->getRequestParam('action') === 'edit';
27
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since $VID:$
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		return $this->request->getRequestParam('page') === 'espresso_venues'
26
+			&& $this->request->getRequestParam('action') === 'edit';
27
+	}
28 28
 }
Please login to merge, or discard this patch.
domain/entities/route_match/specifications/admin/EspressoEventEditor.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@
 block discarded – undo
19 19
  */
20 20
 class EspressoEventEditor extends MatchAnyRouteSpecification
21 21
 {
22
-    /**
23
-     * EspressoEventEditor constructor.
24
-     *
25
-     * @param EspressoEventEditorEdit   $edit_event_route_match
26
-     * @param EspressoEventEditorAddNew $create_event_route_match
27
-     * @param RequestInterface          $request
28
-     * @throws InvalidEntityException
29
-     */
30
-    public function __construct(
31
-        EspressoEventEditorEdit $edit_event_route_match,
32
-        EspressoEventEditorAddNew $create_event_route_match,
33
-        RequestInterface $request
34
-    ) {
35
-        parent::__construct(
36
-            array($edit_event_route_match, $create_event_route_match),
37
-            $request
38
-        );
39
-    }
22
+	/**
23
+	 * EspressoEventEditor constructor.
24
+	 *
25
+	 * @param EspressoEventEditorEdit   $edit_event_route_match
26
+	 * @param EspressoEventEditorAddNew $create_event_route_match
27
+	 * @param RequestInterface          $request
28
+	 * @throws InvalidEntityException
29
+	 */
30
+	public function __construct(
31
+		EspressoEventEditorEdit $edit_event_route_match,
32
+		EspressoEventEditorAddNew $create_event_route_match,
33
+		RequestInterface $request
34
+	) {
35
+		parent::__construct(
36
+			array($edit_event_route_match, $create_event_route_match),
37
+			$request
38
+		);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
domain/entities/route_match/specifications/admin/EspressoVenueEditor.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@
 block discarded – undo
19 19
  */
20 20
 class EspressoVenueEditor extends MatchAnyRouteSpecification
21 21
 {
22
-    /**
23
-     * EspressoVenueEditor constructor.
24
-     *
25
-     * @param EspressoVenueEditorEdit $edit_venue_route_match
26
-     * @param EspressoVenueEditorAddNew $create_venue_route_match
27
-     * @param RequestInterface          $request
28
-     * @throws InvalidEntityException
29
-     */
30
-    public function __construct(
31
-        EspressoVenueEditorEdit $edit_venue_route_match,
32
-        EspressoVenueEditorAddNew $create_venue_route_match,
33
-        RequestInterface $request
34
-    ) {
35
-        parent::__construct(
36
-            array($edit_venue_route_match, $create_venue_route_match),
37
-            $request
38
-        );
39
-    }
22
+	/**
23
+	 * EspressoVenueEditor constructor.
24
+	 *
25
+	 * @param EspressoVenueEditorEdit $edit_venue_route_match
26
+	 * @param EspressoVenueEditorAddNew $create_venue_route_match
27
+	 * @param RequestInterface          $request
28
+	 * @throws InvalidEntityException
29
+	 */
30
+	public function __construct(
31
+		EspressoVenueEditorEdit $edit_venue_route_match,
32
+		EspressoVenueEditorAddNew $create_venue_route_match,
33
+		RequestInterface $request
34
+	) {
35
+		parent::__construct(
36
+			array($edit_venue_route_match, $create_venue_route_match),
37
+			$request
38
+		);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
core/services/editor/BlockRegistrationManager.php 1 patch
Indentation   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -32,223 +32,223 @@
 block discarded – undo
32 32
 class BlockRegistrationManager extends BlockManager
33 33
 {
34 34
 
35
-    /**
36
-     * @var BlockAssetManagerCollection $block_asset_manager_collection
37
-     */
38
-    protected $block_asset_manager_collection;
39
-
40
-    /**
41
-     * @var RouteMatchSpecificationManager $route_manager
42
-     */
43
-    protected $route_manager;
44
-
45
-    /**
46
-     * array for tracking asset managers required by blocks for the current route
47
-     *
48
-     * @var array $block_asset_managers
49
-     */
50
-    protected $block_asset_managers = array();
51
-
52
-
53
-    /**
54
-     * BlockRegistrationManager constructor.
55
-     *
56
-     * @param BlockAssetManagerCollection    $block_asset_manager_collection
57
-     * @param BlockCollection                $blocks
58
-     * @param RouteMatchSpecificationManager $route_manager
59
-     * @param RequestInterface               $request
60
-     */
61
-    public function __construct(
62
-        BlockAssetManagerCollection $block_asset_manager_collection,
63
-        BlockCollection $blocks,
64
-        RouteMatchSpecificationManager $route_manager,
65
-        RequestInterface $request
66
-    ) {
67
-        $this->block_asset_manager_collection = $block_asset_manager_collection;
68
-        $this->route_manager = $route_manager;
69
-        parent::__construct($blocks, $request);
70
-    }
71
-
72
-
73
-    /**
74
-     *  Returns the name of a hookpoint to be used to call initialize()
75
-     *
76
-     * @return string
77
-     */
78
-    public function initHook()
79
-    {
80
-        return 'AHEE__EE_System__initialize';
81
-    }
82
-
83
-
84
-    /**
85
-     * Perform any early setup required for block editors to functions
86
-     *
87
-     * @return void
88
-     * @throws Exception
89
-     */
90
-    public function initialize()
91
-    {
92
-        $this->initializeBlocks();
93
-        add_action('AHEE__EE_System__initialize_last', array($this, 'registerBlocks'));
94
-        add_action('wp_loaded', array($this, 'unloadAssets'));
95
-        add_filter('block_categories', array($this, 'addEspressoBlockCategories'));
96
-    }
97
-
98
-
99
-    /**
100
-     * @param array $categories
101
-     * @since $VID:$
102
-     * @return array
103
-     */
104
-    public function addEspressoBlockCategories(array $categories)
105
-    {
106
-        return array_merge(
107
-            $categories,
108
-            array(
109
-                array(
110
-                    'slug' => 'event-espresso',
111
-                    'title' => esc_html__('Event Espresso', 'event_espresso'),
112
-                ),
113
-            )
114
-        );
115
-    }
116
-
117
-
118
-    /**
119
-     * @return CollectionInterface|BlockInterface[]
120
-     * @throws CollectionLoaderException
121
-     * @throws CollectionDetailsException
122
-     */
123
-    protected function populateBlockCollection()
124
-    {
125
-        $loader = new CollectionLoader(
126
-            new CollectionDetails(
127
-                // collection name
128
-                'editor_blocks',
129
-                // collection interface
130
-                'EventEspresso\core\domain\entities\editor\BlockInterface',
131
-                // FQCNs for classes to add (all classes within each namespace will be loaded)
132
-                apply_filters(
133
-                    'FHEE__EventEspresso_core_services_editor_BlockManager__populateBlockCollection__collection_FQCNs',
134
-                    array('EventEspresso\core\domain\entities\editor\blocks')
135
-                ),
136
-                // filepaths to classes to add
137
-                array(),
138
-                // file mask to use if parsing folder for files to add
139
-                '',
140
-                // what to use as identifier for collection entities
141
-                // using CLASS NAME prevents duplicates (works like a singleton)
142
-                CollectionDetails::ID_CLASS_NAME
143
-            ),
144
-            $this->blocks
145
-        );
146
-        return $loader->getCollection();
147
-    }
148
-
149
-
150
-    /**
151
-     * populates the BlockCollection and calls initialize() on all installed blocks
152
-     *
153
-     * @return void
154
-     * @throws Exception
155
-     */
156
-    public function initializeBlocks()
157
-    {
158
-        try {
159
-            $this->populateBlockCollection();
160
-            // cycle thru block loaders and initialize each loader
161
-            foreach ($this->blocks as $block) {
162
-                $block->initialize();
163
-                $this->trackAssetManagersForBlocks($block);
164
-                if (! $this->block_asset_manager_collection->has($block->assetManager())) {
165
-                    $this->block_asset_manager_collection->add($block->assetManager());
166
-                    $block->assetManager()->setAssetHandles();
167
-                }
168
-            }
169
-        } catch (Exception $exception) {
170
-            new ExceptionStackTraceDisplay($exception);
171
-        }
172
-    }
173
-
174
-
175
-    /**
176
-     * track blocks with routes that match the current request
177
-     *
178
-     * @param BlockInterface $block
179
-     * @throws InvalidClassException
180
-     */
181
-    private function trackAssetManagersForBlocks(BlockInterface $block)
182
-    {
183
-        $supported_routes = $block->supportedRoutes();
184
-        foreach ($supported_routes as $supported_route) {
185
-            if ($this->route_manager->routeMatchesCurrentRequest($supported_route)) {
186
-                $this->block_asset_managers[ $block->blockType() ] = $block->assetManager()->assetNamespace();
187
-            }
188
-        }
189
-    }
190
-
191
-
192
-    /**
193
-     * returns true if the block should be registered for the current request
194
-     * else removes block from block_routes array and returns false
195
-     *
196
-     * @param BlockInterface $block
197
-     * @return boolean
198
-     * @throws InvalidClassException
199
-     */
200
-    public function matchesRoute(BlockInterface $block)
201
-    {
202
-        if (isset($this->block_asset_managers[ $block->blockType() ])) {
203
-            return true;
204
-        }
205
-        unset($this->block_asset_managers[ $block->blockType() ]);
206
-        return false;
207
-    }
208
-
209
-
210
-    /**
211
-     * calls registerBlock() and load assets for all installed blocks
212
-     *
213
-     * @return void
214
-     * @throws Exception
215
-     */
216
-    public function registerBlocks()
217
-    {
218
-        try {
219
-            // cycle thru block loader folders
220
-            foreach ($this->blocks as $block) {
221
-                if (! $this->matchesRoute($block)) {
222
-                    continue;
223
-                }
224
-                // perform any setup required for the block
225
-                $block_type = $block->registerBlock();
226
-                if (! $block_type instanceof WP_Block_Type) {
227
-                    throw new InvalidEntityException($block_type, 'WP_Block_Type');
228
-                }
229
-                do_action(
230
-                    'FHEE__EventEspresso_core_services_editor_BlockManager__registerBlocks__block_type_registered',
231
-                    $block,
232
-                    $block_type
233
-                );
234
-            }
235
-        } catch (Exception $exception) {
236
-            new ExceptionStackTraceDisplay($exception);
237
-        }
238
-    }
239
-
240
-    public function unloadAssets()
241
-    {
242
-        $assets = array_flip($this->block_asset_managers);
243
-        foreach ($this->block_asset_manager_collection as $asset_manager) {
244
-            // if there are no longer any blocks that require these assets,
245
-            if (! isset($assets[ $asset_manager->assetNamespace() ])) {
246
-                // then unset asset enqueueing and bail
247
-                remove_action('wp_enqueue_scripts', array($asset_manager, 'addManifestFile'), 0);
248
-                remove_action('admin_enqueue_scripts', array($asset_manager, 'addManifestFile'), 0);
249
-                remove_action('wp_enqueue_scripts', array($asset_manager, 'addAssets'), 2);
250
-                remove_action('admin_enqueue_scripts', array($asset_manager, 'addAssets'), 2);
251
-            }
252
-        }
253
-    }
35
+	/**
36
+	 * @var BlockAssetManagerCollection $block_asset_manager_collection
37
+	 */
38
+	protected $block_asset_manager_collection;
39
+
40
+	/**
41
+	 * @var RouteMatchSpecificationManager $route_manager
42
+	 */
43
+	protected $route_manager;
44
+
45
+	/**
46
+	 * array for tracking asset managers required by blocks for the current route
47
+	 *
48
+	 * @var array $block_asset_managers
49
+	 */
50
+	protected $block_asset_managers = array();
51
+
52
+
53
+	/**
54
+	 * BlockRegistrationManager constructor.
55
+	 *
56
+	 * @param BlockAssetManagerCollection    $block_asset_manager_collection
57
+	 * @param BlockCollection                $blocks
58
+	 * @param RouteMatchSpecificationManager $route_manager
59
+	 * @param RequestInterface               $request
60
+	 */
61
+	public function __construct(
62
+		BlockAssetManagerCollection $block_asset_manager_collection,
63
+		BlockCollection $blocks,
64
+		RouteMatchSpecificationManager $route_manager,
65
+		RequestInterface $request
66
+	) {
67
+		$this->block_asset_manager_collection = $block_asset_manager_collection;
68
+		$this->route_manager = $route_manager;
69
+		parent::__construct($blocks, $request);
70
+	}
71
+
72
+
73
+	/**
74
+	 *  Returns the name of a hookpoint to be used to call initialize()
75
+	 *
76
+	 * @return string
77
+	 */
78
+	public function initHook()
79
+	{
80
+		return 'AHEE__EE_System__initialize';
81
+	}
82
+
83
+
84
+	/**
85
+	 * Perform any early setup required for block editors to functions
86
+	 *
87
+	 * @return void
88
+	 * @throws Exception
89
+	 */
90
+	public function initialize()
91
+	{
92
+		$this->initializeBlocks();
93
+		add_action('AHEE__EE_System__initialize_last', array($this, 'registerBlocks'));
94
+		add_action('wp_loaded', array($this, 'unloadAssets'));
95
+		add_filter('block_categories', array($this, 'addEspressoBlockCategories'));
96
+	}
97
+
98
+
99
+	/**
100
+	 * @param array $categories
101
+	 * @since $VID:$
102
+	 * @return array
103
+	 */
104
+	public function addEspressoBlockCategories(array $categories)
105
+	{
106
+		return array_merge(
107
+			$categories,
108
+			array(
109
+				array(
110
+					'slug' => 'event-espresso',
111
+					'title' => esc_html__('Event Espresso', 'event_espresso'),
112
+				),
113
+			)
114
+		);
115
+	}
116
+
117
+
118
+	/**
119
+	 * @return CollectionInterface|BlockInterface[]
120
+	 * @throws CollectionLoaderException
121
+	 * @throws CollectionDetailsException
122
+	 */
123
+	protected function populateBlockCollection()
124
+	{
125
+		$loader = new CollectionLoader(
126
+			new CollectionDetails(
127
+				// collection name
128
+				'editor_blocks',
129
+				// collection interface
130
+				'EventEspresso\core\domain\entities\editor\BlockInterface',
131
+				// FQCNs for classes to add (all classes within each namespace will be loaded)
132
+				apply_filters(
133
+					'FHEE__EventEspresso_core_services_editor_BlockManager__populateBlockCollection__collection_FQCNs',
134
+					array('EventEspresso\core\domain\entities\editor\blocks')
135
+				),
136
+				// filepaths to classes to add
137
+				array(),
138
+				// file mask to use if parsing folder for files to add
139
+				'',
140
+				// what to use as identifier for collection entities
141
+				// using CLASS NAME prevents duplicates (works like a singleton)
142
+				CollectionDetails::ID_CLASS_NAME
143
+			),
144
+			$this->blocks
145
+		);
146
+		return $loader->getCollection();
147
+	}
148
+
149
+
150
+	/**
151
+	 * populates the BlockCollection and calls initialize() on all installed blocks
152
+	 *
153
+	 * @return void
154
+	 * @throws Exception
155
+	 */
156
+	public function initializeBlocks()
157
+	{
158
+		try {
159
+			$this->populateBlockCollection();
160
+			// cycle thru block loaders and initialize each loader
161
+			foreach ($this->blocks as $block) {
162
+				$block->initialize();
163
+				$this->trackAssetManagersForBlocks($block);
164
+				if (! $this->block_asset_manager_collection->has($block->assetManager())) {
165
+					$this->block_asset_manager_collection->add($block->assetManager());
166
+					$block->assetManager()->setAssetHandles();
167
+				}
168
+			}
169
+		} catch (Exception $exception) {
170
+			new ExceptionStackTraceDisplay($exception);
171
+		}
172
+	}
173
+
174
+
175
+	/**
176
+	 * track blocks with routes that match the current request
177
+	 *
178
+	 * @param BlockInterface $block
179
+	 * @throws InvalidClassException
180
+	 */
181
+	private function trackAssetManagersForBlocks(BlockInterface $block)
182
+	{
183
+		$supported_routes = $block->supportedRoutes();
184
+		foreach ($supported_routes as $supported_route) {
185
+			if ($this->route_manager->routeMatchesCurrentRequest($supported_route)) {
186
+				$this->block_asset_managers[ $block->blockType() ] = $block->assetManager()->assetNamespace();
187
+			}
188
+		}
189
+	}
190
+
191
+
192
+	/**
193
+	 * returns true if the block should be registered for the current request
194
+	 * else removes block from block_routes array and returns false
195
+	 *
196
+	 * @param BlockInterface $block
197
+	 * @return boolean
198
+	 * @throws InvalidClassException
199
+	 */
200
+	public function matchesRoute(BlockInterface $block)
201
+	{
202
+		if (isset($this->block_asset_managers[ $block->blockType() ])) {
203
+			return true;
204
+		}
205
+		unset($this->block_asset_managers[ $block->blockType() ]);
206
+		return false;
207
+	}
208
+
209
+
210
+	/**
211
+	 * calls registerBlock() and load assets for all installed blocks
212
+	 *
213
+	 * @return void
214
+	 * @throws Exception
215
+	 */
216
+	public function registerBlocks()
217
+	{
218
+		try {
219
+			// cycle thru block loader folders
220
+			foreach ($this->blocks as $block) {
221
+				if (! $this->matchesRoute($block)) {
222
+					continue;
223
+				}
224
+				// perform any setup required for the block
225
+				$block_type = $block->registerBlock();
226
+				if (! $block_type instanceof WP_Block_Type) {
227
+					throw new InvalidEntityException($block_type, 'WP_Block_Type');
228
+				}
229
+				do_action(
230
+					'FHEE__EventEspresso_core_services_editor_BlockManager__registerBlocks__block_type_registered',
231
+					$block,
232
+					$block_type
233
+				);
234
+			}
235
+		} catch (Exception $exception) {
236
+			new ExceptionStackTraceDisplay($exception);
237
+		}
238
+	}
239
+
240
+	public function unloadAssets()
241
+	{
242
+		$assets = array_flip($this->block_asset_managers);
243
+		foreach ($this->block_asset_manager_collection as $asset_manager) {
244
+			// if there are no longer any blocks that require these assets,
245
+			if (! isset($assets[ $asset_manager->assetNamespace() ])) {
246
+				// then unset asset enqueueing and bail
247
+				remove_action('wp_enqueue_scripts', array($asset_manager, 'addManifestFile'), 0);
248
+				remove_action('admin_enqueue_scripts', array($asset_manager, 'addManifestFile'), 0);
249
+				remove_action('wp_enqueue_scripts', array($asset_manager, 'addAssets'), 2);
250
+				remove_action('admin_enqueue_scripts', array($asset_manager, 'addAssets'), 2);
251
+			}
252
+		}
253
+	}
254 254
 }
Please login to merge, or discard this patch.
route_match/specifications/admin/EspressoStandardPostTypeEditor.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -15,18 +15,18 @@
 block discarded – undo
15 15
 class EspressoStandardPostTypeEditor extends RouteMatchSpecification
16 16
 {
17 17
 
18
-    /**
19
-     * returns true if current request matches specification
20
-     *
21
-     * @since $VID:$
22
-     * @return boolean
23
-     */
24
-    public function isMatchingRoute()
25
-    {
26
-        return $this->request->getMatch('espresso_*') !== false
27
-               && (
28
-                   $this->request->getRequestParam('action') === 'edit'
29
-                   || $this->request->getRequestParam('action') === 'create_new'
30
-               );
31
-    }
18
+	/**
19
+	 * returns true if current request matches specification
20
+	 *
21
+	 * @since $VID:$
22
+	 * @return boolean
23
+	 */
24
+	public function isMatchingRoute()
25
+	{
26
+		return $this->request->getMatch('espresso_*') !== false
27
+			   && (
28
+				   $this->request->getRequestParam('action') === 'edit'
29
+				   || $this->request->getRequestParam('action') === 'create_new'
30
+			   );
31
+	}
32 32
 }
Please login to merge, or discard this patch.
domain/entities/route_match/specifications/admin/EspressoPostTypeEditor.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -18,22 +18,22 @@
 block discarded – undo
18 18
  */
19 19
 class EspressoPostTypeEditor extends MatchAnyRouteSpecification
20 20
 {
21
-    /**
22
-     * EspressoEventEditor constructor.
23
-     *
24
-     * @param EspressoStandardPostTypeEditor $standard_route_match
25
-     * @param EspressoAttendeePostTypeEditor $attendee_route_match
26
-     * @param RequestInterface          $request
27
-     * @throws InvalidEntityException
28
-     */
29
-    public function __construct(
30
-        EspressoStandardPostTypeEditor $standard_route_match,
31
-        EspressoAttendeePostTypeEditor $attendee_route_match,
32
-        RequestInterface $request
33
-    ) {
34
-        parent::__construct(
35
-            array($standard_route_match, $attendee_route_match),
36
-            $request
37
-        );
38
-    }
21
+	/**
22
+	 * EspressoEventEditor constructor.
23
+	 *
24
+	 * @param EspressoStandardPostTypeEditor $standard_route_match
25
+	 * @param EspressoAttendeePostTypeEditor $attendee_route_match
26
+	 * @param RequestInterface          $request
27
+	 * @throws InvalidEntityException
28
+	 */
29
+	public function __construct(
30
+		EspressoStandardPostTypeEditor $standard_route_match,
31
+		EspressoAttendeePostTypeEditor $attendee_route_match,
32
+		RequestInterface $request
33
+	) {
34
+		parent::__construct(
35
+			array($standard_route_match, $attendee_route_match),
36
+			$request
37
+		);
38
+	}
39 39
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/WordPressPageEditorAddNew.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
  */
15 15
 class WordPressPageEditorAddNew extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since $VID:$
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false
26
-            && $this->request->getRequestParam('post_type', 'post') === 'page';
27
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since $VID:$
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false
26
+			&& $this->request->getRequestParam('post_type', 'post') === 'page';
27
+	}
28 28
 }
Please login to merge, or discard this patch.