mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:38:08 +08:00
Fix remaining PSR-2 issues.
This commit is contained in:
parent
0ca4e1ab7b
commit
803d446bbb
@ -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'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user