@@ -13,14 +13,14 @@ |
||
13 | 13 | */ |
14 | 14 | interface RequiresDomainInterface |
15 | 15 | { |
16 | - /** |
|
17 | - * @param DomainInterface $domain |
|
18 | - */ |
|
19 | - public function setDomain(DomainInterface $domain); |
|
16 | + /** |
|
17 | + * @param DomainInterface $domain |
|
18 | + */ |
|
19 | + public function setDomain(DomainInterface $domain); |
|
20 | 20 | |
21 | 21 | |
22 | - /** |
|
23 | - * @return DomainInterface |
|
24 | - */ |
|
25 | - public function domain(); |
|
22 | + /** |
|
23 | + * @return DomainInterface |
|
24 | + */ |
|
25 | + public function domain(); |
|
26 | 26 | } |
@@ -14,8 +14,8 @@ |
||
14 | 14 | */ |
15 | 15 | interface RequiresRegistryInterface |
16 | 16 | { |
17 | - /** |
|
18 | - * @param EE_Registry $registry |
|
19 | - */ |
|
20 | - public function setRegistry($registry); |
|
17 | + /** |
|
18 | + * @param EE_Registry $registry |
|
19 | + */ |
|
20 | + public function setRegistry($registry); |
|
21 | 21 | } |
@@ -15,69 +15,69 @@ |
||
15 | 15 | */ |
16 | 16 | class GutenbergEditor extends AdminRoute |
17 | 17 | { |
18 | - /** |
|
19 | - * returns true if the current request matches this route |
|
20 | - * |
|
21 | - * @return bool |
|
22 | - */ |
|
23 | - public function matchesCurrentRequest(): bool |
|
24 | - { |
|
25 | - global $pagenow; |
|
26 | - return parent::matchesCurrentRequest() |
|
27 | - && $pagenow |
|
28 | - && ( |
|
29 | - $pagenow === 'post-new.php' |
|
30 | - || ( |
|
31 | - $pagenow === 'post.php' |
|
32 | - && $this->request->getRequestParam('action') === 'edit' |
|
33 | - ) |
|
34 | - ) |
|
35 | - && apply_filters('FHEE__EE_System__canLoadBlocks', true); |
|
36 | - } |
|
18 | + /** |
|
19 | + * returns true if the current request matches this route |
|
20 | + * |
|
21 | + * @return bool |
|
22 | + */ |
|
23 | + public function matchesCurrentRequest(): bool |
|
24 | + { |
|
25 | + global $pagenow; |
|
26 | + return parent::matchesCurrentRequest() |
|
27 | + && $pagenow |
|
28 | + && ( |
|
29 | + $pagenow === 'post-new.php' |
|
30 | + || ( |
|
31 | + $pagenow === 'post.php' |
|
32 | + && $this->request->getRequestParam('action') === 'edit' |
|
33 | + ) |
|
34 | + ) |
|
35 | + && apply_filters('FHEE__EE_System__canLoadBlocks', true); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | |
39 | - /** |
|
40 | - * @return void |
|
41 | - */ |
|
42 | - protected function registerDependencies() |
|
43 | - { |
|
44 | - $this->dependency_map->registerDependencies( |
|
45 | - 'EventEspresso\core\domain\entities\routing\data_nodes\domains\GutenbergEditorData', |
|
46 | - [ |
|
47 | - 'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache, |
|
48 | - ] |
|
49 | - ); |
|
50 | - $this->dependency_map->registerDependencies( |
|
51 | - 'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager', |
|
52 | - [ |
|
53 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
54 | - 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_new_object, |
|
55 | - 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
56 | - ] |
|
57 | - ); |
|
58 | - } |
|
39 | + /** |
|
40 | + * @return void |
|
41 | + */ |
|
42 | + protected function registerDependencies() |
|
43 | + { |
|
44 | + $this->dependency_map->registerDependencies( |
|
45 | + 'EventEspresso\core\domain\entities\routing\data_nodes\domains\GutenbergEditorData', |
|
46 | + [ |
|
47 | + 'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache, |
|
48 | + ] |
|
49 | + ); |
|
50 | + $this->dependency_map->registerDependencies( |
|
51 | + 'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager', |
|
52 | + [ |
|
53 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
54 | + 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_new_object, |
|
55 | + 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
56 | + ] |
|
57 | + ); |
|
58 | + } |
|
59 | 59 | |
60 | 60 | |
61 | - /** |
|
62 | - * @return string |
|
63 | - */ |
|
64 | - protected function dataNodeClass(): string |
|
65 | - { |
|
66 | - return GutenbergEditorData::class; |
|
67 | - } |
|
61 | + /** |
|
62 | + * @return string |
|
63 | + */ |
|
64 | + protected function dataNodeClass(): string |
|
65 | + { |
|
66 | + return GutenbergEditorData::class; |
|
67 | + } |
|
68 | 68 | |
69 | 69 | |
70 | - /** |
|
71 | - * implements logic required to run during request |
|
72 | - * |
|
73 | - * @return bool |
|
74 | - */ |
|
75 | - protected function requestHandler(): bool |
|
76 | - { |
|
77 | - $this->asset_manager = $this->loader->getShared( |
|
78 | - 'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' |
|
79 | - ); |
|
80 | - add_action('admin_enqueue_scripts', [$this->asset_manager, 'enqueueBrowserAssets'], 100); |
|
81 | - return true; |
|
82 | - } |
|
70 | + /** |
|
71 | + * implements logic required to run during request |
|
72 | + * |
|
73 | + * @return bool |
|
74 | + */ |
|
75 | + protected function requestHandler(): bool |
|
76 | + { |
|
77 | + $this->asset_manager = $this->loader->getShared( |
|
78 | + 'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' |
|
79 | + ); |
|
80 | + add_action('admin_enqueue_scripts', [$this->asset_manager, 'enqueueBrowserAssets'], 100); |
|
81 | + return true; |
|
82 | + } |
|
83 | 83 | } |
@@ -16,41 +16,41 @@ |
||
16 | 16 | */ |
17 | 17 | class SiteCurrency extends JsonDataNode |
18 | 18 | { |
19 | - const NODE_NAME = 'siteCurrency'; |
|
20 | - |
|
21 | - /** |
|
22 | - * @var EE_Currency_Config $currency_config |
|
23 | - */ |
|
24 | - protected $currency_config; |
|
25 | - |
|
26 | - |
|
27 | - /** |
|
28 | - * SiteCurrency constructor. |
|
29 | - * |
|
30 | - * @param EE_Currency_Config $currency_config |
|
31 | - * @param JsonDataNodeValidator $validator |
|
32 | - */ |
|
33 | - public function __construct(EE_Currency_Config $currency_config, JsonDataNodeValidator $validator) |
|
34 | - { |
|
35 | - parent::__construct($validator); |
|
36 | - $this->currency_config = $currency_config; |
|
37 | - $this->setNodeName(SiteCurrency::NODE_NAME); |
|
38 | - } |
|
39 | - |
|
40 | - |
|
41 | - /** |
|
42 | - * @inheritDoc |
|
43 | - */ |
|
44 | - public function initialize() |
|
45 | - { |
|
46 | - $this->addData('code', $this->currency_config->code); |
|
47 | - $this->addData('singularLabel', $this->currency_config->name); |
|
48 | - $this->addData('pluralLabel', $this->currency_config->plural); |
|
49 | - $this->addData('sign', $this->currency_config->sign); |
|
50 | - $this->addData('signB4', $this->currency_config->sign_b4); |
|
51 | - $this->addData('decimalPlaces', $this->currency_config->dec_plc); |
|
52 | - $this->addData('decimalMark', $this->currency_config->dec_mrk); |
|
53 | - $this->addData('thousandsSeparator', $this->currency_config->thsnds); |
|
54 | - $this->setInitialized(true); |
|
55 | - } |
|
19 | + const NODE_NAME = 'siteCurrency'; |
|
20 | + |
|
21 | + /** |
|
22 | + * @var EE_Currency_Config $currency_config |
|
23 | + */ |
|
24 | + protected $currency_config; |
|
25 | + |
|
26 | + |
|
27 | + /** |
|
28 | + * SiteCurrency constructor. |
|
29 | + * |
|
30 | + * @param EE_Currency_Config $currency_config |
|
31 | + * @param JsonDataNodeValidator $validator |
|
32 | + */ |
|
33 | + public function __construct(EE_Currency_Config $currency_config, JsonDataNodeValidator $validator) |
|
34 | + { |
|
35 | + parent::__construct($validator); |
|
36 | + $this->currency_config = $currency_config; |
|
37 | + $this->setNodeName(SiteCurrency::NODE_NAME); |
|
38 | + } |
|
39 | + |
|
40 | + |
|
41 | + /** |
|
42 | + * @inheritDoc |
|
43 | + */ |
|
44 | + public function initialize() |
|
45 | + { |
|
46 | + $this->addData('code', $this->currency_config->code); |
|
47 | + $this->addData('singularLabel', $this->currency_config->name); |
|
48 | + $this->addData('pluralLabel', $this->currency_config->plural); |
|
49 | + $this->addData('sign', $this->currency_config->sign); |
|
50 | + $this->addData('signB4', $this->currency_config->sign_b4); |
|
51 | + $this->addData('decimalPlaces', $this->currency_config->dec_plc); |
|
52 | + $this->addData('decimalMark', $this->currency_config->dec_mrk); |
|
53 | + $this->addData('thousandsSeparator', $this->currency_config->thsnds); |
|
54 | + $this->setInitialized(true); |
|
55 | + } |
|
56 | 56 | } |
@@ -15,37 +15,37 @@ |
||
15 | 15 | */ |
16 | 16 | class GeneralSettings extends JsonDataNode |
17 | 17 | { |
18 | - const NODE_NAME = 'generalSettings'; |
|
19 | - |
|
20 | - /** |
|
21 | - * @var PhpToUnicode $converter |
|
22 | - */ |
|
23 | - private $converter; |
|
24 | - |
|
25 | - |
|
26 | - /** |
|
27 | - * @param JsonDataNodeValidator $validator |
|
28 | - * @param PhpToUnicode $converter |
|
29 | - */ |
|
30 | - public function __construct(JsonDataNodeValidator $validator, PhpToUnicode $converter) |
|
31 | - { |
|
32 | - $this->converter = $converter; |
|
33 | - parent::__construct($validator); |
|
34 | - $this->setNodeName(GeneralSettings::NODE_NAME); |
|
35 | - } |
|
36 | - |
|
37 | - |
|
38 | - /** |
|
39 | - * @inheritDoc |
|
40 | - */ |
|
41 | - public function initialize() |
|
42 | - { |
|
43 | - $wpDateFormat = get_option('date_format'); |
|
44 | - $wpTimeFormat = get_option('time_format'); |
|
45 | - $this->addData('dateFormat', $this->converter->convertDateFormat($wpDateFormat)); |
|
46 | - $this->addData('timeFormat', $this->converter->convertTimeFormat($wpTimeFormat)); |
|
47 | - $this->addData('timezone', get_option('timezone_string')); |
|
48 | - $this->addData('__typename', 'GeneralSettings'); |
|
49 | - $this->setInitialized(true); |
|
50 | - } |
|
18 | + const NODE_NAME = 'generalSettings'; |
|
19 | + |
|
20 | + /** |
|
21 | + * @var PhpToUnicode $converter |
|
22 | + */ |
|
23 | + private $converter; |
|
24 | + |
|
25 | + |
|
26 | + /** |
|
27 | + * @param JsonDataNodeValidator $validator |
|
28 | + * @param PhpToUnicode $converter |
|
29 | + */ |
|
30 | + public function __construct(JsonDataNodeValidator $validator, PhpToUnicode $converter) |
|
31 | + { |
|
32 | + $this->converter = $converter; |
|
33 | + parent::__construct($validator); |
|
34 | + $this->setNodeName(GeneralSettings::NODE_NAME); |
|
35 | + } |
|
36 | + |
|
37 | + |
|
38 | + /** |
|
39 | + * @inheritDoc |
|
40 | + */ |
|
41 | + public function initialize() |
|
42 | + { |
|
43 | + $wpDateFormat = get_option('date_format'); |
|
44 | + $wpTimeFormat = get_option('time_format'); |
|
45 | + $this->addData('dateFormat', $this->converter->convertDateFormat($wpDateFormat)); |
|
46 | + $this->addData('timeFormat', $this->converter->convertTimeFormat($wpTimeFormat)); |
|
47 | + $this->addData('timezone', get_option('timezone_string')); |
|
48 | + $this->addData('__typename', 'GeneralSettings'); |
|
49 | + $this->setInitialized(true); |
|
50 | + } |
|
51 | 51 | } |
@@ -16,37 +16,37 @@ |
||
16 | 16 | */ |
17 | 17 | class WordPressPluginsPageData extends JsonDataNode |
18 | 18 | { |
19 | - const NODE_NAME = 'wpPluginsPage'; |
|
20 | - |
|
21 | - /** |
|
22 | - * @var ExitModal $exit_modal |
|
23 | - */ |
|
24 | - private $exit_modal; |
|
25 | - |
|
26 | - |
|
27 | - /** |
|
28 | - * WordPressPluginsPageData JsonDataNode constructor. |
|
29 | - * |
|
30 | - * @param ExitModal $exit_modal |
|
31 | - * @param JsonDataNodeValidator $validator |
|
32 | - */ |
|
33 | - public function __construct( |
|
34 | - ExitModal $exit_modal, |
|
35 | - JsonDataNodeValidator $validator |
|
36 | - ) { |
|
37 | - parent::__construct($validator); |
|
38 | - $this->exit_modal = $exit_modal; |
|
39 | - $this->setDomain(WordPressPluginsPageData::NODE_NAME); |
|
40 | - $this->setNodeName(WordPressPluginsPageData::NODE_NAME); |
|
41 | - } |
|
42 | - |
|
43 | - |
|
44 | - /** |
|
45 | - * @inheritDoc |
|
46 | - */ |
|
47 | - public function initialize() |
|
48 | - { |
|
49 | - $data = $this->exit_modal->getExitSurveyInfo(); |
|
50 | - $this->addData('eeExitSurveyInfo', $data); |
|
51 | - } |
|
19 | + const NODE_NAME = 'wpPluginsPage'; |
|
20 | + |
|
21 | + /** |
|
22 | + * @var ExitModal $exit_modal |
|
23 | + */ |
|
24 | + private $exit_modal; |
|
25 | + |
|
26 | + |
|
27 | + /** |
|
28 | + * WordPressPluginsPageData JsonDataNode constructor. |
|
29 | + * |
|
30 | + * @param ExitModal $exit_modal |
|
31 | + * @param JsonDataNodeValidator $validator |
|
32 | + */ |
|
33 | + public function __construct( |
|
34 | + ExitModal $exit_modal, |
|
35 | + JsonDataNodeValidator $validator |
|
36 | + ) { |
|
37 | + parent::__construct($validator); |
|
38 | + $this->exit_modal = $exit_modal; |
|
39 | + $this->setDomain(WordPressPluginsPageData::NODE_NAME); |
|
40 | + $this->setNodeName(WordPressPluginsPageData::NODE_NAME); |
|
41 | + } |
|
42 | + |
|
43 | + |
|
44 | + /** |
|
45 | + * @inheritDoc |
|
46 | + */ |
|
47 | + public function initialize() |
|
48 | + { |
|
49 | + $data = $this->exit_modal->getExitSurveyInfo(); |
|
50 | + $this->addData('eeExitSurveyInfo', $data); |
|
51 | + } |
|
52 | 52 | } |
@@ -14,27 +14,27 @@ |
||
14 | 14 | */ |
15 | 15 | class GutenbergEditorData extends JsonDataNode |
16 | 16 | { |
17 | - const NODE_NAME = 'blocks'; |
|
17 | + const NODE_NAME = 'blocks'; |
|
18 | 18 | |
19 | 19 | |
20 | - /** |
|
21 | - * WordPressPluginsPageData JsonDataNode constructor. |
|
22 | - * |
|
23 | - * @param JsonDataNodeValidator $validator |
|
24 | - */ |
|
25 | - public function __construct(JsonDataNodeValidator $validator) |
|
26 | - { |
|
27 | - parent::__construct($validator); |
|
28 | - $this->setDomain(GutenbergEditorData::NODE_NAME); |
|
29 | - $this->setNodeName(GutenbergEditorData::NODE_NAME); |
|
30 | - } |
|
20 | + /** |
|
21 | + * WordPressPluginsPageData JsonDataNode constructor. |
|
22 | + * |
|
23 | + * @param JsonDataNodeValidator $validator |
|
24 | + */ |
|
25 | + public function __construct(JsonDataNodeValidator $validator) |
|
26 | + { |
|
27 | + parent::__construct($validator); |
|
28 | + $this->setDomain(GutenbergEditorData::NODE_NAME); |
|
29 | + $this->setNodeName(GutenbergEditorData::NODE_NAME); |
|
30 | + } |
|
31 | 31 | |
32 | 32 | |
33 | - /** |
|
34 | - * @inheritDoc |
|
35 | - */ |
|
36 | - public function initialize() |
|
37 | - { |
|
38 | - $this->addData('BlockName', []); |
|
39 | - } |
|
33 | + /** |
|
34 | + * @inheritDoc |
|
35 | + */ |
|
36 | + public function initialize() |
|
37 | + { |
|
38 | + $this->addData('BlockName', []); |
|
39 | + } |
|
40 | 40 | } |
@@ -12,18 +12,18 @@ |
||
12 | 12 | */ |
13 | 13 | abstract class RouteMatchSpecificationDecorator implements RouteMatchSpecificationInterface |
14 | 14 | { |
15 | - /** |
|
16 | - * @var RouteMatchSpecificationInterface $specification |
|
17 | - */ |
|
18 | - protected $specification; |
|
15 | + /** |
|
16 | + * @var RouteMatchSpecificationInterface $specification |
|
17 | + */ |
|
18 | + protected $specification; |
|
19 | 19 | |
20 | - /** |
|
21 | - * RouteMatchSpecificationDecorator constructor. |
|
22 | - * |
|
23 | - * @param RouteMatchSpecificationInterface $specification |
|
24 | - */ |
|
25 | - public function __construct(RouteMatchSpecificationInterface $specification) |
|
26 | - { |
|
27 | - $this->specification = $specification; |
|
28 | - } |
|
20 | + /** |
|
21 | + * RouteMatchSpecificationDecorator constructor. |
|
22 | + * |
|
23 | + * @param RouteMatchSpecificationInterface $specification |
|
24 | + */ |
|
25 | + public function __construct(RouteMatchSpecificationInterface $specification) |
|
26 | + { |
|
27 | + $this->specification = $specification; |
|
28 | + } |
|
29 | 29 | } |
@@ -14,21 +14,21 @@ |
||
14 | 14 | */ |
15 | 15 | class EspressoStandardPostTypeEditor 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->getMatch('espresso_*') !== false |
|
29 | - && ( |
|
30 | - $this->request->getRequestParam('action') === 'edit' |
|
31 | - || $this->request->getRequestParam('action') === 'create_new' |
|
32 | - ); |
|
33 | - } |
|
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->getMatch('espresso_*') !== false |
|
29 | + && ( |
|
30 | + $this->request->getRequestParam('action') === 'edit' |
|
31 | + || $this->request->getRequestParam('action') === 'create_new' |
|
32 | + ); |
|
33 | + } |
|
34 | 34 | } |