various: code style

This commit is contained in:
Thomas Gelf 2016-03-20 16:38:00 +01:00
parent f77e9433d0
commit e30bafc62e
3 changed files with 10 additions and 5 deletions

View File

@ -21,7 +21,7 @@ class HousekeepingCommand extends Command
$len = array_reduce(
$tasks,
function($max, $task) {
function ($max, $task) {
return max(
$max,
strlen($task->title) + strlen($task->name) + 3
@ -31,8 +31,8 @@ class HousekeepingCommand extends Command
if (count($tasks)) {
print "\n";
printf(" %-" . $len . "s | %s\n", 'Housekeeping task (name)', 'Count');
printf("-%-" . $len . "s-|-------\n", str_repeat('-', $len));
printf(" %-" . $len . "s | %s\n", 'Housekeeping task (name)', 'Count');
printf("-%-" . $len . "s-|-------\n", str_repeat('-', $len));
}
foreach ($tasks as $task) {

View File

@ -942,7 +942,12 @@ abstract class DbObject
//return false;
$class = get_called_class();
if (! array_key_exists($class, self::$prefetchStats)) {
self::$prefetchStats[$class] = (object) array('miss' => 0, 'hits' => 0, 'hitNames' => 0, 'combinedMiss' => 0);
self::$prefetchStats[$class] = (object) array(
'miss' => 0,
'hits' => 0,
'hitNames' => 0,
'combinedMiss' => 0
);
}
if (is_array($key)) {

View File

@ -58,7 +58,7 @@ class Housekeeping
{
return array_filter(
$this->getTaskSummary(),
function($task) {
function ($task) {
return $task->count > 0;
}
);