@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | protected $cache; |
43 | 43 | protected $keyGenerator; |
44 | 44 | |
45 | - public function __construct( EntityManagerInterface $em, TagAwareCacheInterface $treeCache, UserCacheKeyGenerator $keyGenerator) |
|
45 | + public function __construct(EntityManagerInterface $em, TagAwareCacheInterface $treeCache, UserCacheKeyGenerator $keyGenerator) |
|
46 | 46 | { |
47 | 47 | $this->em = $em; |
48 | 48 | $this->keyGenerator = $keyGenerator; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $secure_class_name = str_replace('\\', '_', $class_name); |
66 | 66 | $key = 'list_'.$this->keyGenerator->generateKey().'_'.$secure_class_name.$parent_id; |
67 | 67 | |
68 | - $ret = $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
68 | + $ret = $this->cache->get($key, function(ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
69 | 69 | // Invalidate when groups, a element with the class or the user changes |
70 | 70 | $item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]); |
71 | 71 | /** |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getGenericTree(string $class, ?StructuralDBElement $parent = null) : array |
119 | 119 | { |
120 | - if(!is_a($class, NamedDBElement::class, true)) { |
|
120 | + if (!is_a($class, NamedDBElement::class, true)) { |
|
121 | 121 | throw new \InvalidArgumentException('$class must be a class string that implements StructuralDBElement or NamedDBElement!'); |
122 | 122 | } |
123 | - if($parent !== null && !is_a($parent, $class)) { |
|
123 | + if ($parent !== null && !is_a($parent, $class)) { |
|
124 | 124 | throw new \InvalidArgumentException('$parent must be of the type $class!'); |
125 | 125 | } |
126 | 126 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $secure_class_name = str_replace('\\', '_', $class); |
136 | 136 | $key = 'treeview_'.$this->keyGenerator->generateKey().'_'.$secure_class_name; |
137 | 137 | |
138 | - $ret = $this->cache->get($key, function (ItemInterface $item) use ($repo, $parent, $secure_class_name) { |
|
138 | + $ret = $this->cache->get($key, function(ItemInterface $item) use ($repo, $parent, $secure_class_name) { |
|
139 | 139 | // Invalidate when groups, a element with the class or the user changes |
140 | 140 | $item->tag(['groups', 'tree_treeview', $this->keyGenerator->generateKey(), $secure_class_name]); |
141 | 141 | return $repo->getGenericNodeTree($parent); |