Passed
Push — master ( e9407c...497267 )
by Nicolaas
16:37 queued 07:43
created
src/Extensions/ElementalCanViewExtension.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
         'CanViewType' => InheritedPermissions::ANYONE,
38 38
     ];
39 39
 
40
-    public function canView($member, $content = [])
40
+    public function canView($member, $content = [ ])
41 41
     {
42 42
         $owner = $this->getOwner();
43
-        if (! $member) {
43
+        if (!$member) {
44 44
             $member = Security::getCurrentUser();
45 45
         }
46 46
 
47 47
         // admin override
48
-        if ($member && Permission::checkMember($member, ['ADMIN', 'SITETREE_VIEW_ALL'])) {
48
+        if ($member && Permission::checkMember($member, [ 'ADMIN', 'SITETREE_VIEW_ALL' ])) {
49 49
             return true;
50 50
         }
51 51
 
52 52
         // if there is no meaningfull response go back to actual element itself!
53
-        if (! $owner->CanViewType || InheritedPermissions::ANYONE === $owner->CanViewType) {
53
+        if (!$owner->CanViewType || InheritedPermissions::ANYONE === $owner->CanViewType) {
54 54
             return null;
55 55
         }
56 56
 
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 
64 64
         // check for any logged-in users
65 65
         if (InheritedPermissions::LOGGED_IN_USERS === $owner->CanViewType) {
66
-            if (! ($member && $member->ID)) {
66
+            if (!($member && $member->ID)) {
67 67
                 return false;
68 68
             }
69 69
         }
70 70
 
71 71
         // check for specific groups
72 72
         if (InheritedPermissions::ONLY_THESE_USERS === $owner->CanViewType) {
73
-            if (! ($member && $member->inGroups($owner->ViewerGroups()))) {
73
+            if (!($member && $member->inGroups($owner->ViewerGroups()))) {
74 74
                 return false;
75 75
             }
76 76
         }
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
             $viewerGroupsField->setDescription(_t(
118 118
                 __CLASS__ . '.VIEWER_GROUPS_FIELD_DESC',
119 119
                 'Groups with global view permissions: {groupList}',
120
-                ['groupList' => implode(', ', array_values($viewAllGroupsMap))]
120
+                [ 'groupList' => implode(', ', array_values($viewAllGroupsMap)) ]
121 121
             ));
122 122
         }
123 123
 
124
-        if (! Permission::check('SITETREE_GRANT_ACCESS')) {
124
+        if (!Permission::check('SITETREE_GRANT_ACCESS')) {
125 125
             $fields->makeFieldReadonly($viewersOptionsField);
126 126
             if (InheritedPermissions::ONLY_THESE_USERS === $owner->CanEditType) {
127 127
                 $fields->makeFieldReadonly($viewerGroupsField);
Please login to merge, or discard this patch.
src/Api/PermissionCanViewListMaker.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  discard block
 block discarded – undo
8 8
 {
9 9
     public static function get_list(): array
10 10
     {
11
-        $mapFn = function ($groups = []) {
12
-            $map = [];
11
+        $mapFn = function($groups = [ ]) {
12
+            $map = [ ];
13 13
             foreach ($groups as $group) {
14 14
                 // Listboxfield values are escaped, use ASCII char instead of »
15
-                $map[$group->ID] = $group->getBreadcrumbs(' > ');
15
+                $map[ $group->ID ] = $group->getBreadcrumbs(' > ');
16 16
             }
17 17
 
18 18
             asort($map);
@@ -20,6 +20,6 @@  discard block
 block discarded – undo
20 20
             return $map;
21 21
         };
22 22
 
23
-        return $mapFn(Permission::get_groups_by_permission(['SITETREE_VIEW_ALL', 'ADMIN']));
23
+        return $mapFn(Permission::get_groups_by_permission([ 'SITETREE_VIEW_ALL', 'ADMIN' ]));
24 24
     }
25 25
 }
Please login to merge, or discard this patch.