Completed
Push — master ( 95506d...0f93c5 )
by Jonathan
07:55
created
src/Webtrees/Hook/HookProvider.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 * @return Hook
39 39
 	 */
40 40
 	public static function get($hook_function, $hook_context = null) {
41
-	    return new Hook($hook_function, $hook_context);
41
+		return new Hook($hook_function, $hook_context);
42 42
 	}
43 43
 	
44 44
 	/**
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 	static public function getPossibleHooks() {
64 64
 		static $hooks=null;
65 65
 		if ($hooks === null) {
66
-		    $hooks = array();
67
-		    foreach (glob(WT_ROOT . WT_MODULES_DIR . '*/module.php') as $file) {
68
-		        try {
69
-		            $module = include $file;
70
-		            if($module instanceof HookSubscriberInterface){
66
+			$hooks = array();
67
+			foreach (glob(WT_ROOT . WT_MODULES_DIR . '*/module.php') as $file) {
68
+				try {
69
+					$module = include $file;
70
+					if($module instanceof HookSubscriberInterface){
71 71
 						$subscribedhooks = $module->getSubscribedHooks();
72 72
 						if(is_array($subscribedhooks)){
73 73
 							foreach($subscribedhooks as $key => $value){
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 							}
94 94
 						}
95 95
 					}
96
-    			} catch (\Exception $ex) {
97
-    				// Old or invalid module?
98
-    			}
96
+				} catch (\Exception $ex) {
97
+					// Old or invalid module?
98
+				}
99 99
 			}
100 100
 		}
101 101
 		return $hooks;
@@ -138,33 +138,33 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	static public function updateHooks() {
140 140
 	    
141
-	    if(Auth::isAdmin()){
142
-	        $ihooks = self::getInstalledHooks();
143
-	        $phooks = self::getPossibleHooks();
141
+		if(Auth::isAdmin()){
142
+			$ihooks = self::getInstalledHooks();
143
+			$phooks = self::getPossibleHooks();
144 144
 	        	
145
-	        // Insert hooks not existing yet in the DB
146
-	        if($phooks !== null){
147
-	            foreach($phooks as $phook => $priority){
148
-	                $array_hook = explode('#', $phook);
149
-	                if($ihooks === null || !array_key_exists($phook, $ihooks)){
150
-	                    $chook = new Hook($array_hook[1], $array_hook[2]);
151
-	                    $chook->subscribe($array_hook[0]);
152
-	                    $chook->setPriority($array_hook[0], $priority);
153
-	                }
154
-	            }
155
-	        }
145
+			// Insert hooks not existing yet in the DB
146
+			if($phooks !== null){
147
+				foreach($phooks as $phook => $priority){
148
+					$array_hook = explode('#', $phook);
149
+					if($ihooks === null || !array_key_exists($phook, $ihooks)){
150
+						$chook = new Hook($array_hook[1], $array_hook[2]);
151
+						$chook->subscribe($array_hook[0]);
152
+						$chook->setPriority($array_hook[0], $priority);
153
+					}
154
+				}
155
+			}
156 156
 	        	
157
-	        //Remove hooks not existing any more in the file system
158
-	        if($ihooks !== null){
159
-	            foreach($ihooks as $ihook => $status){
160
-	                $array_hook = explode('#', $ihook);
161
-	                if($phooks === null || !array_key_exists($ihook, $phooks)){
162
-	                    $chook = new Hook($array_hook[1], $array_hook[2]);
163
-	                    $chook->remove($array_hook[0]);
164
-	                }
165
-	            }
166
-	        }
167
-	    }
157
+			//Remove hooks not existing any more in the file system
158
+			if($ihooks !== null){
159
+				foreach($ihooks as $ihook => $status){
160
+					$array_hook = explode('#', $ihook);
161
+					if($phooks === null || !array_key_exists($ihook, $phooks)){
162
+						$chook = new Hook($array_hook[1], $array_hook[2]);
163
+						$chook->remove($array_hook[0]);
164
+					}
165
+				}
166
+			}
167
+		}
168 168
 	}
169 169
 	
170 170
 }
171 171
\ No newline at end of file
Please login to merge, or discard this patch.