Completed
Branch FET/allow-prices-to-be-more-pr... (276f1f)
by
unknown
17:02 queued 13:56
created
core/services/dependencies/ClassAlias.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     public function __construct($alias, $fqcn)
36 36
     {
37
-        if (! is_subclass_of($fqcn, $alias)) {
37
+        if ( ! is_subclass_of($fqcn, $alias)) {
38 38
             throw new InvalidAliasException($fqcn, $alias);
39 39
         }
40 40
         $this->alias = $alias;
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -16,46 +16,46 @@
 block discarded – undo
16 16
  */
17 17
 class ClassAlias
18 18
 {
19
-    /**
20
-     * @var string $alias   an interface or base class representing what object
21
-     *                      can be utilized by another object and/or function
22
-     */
23
-    private $alias;
19
+	/**
20
+	 * @var string $alias   an interface or base class representing what object
21
+	 *                      can be utilized by another object and/or function
22
+	 */
23
+	private $alias;
24 24
 
25
-    /**
26
-     * @var string $fqcn the actual class that should be substituted for the alias above
27
-     */
28
-    private $fqcn;
25
+	/**
26
+	 * @var string $fqcn the actual class that should be substituted for the alias above
27
+	 */
28
+	private $fqcn;
29 29
 
30
-    /**
31
-     * ClassAlias constructor.
32
-     *
33
-     * @param string $alias Interface specified by implementing class
34
-     * @param string $fqcn  Concrete class that satisfies interface
35
-     * @throws InvalidAliasException
36
-     */
37
-    public function __construct($alias, $fqcn)
38
-    {
39
-        if (! is_subclass_of($fqcn, $alias)) {
40
-            throw new InvalidAliasException($fqcn, $alias);
41
-        }
42
-        $this->alias = $alias;
43
-        $this->fqcn = $fqcn;
44
-    }
30
+	/**
31
+	 * ClassAlias constructor.
32
+	 *
33
+	 * @param string $alias Interface specified by implementing class
34
+	 * @param string $fqcn  Concrete class that satisfies interface
35
+	 * @throws InvalidAliasException
36
+	 */
37
+	public function __construct($alias, $fqcn)
38
+	{
39
+		if (! is_subclass_of($fqcn, $alias)) {
40
+			throw new InvalidAliasException($fqcn, $alias);
41
+		}
42
+		$this->alias = $alias;
43
+		$this->fqcn = $fqcn;
44
+	}
45 45
 
46
-    /**
47
-     * @return string
48
-     */
49
-    public function alias()
50
-    {
51
-        return $this->alias;
52
-    }
46
+	/**
47
+	 * @return string
48
+	 */
49
+	public function alias()
50
+	{
51
+		return $this->alias;
52
+	}
53 53
 
54
-    /**
55
-     * @return string
56
-     */
57
-    public function fqcn()
58
-    {
59
-        return $this->fqcn;
60
-    }
54
+	/**
55
+	 * @return string
56
+	 */
57
+	public function fqcn()
58
+	{
59
+		return $this->fqcn;
60
+	}
61 61
 }
Please login to merge, or discard this patch.
core/services/factory/FactoryWithDependencyResolver.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -18,41 +18,41 @@
 block discarded – undo
18 18
  */
19 19
 abstract class FactoryWithDependencyResolver implements FactoryInterface
20 20
 {
21
-    /**
22
-     * @var DependencyResolverInterface $dependency_resolver
23
-     */
24
-    private $dependency_resolver;
21
+	/**
22
+	 * @var DependencyResolverInterface $dependency_resolver
23
+	 */
24
+	private $dependency_resolver;
25 25
 
26
-    /**
27
-     * @var LoaderInterface $loader
28
-     */
29
-    private $loader;
26
+	/**
27
+	 * @var LoaderInterface $loader
28
+	 */
29
+	private $loader;
30 30
 
31
-    /**
32
-     * FactoryWithDependencyResolver constructor.
33
-     *
34
-     * @param DependencyResolverInterface $dependency_resolver
35
-     * @param LoaderInterface             $loader
36
-     */
37
-    public function __construct(DependencyResolverInterface $dependency_resolver, LoaderInterface $loader)
38
-    {
39
-        $this->dependency_resolver = $dependency_resolver;
40
-        $this->loader = $loader;
41
-    }
31
+	/**
32
+	 * FactoryWithDependencyResolver constructor.
33
+	 *
34
+	 * @param DependencyResolverInterface $dependency_resolver
35
+	 * @param LoaderInterface             $loader
36
+	 */
37
+	public function __construct(DependencyResolverInterface $dependency_resolver, LoaderInterface $loader)
38
+	{
39
+		$this->dependency_resolver = $dependency_resolver;
40
+		$this->loader = $loader;
41
+	}
42 42
 
43
-    /**
44
-     * @return DependencyResolverInterface
45
-     */
46
-    public function dependencyResolver()
47
-    {
48
-        return $this->dependency_resolver;
49
-    }
43
+	/**
44
+	 * @return DependencyResolverInterface
45
+	 */
46
+	public function dependencyResolver()
47
+	{
48
+		return $this->dependency_resolver;
49
+	}
50 50
 
51
-    /**
52
-     * @return LoaderInterface
53
-     */
54
-    public function loader()
55
-    {
56
-        return $this->loader;
57
-    }
51
+	/**
52
+	 * @return LoaderInterface
53
+	 */
54
+	public function loader()
55
+	{
56
+		return $this->loader;
57
+	}
58 58
 }
Please login to merge, or discard this patch.
core/domain/entities/route_match/MatchAllRouteSpecifications.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function isMatchingRoute()
24 24
     {
25 25
         foreach ($this->specifications as $specification) {
26
-            if (! $specification->isMatchingRoute()) {
26
+            if ( ! $specification->isMatchingRoute()) {
27 27
                 return false;
28 28
             }
29 29
         }
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@
 block discarded – undo
13 13
  */
14 14
 class MatchAllRouteSpecifications extends MultiRouteSpecification
15 15
 {
16
-    /**
17
-     * returns true if current request matches specification
18
-     *
19
-     * @since 4.9.71.p
20
-     * @return boolean
21
-     */
22
-    public function isMatchingRoute()
23
-    {
24
-        foreach ($this->specifications as $specification) {
25
-            if (! $specification->isMatchingRoute()) {
26
-                return false;
27
-            }
28
-        }
29
-        return true;
30
-    }
16
+	/**
17
+	 * returns true if current request matches specification
18
+	 *
19
+	 * @since 4.9.71.p
20
+	 * @return boolean
21
+	 */
22
+	public function isMatchingRoute()
23
+	{
24
+		foreach ($this->specifications as $specification) {
25
+			if (! $specification->isMatchingRoute()) {
26
+				return false;
27
+			}
28
+		}
29
+		return true;
30
+	}
31 31
 }
Please login to merge, or discard this patch.
core/services/route_match/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\route_match\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\route_match\specifications\admin',
92
-                        'EventEspresso\core\domain\entities\route_match\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\route_match\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\route_match\specifications\admin',
92
+						'EventEspresso\core\domain\entities\route_match\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/services/pue/Config.php 1 patch
Indentation   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -16,131 +16,131 @@
 block discarded – undo
16 16
  */
17 17
 class Config
18 18
 {
19
-    /**
20
-     * @var EE_Network_Config
21
-     */
22
-    private $network_config;
23
-
24
-
25
-    /**
26
-     * @var EE_Config
27
-     */
28
-    private $ee_config;
29
-
30
-
31
-    public function __construct(EE_Network_Config $network_config, EE_Config $ee_config)
32
-    {
33
-        $this->network_config = $network_config;
34
-        $this->ee_config = $ee_config;
35
-    }
36
-
37
-
38
-    /**
39
-     * Get the site license key for the site.
40
-     */
41
-    public function siteLicenseKey()
42
-    {
43
-        return $this->network_config->core->site_license_key;
44
-    }
45
-
46
-
47
-    public function i18nDomain()
48
-    {
49
-        return 'event_espresso';
50
-    }
51
-
52
-
53
-    public function checkPeriod()
54
-    {
55
-        return 24;
56
-    }
57
-
58
-
59
-    public function optionKey()
60
-    {
61
-        return 'ee_site_license_key';
62
-    }
63
-
64
-
65
-    public function optionsPageSlug()
66
-    {
67
-        return 'espresso_general_settings';
68
-    }
69
-
70
-
71
-    public function hostServerUrl()
72
-    {
73
-        return defined('PUE_UPDATES_ENDPOINT')
74
-            ? PUE_UPDATES_ENDPOINT
75
-            : 'https://eventespresso.com';
76
-    }
77
-
78
-
79
-    public function pluginSlug()
80
-    {
81
-        // Note: PUE uses a simple preg_match to determine what type is currently installed based on version number.
82
-        //  So it's important that you use a key for the version type that is unique and not found in another key.
83
-        // For example:
84
-        // $plugin_slug['premium']['p'] = 'some-premium-slug';
85
-        // $plugin_slug['prerelease']['pr'] = 'some-pre-release-slug';
86
-        // The above would not work because "p" is found in both keys for the version type. ( i.e 1.0.p vs 1.0.pr )
87
-        // so doing something like:
88
-        // $plugin_slug['premium']['p'] = 'some-premium-slug';
89
-        // $plugin_slug['prerelease']['b'] = 'some-pre-release-slug';
90
-        // ..WOULD work!
91
-        return array(
92
-            'free'       => array('decaf' => 'event-espresso-core-decaf'),
93
-            'premium'    => array('p' => 'event-espresso-core-reg'),
94
-            'prerelease' => array('beta' => 'event-espresso-core-pr'),
95
-        );
96
-    }
97
-
98
-
99
-    /**
100
-     * Return whether the site is opted in for UXIP or not.
101
-     *
102
-     * @return bool
103
-     */
104
-    public function isOptedInForUxip()
105
-    {
106
-        return filter_var($this->ee_config->core->ee_ueip_optin, FILTER_VALIDATE_BOOLEAN);
107
-    }
108
-
109
-
110
-    /**
111
-     * Return whether the site has been notified about UXIP or not.
112
-     *
113
-     * @return bool
114
-     */
115
-    public function hasNotifiedForUxip()
116
-    {
117
-        return filter_var($this->ee_config->core->ee_ueip_has_notified, FILTER_VALIDATE_BOOLEAN);
118
-    }
119
-
120
-
121
-    /**
122
-     * Set the site opted in for UXIP.
123
-     */
124
-    public function setHasOptedInForUxip()
125
-    {
126
-        $this->ee_config->core->ee_ueip_optin = true;
127
-        $this->ee_config->update_espresso_config(false, false);
128
-    }
129
-
130
-
131
-    /**
132
-     * Set the site opted out for UXIP
133
-     */
134
-    public function setHasOptedOutForUxip()
135
-    {
136
-        $this->ee_config->core->ee_ueip_optin = false;
137
-        $this->ee_config->update_espresso_config(false, false);
138
-    }
139
-
140
-
141
-    public function setHasNotifiedAboutUxip()
142
-    {
143
-        $this->ee_config->core->ee_ueip_has_notified = true;
144
-        $this->ee_config->update_espresso_config(false, false);
145
-    }
19
+	/**
20
+	 * @var EE_Network_Config
21
+	 */
22
+	private $network_config;
23
+
24
+
25
+	/**
26
+	 * @var EE_Config
27
+	 */
28
+	private $ee_config;
29
+
30
+
31
+	public function __construct(EE_Network_Config $network_config, EE_Config $ee_config)
32
+	{
33
+		$this->network_config = $network_config;
34
+		$this->ee_config = $ee_config;
35
+	}
36
+
37
+
38
+	/**
39
+	 * Get the site license key for the site.
40
+	 */
41
+	public function siteLicenseKey()
42
+	{
43
+		return $this->network_config->core->site_license_key;
44
+	}
45
+
46
+
47
+	public function i18nDomain()
48
+	{
49
+		return 'event_espresso';
50
+	}
51
+
52
+
53
+	public function checkPeriod()
54
+	{
55
+		return 24;
56
+	}
57
+
58
+
59
+	public function optionKey()
60
+	{
61
+		return 'ee_site_license_key';
62
+	}
63
+
64
+
65
+	public function optionsPageSlug()
66
+	{
67
+		return 'espresso_general_settings';
68
+	}
69
+
70
+
71
+	public function hostServerUrl()
72
+	{
73
+		return defined('PUE_UPDATES_ENDPOINT')
74
+			? PUE_UPDATES_ENDPOINT
75
+			: 'https://eventespresso.com';
76
+	}
77
+
78
+
79
+	public function pluginSlug()
80
+	{
81
+		// Note: PUE uses a simple preg_match to determine what type is currently installed based on version number.
82
+		//  So it's important that you use a key for the version type that is unique and not found in another key.
83
+		// For example:
84
+		// $plugin_slug['premium']['p'] = 'some-premium-slug';
85
+		// $plugin_slug['prerelease']['pr'] = 'some-pre-release-slug';
86
+		// The above would not work because "p" is found in both keys for the version type. ( i.e 1.0.p vs 1.0.pr )
87
+		// so doing something like:
88
+		// $plugin_slug['premium']['p'] = 'some-premium-slug';
89
+		// $plugin_slug['prerelease']['b'] = 'some-pre-release-slug';
90
+		// ..WOULD work!
91
+		return array(
92
+			'free'       => array('decaf' => 'event-espresso-core-decaf'),
93
+			'premium'    => array('p' => 'event-espresso-core-reg'),
94
+			'prerelease' => array('beta' => 'event-espresso-core-pr'),
95
+		);
96
+	}
97
+
98
+
99
+	/**
100
+	 * Return whether the site is opted in for UXIP or not.
101
+	 *
102
+	 * @return bool
103
+	 */
104
+	public function isOptedInForUxip()
105
+	{
106
+		return filter_var($this->ee_config->core->ee_ueip_optin, FILTER_VALIDATE_BOOLEAN);
107
+	}
108
+
109
+
110
+	/**
111
+	 * Return whether the site has been notified about UXIP or not.
112
+	 *
113
+	 * @return bool
114
+	 */
115
+	public function hasNotifiedForUxip()
116
+	{
117
+		return filter_var($this->ee_config->core->ee_ueip_has_notified, FILTER_VALIDATE_BOOLEAN);
118
+	}
119
+
120
+
121
+	/**
122
+	 * Set the site opted in for UXIP.
123
+	 */
124
+	public function setHasOptedInForUxip()
125
+	{
126
+		$this->ee_config->core->ee_ueip_optin = true;
127
+		$this->ee_config->update_espresso_config(false, false);
128
+	}
129
+
130
+
131
+	/**
132
+	 * Set the site opted out for UXIP
133
+	 */
134
+	public function setHasOptedOutForUxip()
135
+	{
136
+		$this->ee_config->core->ee_ueip_optin = false;
137
+		$this->ee_config->update_espresso_config(false, false);
138
+	}
139
+
140
+
141
+	public function setHasNotifiedAboutUxip()
142
+	{
143
+		$this->ee_config->core->ee_ueip_has_notified = true;
144
+		$this->ee_config->update_espresso_config(false, false);
145
+	}
146 146
 }
Please login to merge, or discard this patch.
core/services/dependencies/DependencyResolver.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      */
98 98
     public function addAlias(ClassAlias $alias)
99 99
     {
100
-        $this->aliases[ $alias->alias() ] = $alias;
100
+        $this->aliases[$alias->alias()] = $alias;
101 101
     }
102 102
 
103 103
     /**
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function resolveAlias($param_fqcn)
108 108
     {
109
-        return isset($this->aliases[ $param_fqcn ])
110
-            ? $this->aliases[ $param_fqcn ]->fqcn()
109
+        return isset($this->aliases[$param_fqcn])
110
+            ? $this->aliases[$param_fqcn]->fqcn()
111 111
             : $this->classCache()->getFqnForAlias($param_fqcn);
112 112
     }
113 113
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                 $this->resolveDependenciesForClass($param_class);
171 171
             }
172 172
             $param_class = $this->resolveAlias($param_class);
173
-            $dependencies[ $param_class ] = EE_Dependency_Map::load_from_cache;
173
+            $dependencies[$param_class] = EE_Dependency_Map::load_from_cache;
174 174
         }
175 175
         $this->dependencyMap()->registerDependencies($fqcn, $dependencies);
176 176
     }
Please login to merge, or discard this patch.
Indentation   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -22,155 +22,155 @@
 block discarded – undo
22 22
  */
23 23
 abstract class DependencyResolver implements DependencyResolverInterface
24 24
 {
25
-    /**
26
-     * @var Mirror $mirror
27
-     */
28
-    private $mirror;
29
-
30
-    /**
31
-     * @var ClassInterfaceCache $class_cache
32
-     */
33
-    private $class_cache;
34
-
35
-    /**
36
-     * @var EE_Dependency_Map $dependency_map
37
-     */
38
-    private $dependency_map;
39
-
40
-    /**
41
-     * @var ClassAlias[] $aliases
42
-     */
43
-    protected $aliases = array();
44
-
45
-    /**
46
-     * @var array $namespace_roots
47
-     */
48
-    protected $namespace_roots = array();
49
-
50
-
51
-    /**
52
-     * RouteMatchSpecificationDependencyResolver constructor.
53
-     *
54
-     * @param Mirror              $mirror
55
-     * @param ClassInterfaceCache $class_cache
56
-     * @param EE_Dependency_Map   $dependency_map
57
-     */
58
-    public function __construct(
59
-        Mirror $mirror,
60
-        ClassInterfaceCache $class_cache,
61
-        EE_Dependency_Map $dependency_map
62
-    ) {
63
-        $this->mirror = $mirror;
64
-        $this->class_cache = $class_cache;
65
-        $this->dependency_map = $dependency_map;
66
-        $this->initialize();
67
-    }
68
-
69
-    /**
70
-     * @return Mirror
71
-     */
72
-    public function mirror()
73
-    {
74
-        return $this->mirror;
75
-    }
76
-
77
-    /**
78
-     * @return ClassInterfaceCache
79
-     */
80
-    public function classCache()
81
-    {
82
-        return $this->class_cache;
83
-    }
84
-
85
-    /**
86
-     * @return EE_Dependency_Map
87
-     */
88
-    public function dependencyMap()
89
-    {
90
-        return $this->dependency_map;
91
-    }
92
-
93
-    /**
94
-     * @param ClassAlias $alias
95
-     * @throws InvalidAliasException
96
-     */
97
-    public function addAlias(ClassAlias $alias)
98
-    {
99
-        $this->aliases[ $alias->alias() ] = $alias;
100
-    }
101
-
102
-    /**
103
-     * @param string $param_fqcn Fully Qualified Class Name for dependency parameter
104
-     * @return string
105
-     */
106
-    public function resolveAlias($param_fqcn)
107
-    {
108
-        return isset($this->aliases[ $param_fqcn ])
109
-            ? $this->aliases[ $param_fqcn ]->fqcn()
110
-            : $this->classCache()->getFqnForAlias($param_fqcn);
111
-    }
112
-
113
-    /**
114
-     * Primarily used to indicate the namespace root for composite objects
115
-     * so that dependencies requiring the same DependencyResolver can be acquired
116
-     * for example:
117
-     * Vendor\path\to\class\A, Vendor\path\to\class\B, and Vendor\path\to\class\C
118
-     * may all implement Vendor\path\to\Interface,
119
-     * but Vendor\path\to\class\C could be a composite object
120
-     * that requires Vendor\path\to\class\A and Vendor\path\to\class\B,
121
-     * and needs both of those dependencies resolved, which would therefore require
122
-     * the use of the same DependencyResolver.
123
-     *
124
-     * By specifying a namespace root of "Vendor\path\to\",
125
-     * then all classes that are descendants of that namespace
126
-     * will use DependencyResolver to acquire the classes they need
127
-     *
128
-     * @param string $namespace_root Partial namespace used for detecting other classes
129
-     *                               that should employ this same DependencyResolver
130
-     */
131
-    public function addNamespaceRoot($namespace_root)
132
-    {
133
-        $this->namespace_roots[] = $namespace_root;
134
-    }
135
-
136
-    /**
137
-     * Returns true if the parameter FQCN belongs to one of
138
-     * the namespaces that utilizes this DependencyResolver
139
-     *
140
-     * @param string $param_fqcn Fully Qualified Class Name for dependency parameter
141
-     * @return boolean
142
-     * @since 4.9.71.p
143
-     */
144
-    public function dependencyRecursionExists($param_fqcn)
145
-    {
146
-        foreach ($this->namespace_roots as $namespace_root) {
147
-            if (strpos($param_fqcn, $namespace_root) !== false) {
148
-                return true;
149
-            }
150
-        }
151
-        return false;
152
-    }
153
-
154
-
155
-    /**
156
-     * @param string $fqcn Fully Qualified Class Name
157
-     * @throws InvalidDataTypeException
158
-     * @throws ReflectionException
159
-     * @since 4.9.71.p
160
-     */
161
-    public function resolveDependenciesForClass($fqcn)
162
-    {
163
-        $dependencies = array();
164
-        $params = $this->mirror()->getParameters($fqcn);
165
-        foreach ($params as $index => $param) {
166
-            // is this a dependency for a specific class ?
167
-            $param_class = $this->mirror()->getParameterClassName($param, $fqcn, $index);
168
-            if ($this->dependencyRecursionExists($param_class)) {
169
-                $this->resolveDependenciesForClass($param_class);
170
-            }
171
-            $param_class = $this->resolveAlias($param_class);
172
-            $dependencies[ $param_class ] = EE_Dependency_Map::load_from_cache;
173
-        }
174
-        $this->dependencyMap()->registerDependencies($fqcn, $dependencies);
175
-    }
25
+	/**
26
+	 * @var Mirror $mirror
27
+	 */
28
+	private $mirror;
29
+
30
+	/**
31
+	 * @var ClassInterfaceCache $class_cache
32
+	 */
33
+	private $class_cache;
34
+
35
+	/**
36
+	 * @var EE_Dependency_Map $dependency_map
37
+	 */
38
+	private $dependency_map;
39
+
40
+	/**
41
+	 * @var ClassAlias[] $aliases
42
+	 */
43
+	protected $aliases = array();
44
+
45
+	/**
46
+	 * @var array $namespace_roots
47
+	 */
48
+	protected $namespace_roots = array();
49
+
50
+
51
+	/**
52
+	 * RouteMatchSpecificationDependencyResolver constructor.
53
+	 *
54
+	 * @param Mirror              $mirror
55
+	 * @param ClassInterfaceCache $class_cache
56
+	 * @param EE_Dependency_Map   $dependency_map
57
+	 */
58
+	public function __construct(
59
+		Mirror $mirror,
60
+		ClassInterfaceCache $class_cache,
61
+		EE_Dependency_Map $dependency_map
62
+	) {
63
+		$this->mirror = $mirror;
64
+		$this->class_cache = $class_cache;
65
+		$this->dependency_map = $dependency_map;
66
+		$this->initialize();
67
+	}
68
+
69
+	/**
70
+	 * @return Mirror
71
+	 */
72
+	public function mirror()
73
+	{
74
+		return $this->mirror;
75
+	}
76
+
77
+	/**
78
+	 * @return ClassInterfaceCache
79
+	 */
80
+	public function classCache()
81
+	{
82
+		return $this->class_cache;
83
+	}
84
+
85
+	/**
86
+	 * @return EE_Dependency_Map
87
+	 */
88
+	public function dependencyMap()
89
+	{
90
+		return $this->dependency_map;
91
+	}
92
+
93
+	/**
94
+	 * @param ClassAlias $alias
95
+	 * @throws InvalidAliasException
96
+	 */
97
+	public function addAlias(ClassAlias $alias)
98
+	{
99
+		$this->aliases[ $alias->alias() ] = $alias;
100
+	}
101
+
102
+	/**
103
+	 * @param string $param_fqcn Fully Qualified Class Name for dependency parameter
104
+	 * @return string
105
+	 */
106
+	public function resolveAlias($param_fqcn)
107
+	{
108
+		return isset($this->aliases[ $param_fqcn ])
109
+			? $this->aliases[ $param_fqcn ]->fqcn()
110
+			: $this->classCache()->getFqnForAlias($param_fqcn);
111
+	}
112
+
113
+	/**
114
+	 * Primarily used to indicate the namespace root for composite objects
115
+	 * so that dependencies requiring the same DependencyResolver can be acquired
116
+	 * for example:
117
+	 * Vendor\path\to\class\A, Vendor\path\to\class\B, and Vendor\path\to\class\C
118
+	 * may all implement Vendor\path\to\Interface,
119
+	 * but Vendor\path\to\class\C could be a composite object
120
+	 * that requires Vendor\path\to\class\A and Vendor\path\to\class\B,
121
+	 * and needs both of those dependencies resolved, which would therefore require
122
+	 * the use of the same DependencyResolver.
123
+	 *
124
+	 * By specifying a namespace root of "Vendor\path\to\",
125
+	 * then all classes that are descendants of that namespace
126
+	 * will use DependencyResolver to acquire the classes they need
127
+	 *
128
+	 * @param string $namespace_root Partial namespace used for detecting other classes
129
+	 *                               that should employ this same DependencyResolver
130
+	 */
131
+	public function addNamespaceRoot($namespace_root)
132
+	{
133
+		$this->namespace_roots[] = $namespace_root;
134
+	}
135
+
136
+	/**
137
+	 * Returns true if the parameter FQCN belongs to one of
138
+	 * the namespaces that utilizes this DependencyResolver
139
+	 *
140
+	 * @param string $param_fqcn Fully Qualified Class Name for dependency parameter
141
+	 * @return boolean
142
+	 * @since 4.9.71.p
143
+	 */
144
+	public function dependencyRecursionExists($param_fqcn)
145
+	{
146
+		foreach ($this->namespace_roots as $namespace_root) {
147
+			if (strpos($param_fqcn, $namespace_root) !== false) {
148
+				return true;
149
+			}
150
+		}
151
+		return false;
152
+	}
153
+
154
+
155
+	/**
156
+	 * @param string $fqcn Fully Qualified Class Name
157
+	 * @throws InvalidDataTypeException
158
+	 * @throws ReflectionException
159
+	 * @since 4.9.71.p
160
+	 */
161
+	public function resolveDependenciesForClass($fqcn)
162
+	{
163
+		$dependencies = array();
164
+		$params = $this->mirror()->getParameters($fqcn);
165
+		foreach ($params as $index => $param) {
166
+			// is this a dependency for a specific class ?
167
+			$param_class = $this->mirror()->getParameterClassName($param, $fqcn, $index);
168
+			if ($this->dependencyRecursionExists($param_class)) {
169
+				$this->resolveDependenciesForClass($param_class);
170
+			}
171
+			$param_class = $this->resolveAlias($param_class);
172
+			$dependencies[ $param_class ] = EE_Dependency_Map::load_from_cache;
173
+		}
174
+		$this->dependencyMap()->registerDependencies($fqcn, $dependencies);
175
+	}
176 176
 }
Please login to merge, or discard this patch.
core/domain/entities/route_match/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\route_match\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\route_match\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\route_match\RouteMatchSpecificationInterface'
37
+				);
38
+			}
39
+		}
40
+		$this->specifications = $specifications;
41
+		parent::__construct($request);
42
+	}
43 43
 }
