浏览代码

Fix coding standards in Core/

mark_story 14 年之前
父节点
当前提交
63c992a85b
共有 4 个文件被更改,包括 16 次插入20 次删除
  1. 8 7
      lib/Cake/Core/App.php
  2. 4 3
      lib/Cake/Core/CakePlugin.php
  3. 3 3
      lib/Cake/Core/Configure.php
  4. 1 7
      lib/Cake/Core/Object.php

+ 8 - 7
lib/Cake/Core/App.php

@@ -223,7 +223,7 @@ class App {
 		if (!empty($plugin)) {
 			$path = array();
 			$pluginPath = self::pluginPath($plugin);
-			$packageFormat= self::_packageFormat();
+			$packageFormat = self::_packageFormat();
 			if (!empty($packageFormat[$type])) {
 				foreach ($packageFormat[$type] as $f) {
 					$path[] = sprintf($f, $pluginPath);
@@ -372,7 +372,7 @@ class App {
 		$themeDir = 'Themed' . DS . Inflector::camelize($theme);
 		foreach (self::$_packages['View'] as $path) {
 			if (is_dir($path . $themeDir)) {
-				return $path . $themeDir . DS ;
+				return $path . $themeDir . DS;
 			}
 		}
 		return self::$_packages['View'][0] . $themeDir . DS;
@@ -462,7 +462,7 @@ class App {
 					foreach ($files as $file) {
 						$fileName = basename($file);
 						if (!$file->isDot() && $fileName[0] !== '.') {
-							$isDir = $file->isDir() ;
+							$isDir = $file->isDir();
 							if ($isDir && $includeDirectories) {
 								$objects[] = $fileName;
 							} elseif (!$includeDirectories && !$isDir) {
@@ -536,7 +536,7 @@ class App {
 
 		if (empty($plugin)) {
 			$appLibs = empty(self::$_packages['Lib']) ? APPLIBS : current(self::$_packages['Lib']);
-			$paths[] =  $appLibs . $package . DS;
+			$paths[] = $appLibs . $package . DS;
 			$paths[] = APP . $package . DS;
 			$paths[] = CAKE . $package . DS;
 		} else {
@@ -710,7 +710,7 @@ class App {
 			if ($return) {
 				return $returnValue;
 			}
-			return (bool) $returnValue;
+			return (bool)$returnValue;
 		}
 		return false;
 	}
@@ -726,7 +726,7 @@ class App {
  */
 	protected static function _loadVendor($name, $plugin, $file, $ext) {
 		if ($mapped = self::_mapped($name, $plugin)) {
-			return (bool) include_once($mapped);
+			return (bool)include_once $mapped;
 		}
 		$fileTries = array();
 		$paths = ($plugin) ? App::path('vendors', $plugin) : App::path('vendors');
@@ -744,7 +744,7 @@ class App {
 			foreach ($paths as $path) {
 				if (file_exists($path . $file)) {
 					self::_map($path . $file, $name, $plugin);
-					return (bool) include($path . $file);
+					return (bool)include $path . $file;
 				}
 			}
 		}
@@ -887,4 +887,5 @@ class App {
 			Cache::write('object_map', self::$_objects, '_cake_core_');
 		}
 	}
+
 }

+ 4 - 3
lib/Cake/Core/CakePlugin.php

@@ -126,7 +126,7 @@ class CakePlugin {
 			if ($opts === null && isset($options[0])) {
 				$opts = $options[0];
 			}
-			self::load($p, (array) $opts);
+			self::load($p, (array)$opts);
 		}
 	}
 
@@ -162,7 +162,7 @@ class CakePlugin {
 
 		$path = self::path($plugin);
 		if ($config['bootstrap'] === true) {
-			return include($path . 'Config' . DS . 'bootstrap.php');
+			return include $path . 'Config' . DS . 'bootstrap.php';
 		}
 
 		$bootstrap = (array)$config['bootstrap'];
@@ -191,7 +191,7 @@ class CakePlugin {
 		if ($config['routes'] === false) {
 			return false;
 		}
-		return (bool) include self::path($plugin) . 'Config' . DS . 'routes.php';
+		return (bool)include self::path($plugin) . 'Config' . DS . 'routes.php';
 	}
 
 /**
@@ -224,4 +224,5 @@ class CakePlugin {
 			unset(self::$_plugins[$plugin]);
 		}
 	}
+
 }

+ 3 - 3
lib/Cake/Core/Configure.php

@@ -69,13 +69,13 @@ class Configure {
 				'www_root' => WWW_ROOT
 			));
 
-			if (!include(APP . 'Config' . DS . 'core.php')) {
+			if (!include APP . 'Config' . DS . 'core.php') {
 				trigger_error(__d('cake_dev', "Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", APP . 'Config' . DS), E_USER_ERROR);
 			}
 			App::$bootstrapping = false;
 			App::init();
 			App::build();
-			if (!include(APP . 'Config' . DS . 'bootstrap.php')) {
+			if (!include APP . 'Config' . DS . 'bootstrap.php') {
 				trigger_error(__d('cake_dev', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", APP . 'Config' . DS), E_USER_ERROR);
 			}
 			$level = -1;
@@ -335,5 +335,5 @@ class Configure {
 		}
 		return false;
 	}
-}
 
+}

+ 1 - 7
lib/Cake/Core/Object.php

@@ -1,12 +1,5 @@
 <?php
 /**
- * Object class, allowing __construct and __destruct in PHP4.
- *
- * Also includes methods for logging and the special method RequestAction,
- * to call other Controllers' Actions from anywhere.
- *
- * PHP 5
- *
  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
  *
@@ -206,4 +199,5 @@ class Object {
 			}
 		}
 	}
+
 }