Completed
Branch master (87d3f3)
by
unknown
03:30
created
core/domain/entities/routing/handlers/frontend/FrontendRequests.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -14,47 +14,47 @@
 block discarded – undo
14 14
  */
15 15
 class FrontendRequests extends PublicRoute
16 16
 {
17
-    /**
18
-     * returns true if the current request matches this route
19
-     * child classes can override and use Request directly to match route with request
20
-     * or supply a RouteMatchSpecification class and just use the below
21
-     *
22
-     * @return bool
23
-     * @since   $VID:$
24
-     */
25
-    public function matchesCurrentRequest(): bool
26
-    {
27
-        return ($this->request->isFrontend() || $this->request->isFrontAjax() || $this->request->isIframe())
28
-               && ! $this->maintenance_mode->level();
29
-    }
17
+	/**
18
+	 * returns true if the current request matches this route
19
+	 * child classes can override and use Request directly to match route with request
20
+	 * or supply a RouteMatchSpecification class and just use the below
21
+	 *
22
+	 * @return bool
23
+	 * @since   $VID:$
24
+	 */
25
+	public function matchesCurrentRequest(): bool
26
+	{
27
+		return ($this->request->isFrontend() || $this->request->isFrontAjax() || $this->request->isIframe())
28
+			   && ! $this->maintenance_mode->level();
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @since $VID:$
34
-     */
35
-    protected function registerDependencies()
36
-    {
37
-        $this->dependency_map->registerDependencies(
38
-            'EE_Front_Controller',
39
-            [
40
-                'EE_Registry'                                     => EE_Dependency_Map::load_from_cache,
41
-                'EventEspresso\core\services\request\CurrentPage' => EE_Dependency_Map::load_from_cache,
42
-                'EE_Module_Request_Router'                        => EE_Dependency_Map::load_from_cache,
43
-            ]
44
-        );
45
-    }
32
+	/**
33
+	 * @since $VID:$
34
+	 */
35
+	protected function registerDependencies()
36
+	{
37
+		$this->dependency_map->registerDependencies(
38
+			'EE_Front_Controller',
39
+			[
40
+				'EE_Registry'                                     => EE_Dependency_Map::load_from_cache,
41
+				'EventEspresso\core\services\request\CurrentPage' => EE_Dependency_Map::load_from_cache,
42
+				'EE_Module_Request_Router'                        => EE_Dependency_Map::load_from_cache,
43
+			]
44
+		);
45
+	}
46 46
 
47 47
 
48
-    /**
49
-     * implements logic required to run during request
50
-     *
51
-     * @return bool
52
-     * @since   $VID:$
53
-     */
54
-    protected function requestHandler(): bool
55
-    {
56
-        do_action('AHEE__EE_System__load_controllers__load_front_controllers');
57
-        $this->loader->getShared('EE_Front_Controller');
58
-        return true;
59
-    }
48
+	/**
49
+	 * implements logic required to run during request
50
+	 *
51
+	 * @return bool
52
+	 * @since   $VID:$
53
+	 */
54
+	protected function requestHandler(): bool
55
+	{
56
+		do_action('AHEE__EE_System__load_controllers__load_front_controllers');
57
+		$this->loader->getShared('EE_Front_Controller');
58
+		return true;
59
+	}
60 60
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/handlers/frontend/ShortcodeRequests.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -16,72 +16,72 @@
 block discarded – undo
16 16
  */
17 17
 class ShortcodeRequests extends Route
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(): bool
28
-    {
29
-        return $this->request->isFrontend() || $this->request->isIframe() || $this->request->isAjax();
30
-    }
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(): bool
28
+	{
29
+		return $this->request->isFrontend() || $this->request->isIframe() || $this->request->isAjax();
30
+	}
31 31
 
32 32
 
33
-    /**
34
-     * @since $VID:$
35
-     */
36
-    protected function registerDependencies()
37
-    {
38
-        $this->dependency_map->registerDependencies(
39
-            'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled',
40
-            ['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
41
-        );
42
-        $this->dependency_map->registerDependencies(
43
-            'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout',
44
-            ['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
45
-        );
46
-        $this->dependency_map->registerDependencies(
47
-            'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees',
48
-            ['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
49
-        );
50
-        $this->dependency_map->registerDependencies(
51
-            'EventEspresso\core\domain\entities\shortcodes\EspressoEvents',
52
-            ['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
53
-        );
54
-        $this->dependency_map->registerDependencies(
55
-            'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou',
56
-            ['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
57
-        );
58
-        $this->dependency_map->registerDependencies(
59
-            'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector',
60
-            ['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
61
-        );
62
-        $this->dependency_map->registerDependencies(
63
-            'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage',
64
-            ['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
65
-        );
66
-    }
33
+	/**
34
+	 * @since $VID:$
35
+	 */
36
+	protected function registerDependencies()
37
+	{
38
+		$this->dependency_map->registerDependencies(
39
+			'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled',
40
+			['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
41
+		);
42
+		$this->dependency_map->registerDependencies(
43
+			'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout',
44
+			['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
45
+		);
46
+		$this->dependency_map->registerDependencies(
47
+			'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees',
48
+			['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
49
+		);
50
+		$this->dependency_map->registerDependencies(
51
+			'EventEspresso\core\domain\entities\shortcodes\EspressoEvents',
52
+			['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
53
+		);
54
+		$this->dependency_map->registerDependencies(
55
+			'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou',
56
+			['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
57
+		);
58
+		$this->dependency_map->registerDependencies(
59
+			'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector',
60
+			['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
61
+		);
62
+		$this->dependency_map->registerDependencies(
63
+			'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage',
64
+			['EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache]
65
+		);
66
+	}
67 67
 
68 68
 
69
-    /**
70
-     * implements logic required to run during request
71
-     *
72
-     * @return bool
73
-     * @since   $VID:$
74
-     */
75
-    protected function requestHandler(): bool
76
-    {
77
-        // load, register, and add shortcodes the new way
78
-        $this->loader->getShared(
79
-            'EventEspresso\core\services\shortcodes\ShortcodesManager',
80
-            [
81
-                // and the old way, but we'll put it under control of the new system
82
-                EE_Config::getLegacyShortcodesManager(),
83
-            ]
84
-        );
85
-        return true;
86
-    }
69
+	/**
70
+	 * implements logic required to run during request
71
+	 *
72
+	 * @return bool
73
+	 * @since   $VID:$
74
+	 */
75
+	protected function requestHandler(): bool
76
+	{
77
+		// load, register, and add shortcodes the new way
78
+		$this->loader->getShared(
79
+			'EventEspresso\core\services\shortcodes\ShortcodesManager',
80
+			[
81
+				// and the old way, but we'll put it under control of the new system
82
+				EE_Config::getLegacyShortcodesManager(),
83
+			]
84
+		);
85
+		return true;
86
+	}
87 87
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/data_nodes/core/Config.php 1 patch
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -16,92 +16,92 @@
 block discarded – undo
16 16
  */
17 17
 class Config extends JsonDataNode
18 18
 {
19
-    const NODE_NAME = 'config';
19
+	const NODE_NAME = 'config';
20 20
 
21
-    /**
22
-     * @var CurrentUser $current_user
23
-     */
24
-    private $current_user;
21
+	/**
22
+	 * @var CurrentUser $current_user
23
+	 */
24
+	private $current_user;
25 25
 
26
-    /**
27
-     * @var EspressoCoreDomain $core_domain
28
-     */
29
-    private $core_domain;
26
+	/**
27
+	 * @var EspressoCoreDomain $core_domain
28
+	 */
29
+	private $core_domain;
30 30
 
31
-    /**
32
-     * @var GeneralSettings $general_settings
33
-     */
34
-    private $general_settings;
31
+	/**
32
+	 * @var GeneralSettings $general_settings
33
+	 */
34
+	private $general_settings;
35 35
 
36
-    /**
37
-     * @var Locale $locale
38
-     */
39
-    private $locale;
36
+	/**
37
+	 * @var Locale $locale
38
+	 */
39
+	private $locale;
40 40
 
41
-    /**
42
-     * @var SiteCurrency $site_currency
43
-     */
44
-    private $site_currency;
41
+	/**
42
+	 * @var SiteCurrency $site_currency
43
+	 */
44
+	private $site_currency;
45 45
 
46
-    /**
47
-     * @var SitePermissions $site_permissions
48
-     */
49
-    private $site_permissions;
46
+	/**
47
+	 * @var SitePermissions $site_permissions
48
+	 */
49
+	private $site_permissions;
50 50
 
51
-    /**
52
-     * @var SiteUrls $site_urls
53
-     */
54
-    private $site_urls;
51
+	/**
52
+	 * @var SiteUrls $site_urls
53
+	 */
54
+	private $site_urls;
55 55
 
56 56
 
57
-    /**
58
-     * JsonDataNode constructor.
59
-     *
60
-     * @param CurrentUser        $current_user
61
-     * @param EspressoCoreDomain $core_domain
62
-     * @param GeneralSettings    $general_settings
63
-     * @param Locale $locale
64
-     * @param SiteCurrency $site_currency
65
-     * @param SitePermissions $site_permissions
66
-     * @param SiteUrls $site_urls
67
-     * @param JsonDataNodeValidator $validator
68
-     */
69
-    public function __construct(
70
-        CurrentUser $current_user,
71
-        EspressoCoreDomain $core_domain,
72
-        GeneralSettings $general_settings,
73
-        Locale $locale,
74
-        SiteCurrency $site_currency,
75
-        SitePermissions $site_permissions,
76
-        SiteUrls $site_urls,
77
-        JsonDataNodeValidator $validator
78
-    ) {
79
-        parent::__construct($validator);
80
-        $this->current_user = $current_user;
81
-        $this->core_domain = $core_domain;
82
-        $this->general_settings = $general_settings;
83
-        $this->locale = $locale;
84
-        $this->site_currency = $site_currency;
85
-        $this->site_permissions = $site_permissions;
86
-        $this->site_urls = $site_urls;
87
-        $this->setNodeName(Config::NODE_NAME);
88
-    }
57
+	/**
58
+	 * JsonDataNode constructor.
59
+	 *
60
+	 * @param CurrentUser        $current_user
61
+	 * @param EspressoCoreDomain $core_domain
62
+	 * @param GeneralSettings    $general_settings
63
+	 * @param Locale $locale
64
+	 * @param SiteCurrency $site_currency
65
+	 * @param SitePermissions $site_permissions
66
+	 * @param SiteUrls $site_urls
67
+	 * @param JsonDataNodeValidator $validator
68
+	 */
69
+	public function __construct(
70
+		CurrentUser $current_user,
71
+		EspressoCoreDomain $core_domain,
72
+		GeneralSettings $general_settings,
73
+		Locale $locale,
74
+		SiteCurrency $site_currency,
75
+		SitePermissions $site_permissions,
76
+		SiteUrls $site_urls,
77
+		JsonDataNodeValidator $validator
78
+	) {
79
+		parent::__construct($validator);
80
+		$this->current_user = $current_user;
81
+		$this->core_domain = $core_domain;
82
+		$this->general_settings = $general_settings;
83
+		$this->locale = $locale;
84
+		$this->site_currency = $site_currency;
85
+		$this->site_permissions = $site_permissions;
86
+		$this->site_urls = $site_urls;
87
+		$this->setNodeName(Config::NODE_NAME);
88
+	}
89 89
 
90 90
 
91
-    /**
92
-     * @throws DomainException
93
-     * @since $VID:$
94
-     */
95
-    public function initialize()
96
-    {
97
-        $this->addDataNode($this->core_domain);
98
-        $this->addDataNode($this->current_user);
99
-        $this->addDataNode($this->general_settings);
100
-        $this->addDataNode($this->locale);
101
-        $this->addDataNode($this->site_currency);
102
-        $this->addDataNode($this->site_permissions);
103
-        $this->addDataNode($this->site_urls);
104
-        $this->addData('wp_debug', WP_DEBUG);
105
-        $this->setInitialized(true);
106
-    }
91
+	/**
92
+	 * @throws DomainException
93
+	 * @since $VID:$
94
+	 */
95
+	public function initialize()
96
+	{
97
+		$this->addDataNode($this->core_domain);
98
+		$this->addDataNode($this->current_user);
99
+		$this->addDataNode($this->general_settings);
100
+		$this->addDataNode($this->locale);
101
+		$this->addDataNode($this->site_currency);
102
+		$this->addDataNode($this->site_permissions);
103
+		$this->addDataNode($this->site_urls);
104
+		$this->addData('wp_debug', WP_DEBUG);
105
+		$this->setInitialized(true);
106
+	}
107 107
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/data_nodes/core/SiteUrls.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -15,26 +15,26 @@
 block discarded – undo
15 15
  */
16 16
 class SiteUrls extends JsonDataNode
17 17
 {
18
-    const NODE_NAME = 'siteUrls';
18
+	const NODE_NAME = 'siteUrls';
19 19
 
20 20
 
21
-    /**
22
-     * @param JsonDataNodeValidator $validator
23
-     */
24
-    public function __construct(JsonDataNodeValidator $validator)
25
-    {
26
-        parent::__construct($validator);
27
-        $this->setNodeName(SiteUrls::NODE_NAME);
28
-    }
21
+	/**
22
+	 * @param JsonDataNodeValidator $validator
23
+	 */
24
+	public function __construct(JsonDataNodeValidator $validator)
25
+	{
26
+		parent::__construct($validator);
27
+		$this->setNodeName(SiteUrls::NODE_NAME);
28
+	}
29 29
 
30 30
 
31
-    /**
32
-     * @since $VID:$
33
-     */
34
-    public function initialize()
35
-    {
36
-        $this->addData('admin', admin_url('/'));
37
-        $this->addData('home', site_url('/'));
38
-        $this->setInitialized(true);
39
-    }
31
+	/**
32
+	 * @since $VID:$
33
+	 */
34
+	public function initialize()
35
+	{
36
+		$this->addData('admin', admin_url('/'));
37
+		$this->addData('home', site_url('/'));
38
+		$this->setInitialized(true);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/data_nodes/EventEspressoData.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -20,49 +20,49 @@
 block discarded – undo
20 20
  */
21 21
 class EventEspressoData extends PrimaryJsonDataNode
22 22
 {
23
-    const NODE_NAME = 'eventEspressoData';
23
+	const NODE_NAME = 'eventEspressoData';
24 24
 
25
-    /**
26
-     * @var Api $api
27
-     */
28
-    private $api;
25
+	/**
26
+	 * @var Api $api
27
+	 */
28
+	private $api;
29 29
 
30
-    /**
31
-     * @var Config $config
32
-     */
33
-    private $config;
30
+	/**
31
+	 * @var Config $config
32
+	 */
33
+	private $config;
34 34
 
35
-    /**
36
-     * @var JedLocaleData $jed_locale
37
-     */
38
-    private $jed_locale;
35
+	/**
36
+	 * @var JedLocaleData $jed_locale
37
+	 */
38
+	private $jed_locale;
39 39
 
40 40
 
41
-    /**
42
-     * @param Api $api
43
-     * @param Config $config
44
-     * @param JedLocaleData         $jed_locale
45
-     * @param JsonDataNodeValidator $validator
46
-     */
47
-    public function __construct(Api $api, Config $config, JedLocaleData $jed_locale, JsonDataNodeValidator $validator)
48
-    {
49
-        parent::__construct($validator);
50
-        $this->api = $api;
51
-        $this->config = $config;
52
-        $this->jed_locale = $jed_locale;
53
-        $this->setNodeName(EventEspressoData::NODE_NAME);
54
-    }
41
+	/**
42
+	 * @param Api $api
43
+	 * @param Config $config
44
+	 * @param JedLocaleData         $jed_locale
45
+	 * @param JsonDataNodeValidator $validator
46
+	 */
47
+	public function __construct(Api $api, Config $config, JedLocaleData $jed_locale, JsonDataNodeValidator $validator)
48
+	{
49
+		parent::__construct($validator);
50
+		$this->api = $api;
51
+		$this->config = $config;
52
+		$this->jed_locale = $jed_locale;
53
+		$this->setNodeName(EventEspressoData::NODE_NAME);
54
+	}
55 55
 
56 56
 
57
-    /**
58
-     * @throws DomainException
59
-     * @since $VID:$
60
-     */
61
-    public function initialize()
62
-    {
63
-        $this->addDataNode($this->api);
64
-        $this->addDataNode($this->config);
65
-        $this->addData('i18n', $this->jed_locale->getData(Domain::TEXT_DOMAIN));
66
-        $this->setInitialized(true);
67
-    }
57
+	/**
58
+	 * @throws DomainException
59
+	 * @since $VID:$
60
+	 */
61
+	public function initialize()
62
+	{
63
+		$this->addDataNode($this->api);
64
+		$this->addDataNode($this->config);
65
+		$this->addData('i18n', $this->jed_locale->getData(Domain::TEXT_DOMAIN));
66
+		$this->setInitialized(true);
67
+	}
68 68
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/data_nodes/domains/EventEditor.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -19,51 +19,51 @@
 block discarded – undo
19 19
  */
20 20
 class EventEditor extends JsonDataNode
21 21
 {
22
-    const NODE_NAME = 'eventEditor';
22
+	const NODE_NAME = 'eventEditor';
23 23
 
24 24
 
25
-    /**
26
-     * @var EventEditorGraphQLData
27
-     */
28
-    protected $event_editor_gql_data;
25
+	/**
26
+	 * @var EventEditorGraphQLData
27
+	 */
28
+	protected $event_editor_gql_data;
29 29
 
30 30
 
31
-    /**
32
-     * EventEditor JsonDataNode constructor.
33
-     *
34
-     * @param EventEditorGraphQLData $event_editor_gql_data
35
-     * @param JsonDataNodeValidator  $validator
36
-     */
37
-    public function __construct(
38
-        EventEditorGraphQLData $event_editor_gql_data,
39
-        JsonDataNodeValidator $validator
40
-    ) {
41
-        parent::__construct($validator);
42
-        $this->event_editor_gql_data = $event_editor_gql_data;
43
-        $this->setDomain(EventEditor::NODE_NAME);
44
-        $this->setNodeName(EventEditor::NODE_NAME);
45
-    }
31
+	/**
32
+	 * EventEditor JsonDataNode constructor.
33
+	 *
34
+	 * @param EventEditorGraphQLData $event_editor_gql_data
35
+	 * @param JsonDataNodeValidator  $validator
36
+	 */
37
+	public function __construct(
38
+		EventEditorGraphQLData $event_editor_gql_data,
39
+		JsonDataNodeValidator $validator
40
+	) {
41
+		parent::__construct($validator);
42
+		$this->event_editor_gql_data = $event_editor_gql_data;
43
+		$this->setDomain(EventEditor::NODE_NAME);
44
+		$this->setNodeName(EventEditor::NODE_NAME);
45
+	}
46 46
 
47 47
 
48
-    /**
49
-     * @throws EE_Error
50
-     * @throws ReflectionException
51
-     * @since $VID:$
52
-     */
53
-    public function initialize()
54
-    {
55
-        global $post;
56
-        $eventId = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : 0;
57
-        // if there's no event ID but there IS a WP Post... then use the Post ID
58
-        $use_post_id = $eventId === 0 && $post instanceof WP_Post && $post->post_type === 'espresso_events';
59
-        $eventId = $use_post_id ? $post->ID : $eventId;
60
-        $related_data = apply_filters(
61
-            'FHEE__EventEspresso_core_domain_entities_routing_data_nodes_domains_EventEditor__initialize__related_data',
62
-            $this->event_editor_gql_data->getData($eventId),
63
-            $eventId
64
-        );
65
-        foreach ($related_data as $key => $value) {
66
-            $this->addData($key, $value);
67
-        }
68
-    }
48
+	/**
49
+	 * @throws EE_Error
50
+	 * @throws ReflectionException
51
+	 * @since $VID:$
52
+	 */
53
+	public function initialize()
54
+	{
55
+		global $post;
56
+		$eventId = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : 0;
57
+		// if there's no event ID but there IS a WP Post... then use the Post ID
58
+		$use_post_id = $eventId === 0 && $post instanceof WP_Post && $post->post_type === 'espresso_events';
59
+		$eventId = $use_post_id ? $post->ID : $eventId;
60
+		$related_data = apply_filters(
61
+			'FHEE__EventEspresso_core_domain_entities_routing_data_nodes_domains_EventEditor__initialize__related_data',
62
+			$this->event_editor_gql_data->getData($eventId),
63
+			$eventId
64
+		);
65
+		foreach ($related_data as $key => $value) {
66
+			$this->addData($key, $value);
67
+		}
68
+	}
69 69
 }
Please login to merge, or discard this patch.
core/domain/DomainBase.php 1 patch
Indentation   +227 added lines, -227 removed lines patch added patch discarded remove patch
@@ -16,231 +16,231 @@
 block discarded – undo
16 16
  */
17 17
 abstract class DomainBase implements DomainInterface
18 18
 {
19
-    const ASSETS_FOLDER = 'assets/';
20
-
21
-    /**
22
-     * Equivalent to `__FILE__` for main plugin file.
23
-     *
24
-     * @var FilePath
25
-     */
26
-    private $plugin_file;
27
-
28
-    /**
29
-     * String indicating version for plugin
30
-     *
31
-     * @var string
32
-     */
33
-    private $version;
34
-
35
-    /**
36
-     * @var string $plugin_basename
37
-     */
38
-    private $plugin_basename;
39
-
40
-    /**
41
-     * @var string $plugin_path
42
-     */
43
-    private $plugin_path;
44
-
45
-    /**
46
-     * @var string $plugin_url
47
-     */
48
-    private $plugin_url;
49
-
50
-    /**
51
-     * @var string $asset_namespace
52
-     */
53
-    private $asset_namespace;
54
-
55
-    /**
56
-     * @var string $assets_path
57
-     */
58
-    private $assets_path;
59
-
60
-    /**
61
-     * @var bool
62
-     */
63
-    protected $initialized = false;
64
-
65
-
66
-    /**
67
-     * Initializes internal properties.
68
-     *
69
-     * @param FilePath $plugin_file
70
-     * @param Version  $version
71
-     * @param string $asset_namespace
72
-     */
73
-    public function __construct(
74
-        FilePath $plugin_file,
75
-        Version $version,
76
-        string $asset_namespace = Domain::ASSET_NAMESPACE
77
-    ) {
78
-        $this->plugin_file = $plugin_file;
79
-        $this->version     = $version;
80
-        $this->initialize($asset_namespace);
81
-    }
82
-
83
-
84
-    /**
85
-     * @param string $asset_namespace
86
-     * @return void
87
-     * @since $VID:$
88
-     */
89
-    public function initialize($asset_namespace = Domain::ASSET_NAMESPACE)
90
-    {
91
-        if (! $this->initialized) {
92
-            $this->plugin_basename = plugin_basename($this->pluginFile());
93
-            $this->plugin_path     = plugin_dir_path($this->pluginFile());
94
-            $this->plugin_url      = plugin_dir_url($this->pluginFile());
95
-            $this->setAssetNamespace($asset_namespace);
96
-            $this->setDistributionAssetsPath();
97
-            $this->initialized = true;
98
-        }
99
-    }
100
-
101
-
102
-    /**
103
-     * @param string $asset_namespace
104
-     * @return void
105
-     */
106
-    public function setAssetNamespace($asset_namespace = Domain::ASSET_NAMESPACE)
107
-    {
108
-        if (! $this->asset_namespace) {
109
-            $this->asset_namespace = sanitize_key(
110
-                // convert directory separators to dashes and remove file extension
111
-                str_replace(['/', '.php'], ['-', ''], $asset_namespace)
112
-            );
113
-        }
114
-    }
115
-
116
-
117
-    /**
118
-     * @throws DomainException
119
-     * @since $VID:$
120
-     */
121
-    private function setDistributionAssetsPath()
122
-    {
123
-        $assets_folder_paths = [
124
-            $this->plugin_path . DomainBase::ASSETS_FOLDER,
125
-            $this->plugin_path . 'src/' . DomainBase::ASSETS_FOLDER,
126
-        ];
127
-        foreach ($assets_folder_paths as $assets_folder_path) {
128
-            if (is_readable($assets_folder_path)) {
129
-                $this->assets_path = trailingslashit($assets_folder_path);
130
-                // once we find a valid path, just break out of loop
131
-                break;
132
-            }
133
-        }
134
-    }
135
-
136
-
137
-    /**
138
-     * @return string
139
-     */
140
-    public function pluginFile(): string
141
-    {
142
-        return (string) $this->plugin_file;
143
-    }
144
-
145
-
146
-    /**
147
-     * @return FilePath
148
-     */
149
-    public function pluginFileObject(): FilePath
150
-    {
151
-        return $this->plugin_file;
152
-    }
153
-
154
-
155
-    /**
156
-     * @return string
157
-     */
158
-    public function pluginBasename(): string
159
-    {
160
-        return $this->plugin_basename;
161
-    }
162
-
163
-
164
-    /**
165
-     * @param string $additional_path
166
-     * @return string
167
-     */
168
-    public function pluginPath($additional_path = ''): string
169
-    {
170
-        return is_string($additional_path) && $additional_path !== ''
171
-            ? $this->plugin_path . $additional_path
172
-            : $this->plugin_path;
173
-    }
174
-
175
-
176
-    /**
177
-     * @param string $additional_path
178
-     * @return string
179
-     */
180
-    public function pluginUrl($additional_path = ''): string
181
-    {
182
-        return is_string($additional_path) && $additional_path !== ''
183
-            ? $this->plugin_url . $additional_path
184
-            : $this->plugin_url;
185
-    }
186
-
187
-
188
-    /**
189
-     * @return string
190
-     */
191
-    public function version(): string
192
-    {
193
-        return (string) $this->version;
194
-    }
195
-
196
-
197
-    /**
198
-     * @return Version
199
-     */
200
-    public function versionValueObject()
201
-    {
202
-        return $this->version;
203
-    }
204
-
205
-
206
-    /**
207
-     * @return string
208
-     */
209
-    public function distributionAssetsFolder(): string
210
-    {
211
-        return DomainBase::ASSETS_FOLDER;
212
-    }
213
-
214
-
215
-    /**
216
-     * @param string $additional_path
217
-     * @return string
218
-     */
219
-    public function distributionAssetsPath($additional_path = ''): string
220
-    {
221
-        return is_string($additional_path) && $additional_path !== ''
222
-            ? $this->assets_path . $additional_path
223
-            : $this->assets_path;
224
-    }
225
-
226
-
227
-    /**
228
-     * @param string $additional_path
229
-     * @return string
230
-     */
231
-    public function distributionAssetsUrl($additional_path = ''): string
232
-    {
233
-        return is_string($additional_path) && $additional_path !== ''
234
-            ? $this->plugin_url . DomainBase::ASSETS_FOLDER . $additional_path
235
-            : $this->plugin_url . DomainBase::ASSETS_FOLDER;
236
-    }
237
-
238
-
239
-    /**
240
-     * @return string
241
-     */
242
-    public function assetNamespace(): string
243
-    {
244
-        return $this->asset_namespace;
245
-    }
19
+	const ASSETS_FOLDER = 'assets/';
20
+
21
+	/**
22
+	 * Equivalent to `__FILE__` for main plugin file.
23
+	 *
24
+	 * @var FilePath
25
+	 */
26
+	private $plugin_file;
27
+
28
+	/**
29
+	 * String indicating version for plugin
30
+	 *
31
+	 * @var string
32
+	 */
33
+	private $version;
34
+
35
+	/**
36
+	 * @var string $plugin_basename
37
+	 */
38
+	private $plugin_basename;
39
+
40
+	/**
41
+	 * @var string $plugin_path
42
+	 */
43
+	private $plugin_path;
44
+
45
+	/**
46
+	 * @var string $plugin_url
47
+	 */
48
+	private $plugin_url;
49
+
50
+	/**
51
+	 * @var string $asset_namespace
52
+	 */
53
+	private $asset_namespace;
54
+
55
+	/**
56
+	 * @var string $assets_path
57
+	 */
58
+	private $assets_path;
59
+
60
+	/**
61
+	 * @var bool
62
+	 */
63
+	protected $initialized = false;
64
+
65
+
66
+	/**
67
+	 * Initializes internal properties.
68
+	 *
69
+	 * @param FilePath $plugin_file
70
+	 * @param Version  $version
71
+	 * @param string $asset_namespace
72
+	 */
73
+	public function __construct(
74
+		FilePath $plugin_file,
75
+		Version $version,
76
+		string $asset_namespace = Domain::ASSET_NAMESPACE
77
+	) {
78
+		$this->plugin_file = $plugin_file;
79
+		$this->version     = $version;
80
+		$this->initialize($asset_namespace);
81
+	}
82
+
83
+
84
+	/**
85
+	 * @param string $asset_namespace
86
+	 * @return void
87
+	 * @since $VID:$
88
+	 */
89
+	public function initialize($asset_namespace = Domain::ASSET_NAMESPACE)
90
+	{
91
+		if (! $this->initialized) {
92
+			$this->plugin_basename = plugin_basename($this->pluginFile());
93
+			$this->plugin_path     = plugin_dir_path($this->pluginFile());
94
+			$this->plugin_url      = plugin_dir_url($this->pluginFile());
95
+			$this->setAssetNamespace($asset_namespace);
96
+			$this->setDistributionAssetsPath();
97
+			$this->initialized = true;
98
+		}
99
+	}
100
+
101
+
102
+	/**
103
+	 * @param string $asset_namespace
104
+	 * @return void
105
+	 */
106
+	public function setAssetNamespace($asset_namespace = Domain::ASSET_NAMESPACE)
107
+	{
108
+		if (! $this->asset_namespace) {
109
+			$this->asset_namespace = sanitize_key(
110
+				// convert directory separators to dashes and remove file extension
111
+				str_replace(['/', '.php'], ['-', ''], $asset_namespace)
112
+			);
113
+		}
114
+	}
115
+
116
+
117
+	/**
118
+	 * @throws DomainException
119
+	 * @since $VID:$
120
+	 */
121
+	private function setDistributionAssetsPath()
122
+	{
123
+		$assets_folder_paths = [
124
+			$this->plugin_path . DomainBase::ASSETS_FOLDER,
125
+			$this->plugin_path . 'src/' . DomainBase::ASSETS_FOLDER,
126
+		];
127
+		foreach ($assets_folder_paths as $assets_folder_path) {
128
+			if (is_readable($assets_folder_path)) {
129
+				$this->assets_path = trailingslashit($assets_folder_path);
130
+				// once we find a valid path, just break out of loop
131
+				break;
132
+			}
133
+		}
134
+	}
135
+
136
+
137
+	/**
138
+	 * @return string
139
+	 */
140
+	public function pluginFile(): string
141
+	{
142
+		return (string) $this->plugin_file;
143
+	}
144
+
145
+
146
+	/**
147
+	 * @return FilePath
148
+	 */
149
+	public function pluginFileObject(): FilePath
150
+	{
151
+		return $this->plugin_file;
152
+	}
153
+
154
+
155
+	/**
156
+	 * @return string
157
+	 */
158
+	public function pluginBasename(): string
159
+	{
160
+		return $this->plugin_basename;
161
+	}
162
+
163
+
164
+	/**
165
+	 * @param string $additional_path
166
+	 * @return string
167
+	 */
168
+	public function pluginPath($additional_path = ''): string
169
+	{
170
+		return is_string($additional_path) && $additional_path !== ''
171
+			? $this->plugin_path . $additional_path
172
+			: $this->plugin_path;
173
+	}
174
+
175
+
176
+	/**
177
+	 * @param string $additional_path
178
+	 * @return string
179
+	 */
180
+	public function pluginUrl($additional_path = ''): string
181
+	{
182
+		return is_string($additional_path) && $additional_path !== ''
183
+			? $this->plugin_url . $additional_path
184
+			: $this->plugin_url;
185
+	}
186
+
187
+
188
+	/**
189
+	 * @return string
190
+	 */
191
+	public function version(): string
192
+	{
193
+		return (string) $this->version;
194
+	}
195
+
196
+
197
+	/**
198
+	 * @return Version
199
+	 */
200
+	public function versionValueObject()
201
+	{
202
+		return $this->version;
203
+	}
204
+
205
+
206
+	/**
207
+	 * @return string
208
+	 */
209
+	public function distributionAssetsFolder(): string
210
+	{
211
+		return DomainBase::ASSETS_FOLDER;
212
+	}
213
+
214
+
215
+	/**
216
+	 * @param string $additional_path
217
+	 * @return string
218
+	 */
219
+	public function distributionAssetsPath($additional_path = ''): string
220
+	{
221
+		return is_string($additional_path) && $additional_path !== ''
222
+			? $this->assets_path . $additional_path
223
+			: $this->assets_path;
224
+	}
225
+
226
+
227
+	/**
228
+	 * @param string $additional_path
229
+	 * @return string
230
+	 */
231
+	public function distributionAssetsUrl($additional_path = ''): string
232
+	{
233
+		return is_string($additional_path) && $additional_path !== ''
234
+			? $this->plugin_url . DomainBase::ASSETS_FOLDER . $additional_path
235
+			: $this->plugin_url . DomainBase::ASSETS_FOLDER;
236
+	}
237
+
238
+
239
+	/**
240
+	 * @return string
241
+	 */
242
+	public function assetNamespace(): string
243
+	{
244
+		return $this->asset_namespace;
245
+	}
246 246
 }
Please login to merge, or discard this patch.
core/domain/services/admin/entities/DefaultEntityGeneratorInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
16 16
  */
17 17
 interface DefaultEntityGeneratorInterface
18 18
 {
19
-    /**
20
-     * @param EE_Base_Class $entity
21
-     * @return EE_Base_Class[]
22
-     * @throws EE_Error
23
-     * @throws ReflectionException
24
-     * @since $VID:$
25
-     */
26
-    public function create(EE_Base_Class $entity): array;
19
+	/**
20
+	 * @param EE_Base_Class $entity
21
+	 * @return EE_Base_Class[]
22
+	 * @throws EE_Error
23
+	 * @throws ReflectionException
24
+	 * @since $VID:$
25
+	 */
26
+	public function create(EE_Base_Class $entity): array;
27 27
 }
Please login to merge, or discard this patch.
core/domain/services/admin/entities/DefaultDatetimes.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -20,56 +20,56 @@
 block discarded – undo
20 20
  */
21 21
 class DefaultDatetimes implements DefaultEntityGeneratorInterface
22 22
 {
23
-    /**
24
-     * @var DefaultTickets $default_tickets
25
-     */
26
-    protected $default_tickets;
23
+	/**
24
+	 * @var DefaultTickets $default_tickets
25
+	 */
26
+	protected $default_tickets;
27 27
 
28
-    /**
29
-     * @var EEM_Datetime $datetime_model
30
-     */
31
-    protected $datetime_model;
28
+	/**
29
+	 * @var EEM_Datetime $datetime_model
30
+	 */
31
+	protected $datetime_model;
32 32
 
33
-    /**
34
-     * @param DefaultTickets $default_tickets
35
-     * @param EEM_Datetime $datetime_model
36
-     */
37
-    public function __construct(DefaultTickets $default_tickets, EEM_Datetime $datetime_model)
38
-    {
39
-        $this->default_tickets = $default_tickets;
40
-        $this->datetime_model = $datetime_model;
41
-    }
33
+	/**
34
+	 * @param DefaultTickets $default_tickets
35
+	 * @param EEM_Datetime $datetime_model
36
+	 */
37
+	public function __construct(DefaultTickets $default_tickets, EEM_Datetime $datetime_model)
38
+	{
39
+		$this->default_tickets = $default_tickets;
40
+		$this->datetime_model = $datetime_model;
41
+	}
42 42
 
43 43
 
44
-    /**
45
-     * @param EE_Event|EE_Base_Class $entity
46
-     * @return EE_Datetime[]
47
-     * @throws EE_Error
48
-     * @throws InvalidEntityException
49
-     * @throws ReflectionException
50
-     * @since $VID:$
51
-     */
52
-    public function create(EE_Base_Class $entity): array
53
-    {
54
-        if (! $entity instanceof EE_Event) {
55
-            throw new InvalidEntityException($entity, 'EE_Event');
56
-        }
57
-        $default_dates = [];
58
-        $blank_dates = $this->datetime_model->create_new_blank_datetime();
59
-        if (is_array($blank_dates)) {
60
-            foreach ($blank_dates as $blank_date) {
61
-                if (! $blank_date instanceof EE_Datetime) {
62
-                    throw new InvalidEntityException($blank_date, 'EE_Datetime');
63
-                }
64
-                // clone date, strip out ID, then save to get a new ID
65
-                $default_date = clone $blank_date;
66
-                $default_date->set('DTT_ID', null);
67
-                $default_date->save();
68
-                $default_date->_add_relation_to($entity->ID(), 'Event');
69
-                $this->default_tickets->create($default_date);
70
-                $default_dates[ $default_date->ID() ] = $default_date;
71
-            }
72
-        }
73
-        return $default_dates;
74
-    }
44
+	/**
45
+	 * @param EE_Event|EE_Base_Class $entity
46
+	 * @return EE_Datetime[]
47
+	 * @throws EE_Error
48
+	 * @throws InvalidEntityException
49
+	 * @throws ReflectionException
50
+	 * @since $VID:$
51
+	 */
52
+	public function create(EE_Base_Class $entity): array
53
+	{
54
+		if (! $entity instanceof EE_Event) {
55
+			throw new InvalidEntityException($entity, 'EE_Event');
56
+		}
57
+		$default_dates = [];
58
+		$blank_dates = $this->datetime_model->create_new_blank_datetime();
59
+		if (is_array($blank_dates)) {
60
+			foreach ($blank_dates as $blank_date) {
61
+				if (! $blank_date instanceof EE_Datetime) {
62
+					throw new InvalidEntityException($blank_date, 'EE_Datetime');
63
+				}
64
+				// clone date, strip out ID, then save to get a new ID
65
+				$default_date = clone $blank_date;
66
+				$default_date->set('DTT_ID', null);
67
+				$default_date->save();
68
+				$default_date->_add_relation_to($entity->ID(), 'Event');
69
+				$this->default_tickets->create($default_date);
70
+				$default_dates[ $default_date->ID() ] = $default_date;
71
+			}
72
+		}
73
+		return $default_dates;
74
+	}
75 75
 }
Please login to merge, or discard this patch.