diff --git a/lib/private/route/router.php b/lib/private/route/router.php
index 1f0a23ee124a7f0034a440f0f2d7a9c0b408e6a8..0431855707e84ba525414fb132210bcb4bf9b384 100644
--- a/lib/private/route/router.php
+++ b/lib/private/route/router.php
@@ -117,7 +117,7 @@ class Router implements IRouter {
 			if (!isset($this->loadedApps[$app])) {
 				$this->loadedApps[$app] = true;
 				$this->useCollection($app);
-				require_once $file;
+				$this->requireRouteFile($file);
 				$collection = $this->getCollection($app);
 				$collection->addPrefix('/apps/' . $app);
 				$this->root->addCollection($collection);
@@ -230,4 +230,12 @@ class Router implements IRouter {
 		return $this->getGenerator()->generate($name, $parameters, $absolute);
 	}
 
+	/**
+	 * To isolate the variable scope used inside the $file it is required in it's own method
+	 * @param $file
+	 */
+	private function requireRouteFile($file) {
+		require_once $file;
+	}
+
 }