@@ -15,15 +15,15 @@ |
||
15 | 15 | */ |
16 | 16 | class WordPressPostTypeEditor extends RouteMatchSpecification |
17 | 17 | { |
18 | - /** |
|
19 | - * returns true if current request matches specification |
|
20 | - * |
|
21 | - * @since 4.9.71.p |
|
22 | - * @return boolean |
|
23 | - */ |
|
24 | - public function isMatchingRoute() |
|
25 | - { |
|
26 | - return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false |
|
27 | - || strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false; |
|
28 | - } |
|
18 | + /** |
|
19 | + * returns true if current request matches specification |
|
20 | + * |
|
21 | + * @since 4.9.71.p |
|
22 | + * @return boolean |
|
23 | + */ |
|
24 | + public function isMatchingRoute() |
|
25 | + { |
|
26 | + return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false |
|
27 | + || strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false; |
|
28 | + } |
|
29 | 29 | } |
@@ -14,18 +14,18 @@ |
||
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 | - return $this->request->getRequestParam('page') === 'espresso_events' |
|
26 | - && ( |
|
27 | - $this->request->getRequestParam('action') === 'default' |
|
28 | - || $this->request->requestParamIsSet('action') === false |
|
29 | - ); |
|
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 | + return $this->request->getRequestParam('page') === 'espresso_events' |
|
26 | + && ( |
|
27 | + $this->request->getRequestParam('action') === 'default' |
|
28 | + || $this->request->requestParamIsSet('action') === false |
|
29 | + ); |
|
30 | + } |
|
31 | 31 | } |
@@ -15,21 +15,21 @@ |
||
15 | 15 | class EspressoBlockRenderer extends RouteMatchSpecification |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * returns true if current request matches specification |
|
20 | - * |
|
21 | - * @since 4.9.71.p |
|
22 | - * @return boolean |
|
23 | - */ |
|
24 | - public function isMatchingRoute() |
|
25 | - { |
|
26 | - return strpos( |
|
27 | - $this->request->requestUri(), |
|
28 | - 'wp-json/wp/v2/block-renderer/eventespresso' |
|
29 | - ) !== false |
|
30 | - || strpos( |
|
31 | - $this->request->requestUri(), |
|
32 | - 'wp-json/gutenberg/v2/block-renderer/eventespresso' |
|
33 | - ) !== false; |
|
34 | - } |
|
18 | + /** |
|
19 | + * returns true if current request matches specification |
|
20 | + * |
|
21 | + * @since 4.9.71.p |
|
22 | + * @return boolean |
|
23 | + */ |
|
24 | + public function isMatchingRoute() |
|
25 | + { |
|
26 | + return strpos( |
|
27 | + $this->request->requestUri(), |
|
28 | + 'wp-json/wp/v2/block-renderer/eventespresso' |
|
29 | + ) !== false |
|
30 | + || strpos( |
|
31 | + $this->request->requestUri(), |
|
32 | + 'wp-json/gutenberg/v2/block-renderer/eventespresso' |
|
33 | + ) !== false; |
|
34 | + } |
|
35 | 35 | } |
@@ -14,14 +14,14 @@ |
||
14 | 14 | */ |
15 | 15 | class DoesNotMatchRouteSpecification extends RouteMatchSpecificationDecorator |
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 | - return ! $this->specification->isMatchingRoute(); |
|
26 | - } |
|
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 | + return ! $this->specification->isMatchingRoute(); |
|
26 | + } |
|
27 | 27 | } |
@@ -12,11 +12,11 @@ |
||
12 | 12 | */ |
13 | 13 | interface RouteMatchSpecificationInterface |
14 | 14 | { |
15 | - /** |
|
16 | - * returns true if current request matches specification |
|
17 | - * |
|
18 | - * @since 4.9.71.p |
|
19 | - * @return boolean |
|
20 | - */ |
|
21 | - public function isMatchingRoute(); |
|
15 | + /** |
|
16 | + * returns true if current request matches specification |
|
17 | + * |
|
18 | + * @since 4.9.71.p |
|
19 | + * @return boolean |
|
20 | + */ |
|
21 | + public function isMatchingRoute(); |
|
22 | 22 | } |
@@ -20,92 +20,92 @@ |
||
20 | 20 | */ |
21 | 21 | interface AssetManagerInterface |
22 | 22 | { |
23 | - /** |
|
24 | - * @since 4.9.71.p |
|
25 | - * @return string |
|
26 | - */ |
|
27 | - public function assetNamespace(); |
|
28 | - |
|
29 | - /** |
|
30 | - * @since 4.9.62.p |
|
31 | - */ |
|
32 | - public function addAssets(); |
|
33 | - |
|
34 | - |
|
35 | - /** |
|
36 | - * @return ManifestFile |
|
37 | - * @throws DuplicateCollectionIdentifierException |
|
38 | - * @throws InvalidDataTypeException |
|
39 | - * @throws InvalidEntityException |
|
40 | - * @since 4.9.62.p |
|
41 | - */ |
|
42 | - public function addManifestFile(); |
|
43 | - |
|
44 | - |
|
45 | - /** |
|
46 | - * @return ManifestFile[] |
|
47 | - * @since 4.9.62.p |
|
48 | - */ |
|
49 | - public function getManifestFile(); |
|
50 | - |
|
51 | - |
|
52 | - /** |
|
53 | - * @param string $handle |
|
54 | - * @param string $source |
|
55 | - * @param array $dependencies |
|
56 | - * @param bool $load_in_footer |
|
57 | - * @return JavascriptAsset |
|
58 | - * @throws DuplicateCollectionIdentifierException |
|
59 | - * @throws InvalidDataTypeException |
|
60 | - * @throws InvalidEntityException |
|
61 | - * @since 4.9.62.p |
|
62 | - */ |
|
63 | - public function addJavascript( |
|
64 | - $handle, |
|
65 | - $source, |
|
66 | - array $dependencies = array(), |
|
67 | - $load_in_footer = true |
|
68 | - ); |
|
69 | - |
|
70 | - |
|
71 | - /** |
|
72 | - * @since 4.9.71.p |
|
73 | - * @param string $handle |
|
74 | - * @param array $dependencies |
|
75 | - * @param bool $load_in_footer |
|
76 | - * @return JavascriptAsset |
|
77 | - */ |
|
78 | - public function addVendorJavascript( |
|
79 | - $handle, |
|
80 | - array $dependencies = array(), |
|
81 | - $load_in_footer = true |
|
82 | - ); |
|
83 | - |
|
84 | - |
|
85 | - |
|
86 | - /** |
|
87 | - * @param string $handle |
|
88 | - * @param string $source |
|
89 | - * @param array $dependencies |
|
90 | - * @param string $media |
|
91 | - * @return StylesheetAsset |
|
92 | - * @throws DuplicateCollectionIdentifierException |
|
93 | - * @throws InvalidDataTypeException |
|
94 | - * @throws InvalidEntityException |
|
95 | - * @since 4.9.62.p |
|
96 | - */ |
|
97 | - public function addStylesheet( |
|
98 | - $handle, |
|
99 | - $source, |
|
100 | - array $dependencies = array(), |
|
101 | - $media = 'all' |
|
102 | - ); |
|
103 | - |
|
104 | - |
|
105 | - /** |
|
106 | - * @param string $handle |
|
107 | - * @return bool |
|
108 | - * @since 4.9.62.p |
|
109 | - */ |
|
110 | - public function enqueueAsset($handle); |
|
23 | + /** |
|
24 | + * @since 4.9.71.p |
|
25 | + * @return string |
|
26 | + */ |
|
27 | + public function assetNamespace(); |
|
28 | + |
|
29 | + /** |
|
30 | + * @since 4.9.62.p |
|
31 | + */ |
|
32 | + public function addAssets(); |
|
33 | + |
|
34 | + |
|
35 | + /** |
|
36 | + * @return ManifestFile |
|
37 | + * @throws DuplicateCollectionIdentifierException |
|
38 | + * @throws InvalidDataTypeException |
|
39 | + * @throws InvalidEntityException |
|
40 | + * @since 4.9.62.p |
|
41 | + */ |
|
42 | + public function addManifestFile(); |
|
43 | + |
|
44 | + |
|
45 | + /** |
|
46 | + * @return ManifestFile[] |
|
47 | + * @since 4.9.62.p |
|
48 | + */ |
|
49 | + public function getManifestFile(); |
|
50 | + |
|
51 | + |
|
52 | + /** |
|
53 | + * @param string $handle |
|
54 | + * @param string $source |
|
55 | + * @param array $dependencies |
|
56 | + * @param bool $load_in_footer |
|
57 | + * @return JavascriptAsset |
|
58 | + * @throws DuplicateCollectionIdentifierException |
|
59 | + * @throws InvalidDataTypeException |
|
60 | + * @throws InvalidEntityException |
|
61 | + * @since 4.9.62.p |
|
62 | + */ |
|
63 | + public function addJavascript( |
|
64 | + $handle, |
|
65 | + $source, |
|
66 | + array $dependencies = array(), |
|
67 | + $load_in_footer = true |
|
68 | + ); |
|
69 | + |
|
70 | + |
|
71 | + /** |
|
72 | + * @since 4.9.71.p |
|
73 | + * @param string $handle |
|
74 | + * @param array $dependencies |
|
75 | + * @param bool $load_in_footer |
|
76 | + * @return JavascriptAsset |
|
77 | + */ |
|
78 | + public function addVendorJavascript( |
|
79 | + $handle, |
|
80 | + array $dependencies = array(), |
|
81 | + $load_in_footer = true |
|
82 | + ); |
|
83 | + |
|
84 | + |
|
85 | + |
|
86 | + /** |
|
87 | + * @param string $handle |
|
88 | + * @param string $source |
|
89 | + * @param array $dependencies |
|
90 | + * @param string $media |
|
91 | + * @return StylesheetAsset |
|
92 | + * @throws DuplicateCollectionIdentifierException |
|
93 | + * @throws InvalidDataTypeException |
|
94 | + * @throws InvalidEntityException |
|
95 | + * @since 4.9.62.p |
|
96 | + */ |
|
97 | + public function addStylesheet( |
|
98 | + $handle, |
|
99 | + $source, |
|
100 | + array $dependencies = array(), |
|
101 | + $media = 'all' |
|
102 | + ); |
|
103 | + |
|
104 | + |
|
105 | + /** |
|
106 | + * @param string $handle |
|
107 | + * @return bool |
|
108 | + * @since 4.9.62.p |
|
109 | + */ |
|
110 | + public function enqueueAsset($handle); |
|
111 | 111 | } |
@@ -12,42 +12,42 @@ |
||
12 | 12 | */ |
13 | 13 | interface BlockAssetManagerInterface |
14 | 14 | { |
15 | - /** |
|
16 | - * @since 4.9.71.p |
|
17 | - * @return string |
|
18 | - */ |
|
19 | - public function assetNamespace(); |
|
20 | - |
|
21 | - /** |
|
22 | - * @since 4.9.71.p |
|
23 | - * @return void |
|
24 | - */ |
|
25 | - public function setAssetHandles(); |
|
26 | - |
|
27 | - /** |
|
28 | - * @since 4.9.71.p |
|
29 | - * @return string |
|
30 | - */ |
|
31 | - public function getEditorScriptHandle(); |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * @since 4.9.71.p |
|
36 | - * @return string |
|
37 | - */ |
|
38 | - public function getEditorStyleHandle(); |
|
39 | - |
|
40 | - |
|
41 | - /** |
|
42 | - * @since 4.9.71.p |
|
43 | - * @return string |
|
44 | - */ |
|
45 | - public function getScriptHandle(); |
|
46 | - |
|
47 | - |
|
48 | - /** |
|
49 | - * @since 4.9.71.p |
|
50 | - * @return string |
|
51 | - */ |
|
52 | - public function getStyleHandle(); |
|
15 | + /** |
|
16 | + * @since 4.9.71.p |
|
17 | + * @return string |
|
18 | + */ |
|
19 | + public function assetNamespace(); |
|
20 | + |
|
21 | + /** |
|
22 | + * @since 4.9.71.p |
|
23 | + * @return void |
|
24 | + */ |
|
25 | + public function setAssetHandles(); |
|
26 | + |
|
27 | + /** |
|
28 | + * @since 4.9.71.p |
|
29 | + * @return string |
|
30 | + */ |
|
31 | + public function getEditorScriptHandle(); |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * @since 4.9.71.p |
|
36 | + * @return string |
|
37 | + */ |
|
38 | + public function getEditorStyleHandle(); |
|
39 | + |
|
40 | + |
|
41 | + /** |
|
42 | + * @since 4.9.71.p |
|
43 | + * @return string |
|
44 | + */ |
|
45 | + public function getScriptHandle(); |
|
46 | + |
|
47 | + |
|
48 | + /** |
|
49 | + * @since 4.9.71.p |
|
50 | + * @return string |
|
51 | + */ |
|
52 | + public function getStyleHandle(); |
|
53 | 53 | } |
54 | 54 | \ No newline at end of file |
@@ -24,46 +24,46 @@ |
||
24 | 24 | class RouteMatchSpecificationFactory extends FactoryWithDependencyResolver |
25 | 25 | { |
26 | 26 | |
27 | - /** |
|
28 | - * RouteMatchSpecificationFactory constructor |
|
29 | - * |
|
30 | - * @param RouteMatchSpecificationDependencyResolver $dependency_resolver |
|
31 | - * @param LoaderInterface $loader |
|
32 | - */ |
|
33 | - public function __construct(RouteMatchSpecificationDependencyResolver $dependency_resolver, LoaderInterface $loader) |
|
34 | - { |
|
35 | - parent::__construct($dependency_resolver, $loader); |
|
36 | - } |
|
27 | + /** |
|
28 | + * RouteMatchSpecificationFactory constructor |
|
29 | + * |
|
30 | + * @param RouteMatchSpecificationDependencyResolver $dependency_resolver |
|
31 | + * @param LoaderInterface $loader |
|
32 | + */ |
|
33 | + public function __construct(RouteMatchSpecificationDependencyResolver $dependency_resolver, LoaderInterface $loader) |
|
34 | + { |
|
35 | + parent::__construct($dependency_resolver, $loader); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param $fqcn |
|
40 | - * @return RouteMatchSpecification |
|
41 | - * @throws InvalidDataTypeException |
|
42 | - * @throws ReflectionException |
|
43 | - * @since 4.9.71.p |
|
44 | - */ |
|
45 | - public function createNewRouteMatchSpecification($fqcn) |
|
46 | - { |
|
47 | - $this->dependencyResolver()->resolveDependenciesForClass($fqcn); |
|
48 | - return $this->loader()->getShared($fqcn); |
|
49 | - } |
|
38 | + /** |
|
39 | + * @param $fqcn |
|
40 | + * @return RouteMatchSpecification |
|
41 | + * @throws InvalidDataTypeException |
|
42 | + * @throws ReflectionException |
|
43 | + * @since 4.9.71.p |
|
44 | + */ |
|
45 | + public function createNewRouteMatchSpecification($fqcn) |
|
46 | + { |
|
47 | + $this->dependencyResolver()->resolveDependenciesForClass($fqcn); |
|
48 | + return $this->loader()->getShared($fqcn); |
|
49 | + } |
|
50 | 50 | |
51 | 51 | |
52 | - /** |
|
53 | - * @param $fqcn |
|
54 | - * @return RouteMatchSpecification |
|
55 | - * @throws InvalidArgumentException |
|
56 | - * @throws InvalidDataTypeException |
|
57 | - * @throws InvalidInterfaceException |
|
58 | - * @throws ReflectionException |
|
59 | - * @since 4.9.71.p |
|
60 | - */ |
|
61 | - public static function create($fqcn) |
|
62 | - { |
|
63 | - /** @var RouteMatchSpecificationFactory $specification_factory */ |
|
64 | - $specification_factory = LoaderFactory::getLoader()->getShared( |
|
65 | - 'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' |
|
66 | - ); |
|
67 | - return $specification_factory->createNewRouteMatchSpecification($fqcn); |
|
68 | - } |
|
52 | + /** |
|
53 | + * @param $fqcn |
|
54 | + * @return RouteMatchSpecification |
|
55 | + * @throws InvalidArgumentException |
|
56 | + * @throws InvalidDataTypeException |
|
57 | + * @throws InvalidInterfaceException |
|
58 | + * @throws ReflectionException |
|
59 | + * @since 4.9.71.p |
|
60 | + */ |
|
61 | + public static function create($fqcn) |
|
62 | + { |
|
63 | + /** @var RouteMatchSpecificationFactory $specification_factory */ |
|
64 | + $specification_factory = LoaderFactory::getLoader()->getShared( |
|
65 | + 'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' |
|
66 | + ); |
|
67 | + return $specification_factory->createNewRouteMatchSpecification($fqcn); |
|
68 | + } |
|
69 | 69 | } |
@@ -22,20 +22,20 @@ |
||
22 | 22 | class RouteMatchSpecificationDependencyResolver extends DependencyResolver |
23 | 23 | { |
24 | 24 | |
25 | - /** |
|
26 | - * Used to configure and/or setup any aliases or namespace roots required by the DependencyResolver |
|
27 | - * |
|
28 | - * @since 4.9.71.p |
|
29 | - * @throws InvalidAliasException |
|
30 | - */ |
|
31 | - public function initialize() |
|
32 | - { |
|
33 | - $this->addAlias( |
|
34 | - new ClassAlias( |
|
35 | - 'EventEspresso\core\services\request\RequestInterface', |
|
36 | - 'EventEspresso\core\services\request\Request' |
|
37 | - ) |
|
38 | - ); |
|
39 | - $this->addNamespaceRoot('EventEspresso\core\domain\entities\route_match\specifications'); |
|
40 | - } |
|
25 | + /** |
|
26 | + * Used to configure and/or setup any aliases or namespace roots required by the DependencyResolver |
|
27 | + * |
|
28 | + * @since 4.9.71.p |
|
29 | + * @throws InvalidAliasException |
|
30 | + */ |
|
31 | + public function initialize() |
|
32 | + { |
|
33 | + $this->addAlias( |
|
34 | + new ClassAlias( |
|
35 | + 'EventEspresso\core\services\request\RequestInterface', |
|
36 | + 'EventEspresso\core\services\request\Request' |
|
37 | + ) |
|
38 | + ); |
|
39 | + $this->addNamespaceRoot('EventEspresso\core\domain\entities\route_match\specifications'); |
|
40 | + } |
|
41 | 41 | } |