浏览代码

[DependencyInjection] Cleaned up formatting of complex isAbsolutePath() logic.

Kris Wallsmith 15 年之前
父节点
当前提交
4569ca033c
共有 1 个文件被更改,包括 18 次插入10 次删除
  1. 18 10
      src/Symfony/Components/DependencyInjection/Loader/FileLoader.php

+ 18 - 10
src/Symfony/Components/DependencyInjection/Loader/FileLoader.php

@@ -77,16 +77,24 @@ abstract class FileLoader extends Loader
 
   static protected function isAbsolutePath($file)
   {
-    if ($file[0] == '/' || $file[0] == '\\' ||
-        (strlen($file) > 3 && ctype_alpha($file[0]) &&
-         $file[1] == ':' &&
-         ($file[2] == '\\' || $file[2] == '/')
+    return
+      '/' == $file[0]
+      ||
+      '\\' == $file[0]
+      ||
+      (
+        3 < strlen($file)
+        &&
+        ctype_alpha($file[0])
+        &&
+        ':' == $file[1]
+        &&
+        (
+          '\\' == $file[2]
+          ||
+          '/' == $file[2]
         )
-       )
-    {
-      return true;
-    }
-
-    return false;
+      )
+    ;
   }
 }