Completed
Branch fix-caching-loader-test (60c3ed)
by
unknown
13:30 queued 04:34
created
core/domain/entities/routing/specifications/MultiRouteSpecification.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     public function __construct(array $specifications, RequestInterface $request)
32 32
     {
33 33
         foreach ($specifications as $specification) {
34
-            if (! $specification instanceof RouteMatchSpecificationInterface) {
34
+            if ( ! $specification instanceof RouteMatchSpecificationInterface) {
35 35
                 throw new InvalidEntityException(
36 36
                     $specification,
37 37
                     'EventEspresso\core\domain\entities\routing\specifications\RouteMatchSpecificationInterface'
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@
 block discarded – undo
15 15
  */
16 16
 abstract class MultiRouteSpecification extends RouteMatchSpecification
17 17
 {
18
-    /**
19
-     * @var RouteMatchSpecificationInterface[] $specifications
20
-     */
21
-    protected $specifications;
18
+	/**
19
+	 * @var RouteMatchSpecificationInterface[] $specifications
20
+	 */
21
+	protected $specifications;
22 22
 
23
-    /**
24
-     * MultiRouteSpecification constructor.
25
-     *
26
-     * @param RouteMatchSpecificationInterface[] $specifications
27
-     * @param RequestInterface                   $request
28
-     * @throws InvalidEntityException
29
-     */
30
-    public function __construct(array $specifications, RequestInterface $request)
31
-    {
32
-        foreach ($specifications as $specification) {
33
-            if (! $specification instanceof RouteMatchSpecificationInterface) {
34
-                throw new InvalidEntityException(
35
-                    $specification,
36
-                    'EventEspresso\core\domain\entities\routing\specifications\RouteMatchSpecificationInterface'
37
-                );
38
-            }
39
-        }
40
-        $this->specifications = $specifications;
41
-        parent::__construct($request);
42
-    }
23
+	/**
24
+	 * MultiRouteSpecification constructor.
25
+	 *
26
+	 * @param RouteMatchSpecificationInterface[] $specifications
27
+	 * @param RequestInterface                   $request
28
+	 * @throws InvalidEntityException
29
+	 */
30
+	public function __construct(array $specifications, RequestInterface $request)
31
+	{
32
+		foreach ($specifications as $specification) {
33
+			if (! $specification instanceof RouteMatchSpecificationInterface) {
34
+				throw new InvalidEntityException(
35
+					$specification,
36
+					'EventEspresso\core\domain\entities\routing\specifications\RouteMatchSpecificationInterface'
37
+				);
38
+			}
39
+		}
40
+		$this->specifications = $specifications;
41
+		parent::__construct($request);
42
+	}
43 43
 }
Please login to merge, or discard this patch.
core/services/routing/RouteMatchSpecificationManager.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
     {
116 116
         /** @var RouteMatchSpecificationInterface $specification */
117 117
         $specification = $this->specifications->get($routeMatchSpecificationFqcn);
118
-        if (! $specification instanceof $routeMatchSpecificationFqcn) {
118
+        if ( ! $specification instanceof $routeMatchSpecificationFqcn) {
119 119
             throw new InvalidClassException($routeMatchSpecificationFqcn);
120 120
         }
121 121
         return $specification->isMatchingRoute();
Please login to merge, or discard this patch.
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -26,125 +26,125 @@
 block discarded – undo
26 26
  */
27 27
 class RouteMatchSpecificationManager implements InterminableInterface
28 28
 {
29
-    /**
30
-     * @var CollectionInterface[]|RouteMatchSpecificationInterface[] $specifications
31
-     */
32
-    private $specifications;
29
+	/**
30
+	 * @var CollectionInterface[]|RouteMatchSpecificationInterface[] $specifications
31
+	 */
32
+	private $specifications;
33 33
 
34
-    /**
35
-     * @var RouteMatchSpecificationFactory $specifications_factory
36
-     */
37
-    private $specifications_factory;
34
+	/**
35
+	 * @var RouteMatchSpecificationFactory $specifications_factory
36
+	 */
37
+	private $specifications_factory;
38 38
 
39 39
 
40
-    /**
41
-     * RouteMatchSpecificationManager constructor.
42
-     *
43
-     * @param RouteMatchSpecificationCollection $specifications
44
-     * @param RouteMatchSpecificationFactory    $specifications_factory
45
-     */
46
-    public function __construct(
47
-        RouteMatchSpecificationCollection $specifications,
48
-        RouteMatchSpecificationFactory $specifications_factory
49
-    ) {
50
-        $this->specifications = $specifications;
51
-        $this->specifications_factory = $specifications_factory;
52
-        add_action('AHEE__EE_System__loadRouteMatchSpecifications', array($this, 'initialize'));
53
-    }
40
+	/**
41
+	 * RouteMatchSpecificationManager constructor.
42
+	 *
43
+	 * @param RouteMatchSpecificationCollection $specifications
44
+	 * @param RouteMatchSpecificationFactory    $specifications_factory
45
+	 */
46
+	public function __construct(
47
+		RouteMatchSpecificationCollection $specifications,
48
+		RouteMatchSpecificationFactory $specifications_factory
49
+	) {
50
+		$this->specifications = $specifications;
51
+		$this->specifications_factory = $specifications_factory;
52
+		add_action('AHEE__EE_System__loadRouteMatchSpecifications', array($this, 'initialize'));
53
+	}
54 54
 
55 55
 
56
-    /**
57
-     * Perform any early setup required for block editors to functions
58
-     *
59
-     * @return void
60
-     * @throws CollectionLoaderException
61
-     * @throws CollectionDetailsException
62
-     */
63
-    public function initialize()
64
-    {
65
-        // static $initialized = false;
66
-        // if (! $initialized) {
67
-            $this->populateSpecificationCollection();
68
-        //     $initialized = true;
69
-        // }
70
-    }
56
+	/**
57
+	 * Perform any early setup required for block editors to functions
58
+	 *
59
+	 * @return void
60
+	 * @throws CollectionLoaderException
61
+	 * @throws CollectionDetailsException
62
+	 */
63
+	public function initialize()
64
+	{
65
+		// static $initialized = false;
66
+		// if (! $initialized) {
67
+			$this->populateSpecificationCollection();
68
+		//     $initialized = true;
69
+		// }
70
+	}
71 71
 
72 72
 
73
-    /**
74
-     * @return void
75
-     * @throws CollectionLoaderException
76
-     * @throws CollectionDetailsException
77
-     * @since 4.9.71.p
78
-     */
79
-    private function populateSpecificationCollection()
80
-    {
81
-        new CollectionLoader(
82
-            new CollectionDetails(
83
-                // collection name
84
-                RouteMatchSpecificationCollection::COLLECTION_NAME,
85
-                // collection interface
86
-                'EventEspresso\core\domain\entities\routing\specifications\RouteMatchSpecificationInterface',
87
-                // FQCNs for classes to add (all classes within each namespace will be loaded)
88
-                apply_filters(
89
-                    'FHEE__EventEspresso_core_services_route_match_RouteMatchSpecificationManager__populateSpecificationCollection__collection_FQCNs',
90
-                    array(
91
-                        'EventEspresso\core\domain\entities\routing\specifications\admin',
92
-                        'EventEspresso\core\domain\entities\routing\specifications\frontend',
93
-                    )
94
-                ),
95
-                // filepaths to classes to add
96
-                array(),
97
-                // file mask to use if parsing folder for files to add
98
-                '',
99
-                // what to use as identifier for collection entities
100
-                // using CLASS NAME prevents duplicates (works like a singleton)
101
-                CollectionDetails::ID_CLASS_NAME
102
-            ),
103
-            $this->specifications,
104
-            null,
105
-            $this->specifications_factory
106
-        );
107
-    }
73
+	/**
74
+	 * @return void
75
+	 * @throws CollectionLoaderException
76
+	 * @throws CollectionDetailsException
77
+	 * @since 4.9.71.p
78
+	 */
79
+	private function populateSpecificationCollection()
80
+	{
81
+		new CollectionLoader(
82
+			new CollectionDetails(
83
+				// collection name
84
+				RouteMatchSpecificationCollection::COLLECTION_NAME,
85
+				// collection interface
86
+				'EventEspresso\core\domain\entities\routing\specifications\RouteMatchSpecificationInterface',
87
+				// FQCNs for classes to add (all classes within each namespace will be loaded)
88
+				apply_filters(
89
+					'FHEE__EventEspresso_core_services_route_match_RouteMatchSpecificationManager__populateSpecificationCollection__collection_FQCNs',
90
+					array(
91
+						'EventEspresso\core\domain\entities\routing\specifications\admin',
92
+						'EventEspresso\core\domain\entities\routing\specifications\frontend',
93
+					)
94
+				),
95
+				// filepaths to classes to add
96
+				array(),
97
+				// file mask to use if parsing folder for files to add
98
+				'',
99
+				// what to use as identifier for collection entities
100
+				// using CLASS NAME prevents duplicates (works like a singleton)
101
+				CollectionDetails::ID_CLASS_NAME
102
+			),
103
+			$this->specifications,
104
+			null,
105
+			$this->specifications_factory
106
+		);
107
+	}
108 108
 
109 109
 
110
-    /**
111
-     * Given the FQCN for a RouteMatchSpecification, will return true if the current request matches
112
-     *
113
-     * @param string $routeMatchSpecificationFqcn fully qualified class name
114
-     * @return bool
115
-     * @throws InvalidClassException
116
-     * @since 4.9.71.p
117
-     */
118
-    public function routeMatchesCurrentRequest(string $routeMatchSpecificationFqcn): bool
119
-    {
120
-        /** @var RouteMatchSpecificationInterface $specification */
121
-        $specification = $this->specifications->get($routeMatchSpecificationFqcn);
122
-        if (! $specification instanceof $routeMatchSpecificationFqcn) {
123
-            throw new InvalidClassException($routeMatchSpecificationFqcn);
124
-        }
125
-        return $specification->isMatchingRoute();
126
-    }
110
+	/**
111
+	 * Given the FQCN for a RouteMatchSpecification, will return true if the current request matches
112
+	 *
113
+	 * @param string $routeMatchSpecificationFqcn fully qualified class name
114
+	 * @return bool
115
+	 * @throws InvalidClassException
116
+	 * @since 4.9.71.p
117
+	 */
118
+	public function routeMatchesCurrentRequest(string $routeMatchSpecificationFqcn): bool
119
+	{
120
+		/** @var RouteMatchSpecificationInterface $specification */
121
+		$specification = $this->specifications->get($routeMatchSpecificationFqcn);
122
+		if (! $specification instanceof $routeMatchSpecificationFqcn) {
123
+			throw new InvalidClassException($routeMatchSpecificationFqcn);
124
+		}
125
+		return $specification->isMatchingRoute();
126
+	}
127 127
 
128 128
 
129
-    /**
130
-     * Handy method for development that returns
131
-     * a list of existing RouteMatchSpecification classes
132
-     * matching the current request that can be used to identify it.
133
-     * If no matches are returned (or nothing acceptable)
134
-     * then create a new one that better matches your requirements.
135
-     *
136
-     * @return array
137
-     * @since 4.9.71.p
138
-     */
139
-    public function findRouteMatchSpecificationsMatchingCurrentRequest(): array
140
-    {
141
-        $matches = array();
142
-        foreach ($this->specifications as $specification) {
143
-            /** @var RouteMatchSpecificationInterface $specification */
144
-            if ($specification->isMatchingRoute()) {
145
-                $matches[] = get_class($specification);
146
-            }
147
-        }
148
-        return $matches;
149
-    }
129
+	/**
130
+	 * Handy method for development that returns
131
+	 * a list of existing RouteMatchSpecification classes
132
+	 * matching the current request that can be used to identify it.
133
+	 * If no matches are returned (or nothing acceptable)
134
+	 * then create a new one that better matches your requirements.
135
+	 *
136
+	 * @return array
137
+	 * @since 4.9.71.p
138
+	 */
139
+	public function findRouteMatchSpecificationsMatchingCurrentRequest(): array
140
+	{
141
+		$matches = array();
142
+		foreach ($this->specifications as $specification) {
143
+			/** @var RouteMatchSpecificationInterface $specification */
144
+			if ($specification->isMatchingRoute()) {
145
+				$matches[] = get_class($specification);
146
+			}
147
+		}
148
+		return $matches;
149
+	}
150 150
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/specifications/admin/WordPressPostsEditor.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 WordPressPostsEditor extends MatchAnyRouteSpecification
21 21
 {
22
-    /**
23
-     * WordPressPostsEditor constructor.
24
-     *
25
-     * @param WordPressPostsEditorEdit $edit_post_route_match
26
-     * @param WordPressPostsEditorAddNew $create_post_route_match
27
-     * @param RequestInterface           $request
28
-     * @throws InvalidEntityException
29
-     */
30
-    public function __construct(
31
-        WordPressPostsEditorEdit $edit_post_route_match,
32
-        WordPressPostsEditorAddNew $create_post_route_match,
33
-        RequestInterface $request
34
-    ) {
35
-        parent::__construct(
36
-            array($edit_post_route_match, $create_post_route_match),
37
-            $request
38
-        );
39
-    }
22
+	/**
23
+	 * WordPressPostsEditor constructor.
24
+	 *
25
+	 * @param WordPressPostsEditorEdit $edit_post_route_match
26
+	 * @param WordPressPostsEditorAddNew $create_post_route_match
27
+	 * @param RequestInterface           $request
28
+	 * @throws InvalidEntityException
29
+	 */
30
+	public function __construct(
31
+		WordPressPostsEditorEdit $edit_post_route_match,
32
+		WordPressPostsEditorAddNew $create_post_route_match,
33
+		RequestInterface $request
34
+	) {
35
+		parent::__construct(
36
+			array($edit_post_route_match, $create_post_route_match),
37
+			$request
38
+		);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
domain/entities/routing/specifications/admin/EspressoEventEditorEdit.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -14,19 +14,19 @@
 block discarded – undo
14 14
  */
15 15
 class EspressoEventEditorEdit extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        global $pagenow;
26
-        return $pagenow
27
-               && $pagenow === 'admin.php'
28
-               && $this->request->isAdmin()
29
-               && $this->request->getRequestParam('page') === 'espresso_events'
30
-               && $this->request->getRequestParam('action', 'edit') === 'edit';
31
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		global $pagenow;
26
+		return $pagenow
27
+			   && $pagenow === 'admin.php'
28
+			   && $this->request->isAdmin()
29
+			   && $this->request->getRequestParam('page') === 'espresso_events'
30
+			   && $this->request->getRequestParam('action', 'edit') === 'edit';
31
+	}
32 32
 }
Please login to merge, or discard this patch.
domain/entities/routing/specifications/admin/EspressoEventsListTable.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -14,18 +14,18 @@
 block discarded – undo
14 14
  */
15 15
 class EspressoEventsListTable extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        global $pagenow;
26
-        return $pagenow
27
-               && $pagenow === 'admin.php'
28
-               && $this->request->getRequestParam('page') === 'espresso_events'
29
-               && $this->request->getRequestParam('action', 'default') === 'default';
30
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		global $pagenow;
26
+		return $pagenow
27
+			   && $pagenow === 'admin.php'
28
+			   && $this->request->getRequestParam('page') === 'espresso_events'
29
+			   && $this->request->getRequestParam('action', 'default') === 'default';
30
+	}
31 31
 }
Please login to merge, or discard this patch.
domain/entities/routing/specifications/admin/EspressoVenueEditorAddNew.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -14,18 +14,18 @@
 block discarded – undo
14 14
  */
15 15
 class EspressoVenueEditorAddNew extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        global $pagenow;
26
-        return $pagenow
27
-               && $pagenow === 'admin.php'
28
-               && $this->request->getRequestParam('page') === 'espresso_venues'
29
-               && $this->request->getRequestParam('action') === 'create_new';
30
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		global $pagenow;
26
+		return $pagenow
27
+			   && $pagenow === 'admin.php'
28
+			   && $this->request->getRequestParam('page') === 'espresso_venues'
29
+			   && $this->request->getRequestParam('action') === 'create_new';
30
+	}
31 31
 }
Please login to merge, or discard this patch.
domain/entities/routing/specifications/admin/WordPressPostsListTable.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@
 block discarded – undo
14 14
  */
15 15
 class WordPressPostsListTable extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        global $pagenow;
26
-        return $pagenow
27
-               && $pagenow === 'edit.php'
28
-               && $this->request->getRequestParam('post_type', 'post') === 'post';
29
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		global $pagenow;
26
+		return $pagenow
27
+			   && $pagenow === 'edit.php'
28
+			   && $this->request->getRequestParam('post_type', 'post') === 'post';
29
+	}
30 30
 }
Please login to merge, or discard this patch.
domain/entities/routing/specifications/admin/EspressoEventEditorAddNew.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -14,19 +14,19 @@
 block discarded – undo
14 14
  */
15 15
 class EspressoEventEditorAddNew extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        global $pagenow;
26
-        return $pagenow
27
-               && $pagenow === 'admin.php'
28
-               && $this->request->isAdmin()
29
-               && $this->request->getRequestParam('page') === 'espresso_events'
30
-               && $this->request->getRequestParam('action') === 'create_new';
31
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		global $pagenow;
26
+		return $pagenow
27
+			   && $pagenow === 'admin.php'
28
+			   && $this->request->isAdmin()
29
+			   && $this->request->getRequestParam('page') === 'espresso_events'
30
+			   && $this->request->getRequestParam('action') === 'create_new';
31
+	}
32 32
 }
Please login to merge, or discard this patch.
domain/entities/routing/specifications/admin/EspressoVenueEditorEdit.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -14,18 +14,18 @@
 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 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        global $pagenow;
26
-        return $pagenow
27
-               && $pagenow === 'admin.php'
28
-               && $this->request->getRequestParam('page') === 'espresso_venues'
29
-               && $this->request->getRequestParam('action') === 'edit';
30
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		global $pagenow;
26
+		return $pagenow
27
+			   && $pagenow === 'admin.php'
28
+			   && $this->request->getRequestParam('page') === 'espresso_venues'
29
+			   && $this->request->getRequestParam('action') === 'edit';
30
+	}
31 31
 }
Please login to merge, or discard this patch.