Completed
Push — master ( f75f17...1445d7 )
by Jan
06:30
created
src/EntityListeners/TreeCacheInvalidationListener.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,13 +69,13 @@
 block discarded – undo
69 69
 
70 70
         //If a user change, then invalidate all cached trees for him
71 71
         if ($element instanceof User) {
72
-            $tag = "user_" . $element->getUsername();
72
+            $tag = "user_".$element->getUsername();
73 73
             $this->cache->invalidateTags([$tag]);
74 74
         }
75 75
 
76 76
         /* If any group change, then invalidate all cached trees. Users Permissions can be inherited from groups,
77 77
             so a change in any group can cause big permisssion changes for users. So to be sure, invalidate all trees */
78
-        if($element instanceof Group) {
78
+        if ($element instanceof Group) {
79 79
             $tag = "groups";
80 80
             $this->cache->invalidateTags([$tag]);
81 81
         }
Please login to merge, or discard this patch.
src/Services/TreeBuilder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
         $tree_node = new TreeViewNode($element->__toString(), $href, $children_nodes);
104 104
 
105
-        if($children_nodes != null) {
105
+        if ($children_nodes != null) {
106 106
             $tree_node->addTag((string) count($children_nodes));
107 107
         }
108 108
 
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
         $parent_id = $parent != null ? $parent->getID() : "0";
179 179
         // Backslashes are not allowed in cache keys
180 180
         $secure_class_name = str_replace("\\", '_', $class_name);
181
-        $key = "list_" . $username . "_" . $secure_class_name . $parent_id;
181
+        $key = "list_".$username."_".$secure_class_name.$parent_id;
182 182
 
183
-        $ret = $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name, $username) {
183
+        $ret = $this->cache->get($key, function(ItemInterface $item) use ($class_name, $parent, $secure_class_name, $username) {
184 184
             // Invalidate when groups, a element with the class or the user changes
185
-            $item->tag(['groups', 'tree_list', 'user_' . $username, $secure_class_name]);
185
+            $item->tag(['groups', 'tree_list', 'user_'.$username, $secure_class_name]);
186 186
             /**
187 187
              * @var $repo StructuralDBElementRepository
188 188
              */
Please login to merge, or discard this patch.
src/Services/ToolsTreeBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,11 +67,11 @@
 block discarded – undo
67 67
     {
68 68
         $username = $this->security->getUser()->getUsername();
69 69
 
70
-        $key = "tree_tools_" .  $username;
70
+        $key = "tree_tools_".$username;
71 71
 
72
-        return $this->cache->get($key, function (ItemInterface $item) use ($username) {
72
+        return $this->cache->get($key, function(ItemInterface $item) use ($username) {
73 73
             //Invalidate tree, whenever group or the user changes
74
-            $item->tag(["tree_tools", "groups", "user_" . $username]);
74
+            $item->tag(["tree_tools", "groups", "user_".$username]);
75 75
 
76 76
             $tree = array();
77 77
             $tree[] = new TreeViewNode($this->translator->trans('tree.tools.edit'), null, $this->getEditNodes());
Please login to merge, or discard this patch.