Skip to content

Commit

Permalink
Fix coding standards in Core/
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 4, 2012
1 parent 61aba0f commit 63c992a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
15 changes: 8 additions & 7 deletions lib/Cake/Core/App.php
Expand Up @@ -223,7 +223,7 @@ public static function path($type, $plugin = null) {
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);
Expand Down Expand Up @@ -372,7 +372,7 @@ public static function themePath($theme) {
$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;
Expand Down Expand Up @@ -462,7 +462,7 @@ public static function objects($type, $path = null, $cache = true) {
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) {
Expand Down Expand Up @@ -536,7 +536,7 @@ public static function load($className) {

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 {
Expand Down Expand Up @@ -710,7 +710,7 @@ protected static function _loadFile($name, $plugin, $search, $file, $return) {
if ($return) {
return $returnValue;
}
return (bool) $returnValue;
return (bool)$returnValue;
}
return false;
}
Expand All @@ -726,7 +726,7 @@ protected static function _loadFile($name, $plugin, $search, $file, $return) {
*/
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');
Expand All @@ -744,7 +744,7 @@ protected static function _loadVendor($name, $plugin, $file, $ext) {
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;
}
}
}
Expand Down Expand Up @@ -887,4 +887,5 @@ public static function shutdown() {
Cache::write('object_map', self::$_objects, '_cake_core_');
}
}

}
7 changes: 4 additions & 3 deletions lib/Cake/Core/CakePlugin.php
Expand Up @@ -126,7 +126,7 @@ public static function loadAll($options = array()) {
if ($opts === null && isset($options[0])) {
$opts = $options[0];
}
self::load($p, (array) $opts);
self::load($p, (array)$opts);
}
}

Expand Down Expand Up @@ -162,7 +162,7 @@ public static function bootstrap($plugin) {

$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'];
Expand Down Expand Up @@ -191,7 +191,7 @@ public static function routes($plugin = null) {
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';
}

/**
Expand Down Expand Up @@ -224,4 +224,5 @@ public static function unload($plugin = null) {
unset(self::$_plugins[$plugin]);
}
}

}
6 changes: 3 additions & 3 deletions lib/Cake/Core/Configure.php
Expand Up @@ -69,13 +69,13 @@ public static function bootstrap($boot = true) {
'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;
Expand Down Expand Up @@ -335,5 +335,5 @@ public static function restore($name, $cacheConfig = 'default') {
}
return false;
}
}

}
8 changes: 1 addition & 7 deletions 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)
*
Expand Down Expand Up @@ -206,4 +199,5 @@ protected function _mergeVars($properties, $class, $normalize = true) {
}
}
}

}

0 comments on commit 63c992a

Please sign in to comment.