Completed
Branch dev (1399ad)
by
unknown
60:04 queued 50:49
created
core/domain/services/capabilities/FeatureFlags.php 2 patches
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -14,73 +14,73 @@
 block discarded – undo
14 14
 class FeatureFlags
15 15
 {
16 16
 
17
-    /**
18
-     * @var CapabilitiesChecker $capabilities_checker
19
-     */
20
-    private $capabilities_checker;
17
+	/**
18
+	 * @var CapabilitiesChecker $capabilities_checker
19
+	 */
20
+	private $capabilities_checker;
21 21
 
22
-    /**
23
-     * array of key value pairs where the key is the feature flag in question
24
-     * and the value is either a boolean or a CapCheck object defining the required permissions
25
-     * example:
26
-     *       [
27
-     *          'use_bulk_edit' => true,
28
-     *          'use_death_ray' => new CapCheck( 'ee-death-ray-cap', 'context-desc' )
29
-     *      ]
30
-     * array is filterable via FHEE__EventEspresso_core_domain_services_capabilities_FeatureFlags
31
-     *
32
-     * @var boolean[]|CapCheck[]
33
-     */
34
-    private $feature_flags;
22
+	/**
23
+	 * array of key value pairs where the key is the feature flag in question
24
+	 * and the value is either a boolean or a CapCheck object defining the required permissions
25
+	 * example:
26
+	 *       [
27
+	 *          'use_bulk_edit' => true,
28
+	 *          'use_death_ray' => new CapCheck( 'ee-death-ray-cap', 'context-desc' )
29
+	 *      ]
30
+	 * array is filterable via FHEE__EventEspresso_core_domain_services_capabilities_FeatureFlags
31
+	 *
32
+	 * @var boolean[]|CapCheck[]
33
+	 */
34
+	private $feature_flags;
35 35
 
36 36
 
37
-    /**
38
-     * FeatureFlags constructor.
39
-     *
40
-     * @param CapabilitiesChecker $capabilities_checker
41
-     */
42
-    public function __construct(CapabilitiesChecker $capabilities_checker)
43
-    {
44
-        $this->capabilities_checker = $capabilities_checker;
45
-        $this->feature_flags = apply_filters(
46
-            'FHEE__EventEspresso_core_domain_services_capabilities_FeatureFlags',
47
-            [
48
-                'use_bulk_edit'              => false,
49
-                'use_default_ticket_manager' => false,
50
-                'use_reg_form_builder'       => false,
51
-                'use_event_description_rte'  => false,
52
-                'use_experimental_rte'       => false,
53
-                'use_reg_options_meta_box'   => false,
54
-                'ee_advanced_event_editor'   => false,
55
-            ]
56
-        );
57
-    }
37
+	/**
38
+	 * FeatureFlags constructor.
39
+	 *
40
+	 * @param CapabilitiesChecker $capabilities_checker
41
+	 */
42
+	public function __construct(CapabilitiesChecker $capabilities_checker)
43
+	{
44
+		$this->capabilities_checker = $capabilities_checker;
45
+		$this->feature_flags = apply_filters(
46
+			'FHEE__EventEspresso_core_domain_services_capabilities_FeatureFlags',
47
+			[
48
+				'use_bulk_edit'              => false,
49
+				'use_default_ticket_manager' => false,
50
+				'use_reg_form_builder'       => false,
51
+				'use_event_description_rte'  => false,
52
+				'use_experimental_rte'       => false,
53
+				'use_reg_options_meta_box'   => false,
54
+				'ee_advanced_event_editor'   => false,
55
+			]
56
+		);
57
+	}
58 58
 
59 59
 
60
-    /**
61
-     * @param string $feature
62
-     * @return bool
63
-     */
64
-    public function featureAllowed(string $feature): bool
65
-    {
66
-        $flag = $this->feature_flags[ $feature ] ?? false;
67
-        try {
68
-            return is_object($flag) && $flag instanceof CapCheck
69
-                ? $this->capabilities_checker->processCapCheck($flag)
70
-                : filter_var($flag, FILTER_VALIDATE_BOOLEAN);
71
-        } catch (InsufficientPermissionsException $e) {
72
-            // eat the exception
73
-        }
74
-        return false;
75
-    }
60
+	/**
61
+	 * @param string $feature
62
+	 * @return bool
63
+	 */
64
+	public function featureAllowed(string $feature): bool
65
+	{
66
+		$flag = $this->feature_flags[ $feature ] ?? false;
67
+		try {
68
+			return is_object($flag) && $flag instanceof CapCheck
69
+				? $this->capabilities_checker->processCapCheck($flag)
70
+				: filter_var($flag, FILTER_VALIDATE_BOOLEAN);
71
+		} catch (InsufficientPermissionsException $e) {
72
+			// eat the exception
73
+		}
74
+		return false;
75
+	}
76 76
 
77 77
 
78
-    /**
79
-     * @return array
80
-     */
81
-    public function getAllowedFeatures(): array
82
-    {
83
-        $allowed = array_filter($this->feature_flags, [$this, 'featureAllowed'], ARRAY_FILTER_USE_KEY);
84
-        return array_keys($allowed);
85
-    }
78
+	/**
79
+	 * @return array
80
+	 */
81
+	public function getAllowedFeatures(): array
82
+	{
83
+		$allowed = array_filter($this->feature_flags, [$this, 'featureAllowed'], ARRAY_FILTER_USE_KEY);
84
+		return array_keys($allowed);
85
+	}
86 86
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
      */
64 64
     public function featureAllowed(string $feature): bool
65 65
     {
66
-        $flag = $this->feature_flags[ $feature ] ?? false;
66
+        $flag = $this->feature_flags[$feature] ?? false;
67 67
         try {
68 68
             return is_object($flag) && $flag instanceof CapCheck
69 69
                 ? $this->capabilities_checker->processCapCheck($flag)
Please login to merge, or discard this patch.