Please login to merge, or discard this patch.
domain/entities/route_match/specifications/admin/WordPressPostsEditor.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -18,22 +18,22 @@
 block discarded – undo
18 18
  */
19 19
 class WordPressPostsEditor extends MatchAnyRouteSpecification
20 20
 {
21
-    /**
22
-     * WordPressPostsEditor constructor.
23
-     *
24
-     * @param WordPressPostsEditorEdit $edit_post_route_match
25
-     * @param WordPressPostsEditorAddNew $create_post_route_match
26
-     * @param RequestInterface           $request
27
-     * @throws \EventEspresso\core\exceptions\InvalidEntityException
28
-     */
29
-    public function __construct(
30
-        WordPressPostsEditorEdit $edit_post_route_match,
31
-        WordPressPostsEditorAddNew $create_post_route_match,
32
-        RequestInterface $request
33
-    ) {
34
-        parent::__construct(
35
-            array($edit_post_route_match, $create_post_route_match),
36
-            $request
37
-        );
38
-    }
21
+	/**
22
+	 * WordPressPostsEditor constructor.
23
+	 *
24
+	 * @param WordPressPostsEditorEdit $edit_post_route_match
25
+	 * @param WordPressPostsEditorAddNew $create_post_route_match
26
+	 * @param RequestInterface           $request
27
+	 * @throws \EventEspresso\core\exceptions\InvalidEntityException
28
+	 */
29
+	public function __construct(
30
+		WordPressPostsEditorEdit $edit_post_route_match,
31
+		WordPressPostsEditorAddNew $create_post_route_match,
32
+		RequestInterface $request
33
+	) {
34
+		parent::__construct(
35
+			array($edit_post_route_match, $create_post_route_match),
36
+			$request
37
+		);
38
+	}
39 39
 }
