Fix remaining PSR-2 issues.

This commit is contained in:
Franz Liedke 2015-05-19 01:07:22 +02:00
parent 0ca4e1ab7b
commit 803d446bbb
2 changed files with 21 additions and 9 deletions

View File

@ -38,7 +38,9 @@ class CoreServiceProvider extends ServiceProvider
$bus->mapUsing(function ($command) {
return Bus::simpleMapping(
$command, 'Flarum\Core\Commands', 'Flarum\Core\Handlers\Commands'
$command,
'Flarum\Core\Commands',
'Flarum\Core\Handlers\Commands'
);
});
}

View File

@ -20,19 +20,29 @@ trait MappedMorphToTrait
// there are multiple types in the morph and we can't use single queries.
if (is_null($typeValue = $this->$type)) {
return new MappedMorphTo(
$this->newQuery(), $this, $id, null, $type, $name, $classes
$this->newQuery(),
$this,
$id,
null,
$type,
$name,
$classes
);
}
// If we are not eager loading the relationship we will essentially treat this
// as a belongs-to style relationship since morph-to extends that class and
// we will pass in the appropriate values so that it behaves as expected.
else {
} else {
// If we are not eager loading the relationship we will essentially treat this
// as a belongs-to style relationship since morph-to extends that class and
// we will pass in the appropriate values so that it behaves as expected.
$class = $classes[$typeValue];
$instance = new $class;
return new MappedMorphTo(
$instance->newQuery(), $this, $id, $instance->getKeyName(), $type, $name, $classes
$instance->newQuery(),
$this,
$id,
$instance->getKeyName(),
$type,
$name,
$classes
);
}
}