Default vs NetBeans Formatting Diff

lithium\core\Libraries.php

index 295241e..6adfdb7 100644
--- a/libraries/lithium/core/Libraries.php
+++ b/libraries/lithium/core/Libraries.php
@@ -376,7 +376,7 @@ class Libraries {
 			$name = static::$_default;
 		}
 		if (is_array($name) || (!$name && $key)) {
-			$name = $name ?: array_keys(static::$_configurations);
+			$name = $name ? : array_keys(static::$_configurations);
 			$call = array(get_called_class(), 'get');
 			return array_combine($name, array_map($call, $name, array_fill(0, count($name), $key)));
 		}
@@ -497,7 +497,7 @@ class Libraries {
 	 */
 	public static function load($class, $require = false) {
 		$path = isset(static::$_cachedPaths[$class]) ? static::$_cachedPaths[$class] : null;
-		$path = $path ?: static::path($class);
+		$path = $path ? : static::path($class);
 
 		if ($path && include $path) {
 			static::$_cachedPaths[$class] = $path;
@@ -587,7 +587,9 @@ class Libraries {
 				return static::$_cachedPaths[$class] = static::realPath($fullPath . $suffix);
 			}
 			$list = glob(dirname($fullPath) . '/*');
-			$list = array_map(function($i) { return str_replace('\\', '/', $i); }, $list);
+			$list = array_map(function($i) {
+				return str_replace('\\', '/', $i);
+			}, $list);
 
 			if (in_array($fullPath . $suffix, $list)) {
 				return static::$_cachedPaths[$class] = static::realPath($fullPath . $suffix);
@@ -656,7 +658,7 @@ class Libraries {
 		}
 		if (is_array($transform)) {
 			list($match, $replace) = $transform;
-			return preg_replace($match, $replace, $class) ?: null;
+			return preg_replace($match, $replace, $class) ? : null;
 		}
 	}
 
@@ -676,7 +678,7 @@ class Libraries {
 	 */
 	public static function instance($type, $name, array $options = array()) {
 		$params = compact('type', 'name', 'options');
-		$_paths =& static::$_paths;
+		$_paths = & static::$_paths;
 
 		$implementation = function($self, $params) use (&$_paths) {
 			$name = $params['name'];
@@ -1028,7 +1030,7 @@ class Libraries {
 		}
 		if ($filter = $options['filter']) {
 			if (is_string($filter)) {
-				$libs = preg_grep($filter, $libs) ;
+				$libs = preg_grep($filter, $libs);
 			} elseif (is_callable($filter)) {
 				$libs = array_filter(array_map($filter, $libs));
 			}
@@ -1056,14 +1058,14 @@ class Libraries {
 			switch (count($parts)) {
 				case 1:
 					list($class) = $parts;
-				break;
+					break;
 				case 2:
 					list($namespace, $class) = $parts;
-				break;
+					break;
 				default:
 					$class = array_pop($parts);
 					$namespace = join('\\', $parts);
-				break;
+					break;
 			}
 		}
 		if (strpos($name, '.') !== false) {

Comments

  1. Chris #1   Chris | Jun 15, 2013 at 21:51

    I changed my formatting for my Lithium projects today, if you have any suggestion to improve the ruleset, please be my guest.

    Maybe it will be better to start a github repo to maintain this...

Leave a Comment
It will not be published.