Please login to merge, or discard this patch.
domain/entities/route_match/specifications/admin/EspressoEventEditor.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@
 block discarded – undo
19 19
  */
20 20
 class EspressoEventEditor extends MatchAnyRouteSpecification
21 21
 {
22
-    /**
23
-     * EspressoEventEditor constructor.
24
-     *
25
-     * @param EspressoEventEditorEdit   $edit_event_route_match
26
-     * @param EspressoEventEditorAddNew $create_event_route_match
27
-     * @param RequestInterface          $request
28
-     * @throws InvalidEntityException
29
-     */
30
-    public function __construct(
31
-        EspressoEventEditorEdit $edit_event_route_match,
32
-        EspressoEventEditorAddNew $create_event_route_match,
33
-        RequestInterface $request
34
-    ) {
35
-        parent::__construct(
36
-            array($edit_event_route_match, $create_event_route_match),
37
-            $request
38
-        );
39
-    }
22
+	/**
23
+	 * EspressoEventEditor constructor.
24
+	 *
25
+	 * @param EspressoEventEditorEdit   $edit_event_route_match
26
+	 * @param EspressoEventEditorAddNew $create_event_route_match
27
+	 * @param RequestInterface          $request
28
+	 * @throws InvalidEntityException
29
+	 */
30
+	public function __construct(
31
+		EspressoEventEditorEdit $edit_event_route_match,
32
+		EspressoEventEditorAddNew $create_event_route_match,
33
+		RequestInterface $request
34
+	) {
35
+		parent::__construct(
36
+			array($edit_event_route_match, $create_event_route_match),
37
+			$request
38
+		);
39
+	}
40 40
 }
Please login to merge, or discard this patch.