mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 08:31:12 +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) {
|
$bus->mapUsing(function ($command) {
|
||||||
return Bus::simpleMapping(
|
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.
|
// there are multiple types in the morph and we can't use single queries.
|
||||||
if (is_null($typeValue = $this->$type)) {
|
if (is_null($typeValue = $this->$type)) {
|
||||||
return new MappedMorphTo(
|
return new MappedMorphTo(
|
||||||
$this->newQuery(), $this, $id, null, $type, $name, $classes
|
$this->newQuery(),
|
||||||
|
$this,
|
||||||
|
$id,
|
||||||
|
null,
|
||||||
|
$type,
|
||||||
|
$name,
|
||||||
|
$classes
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
|
// If we are not eager loading the relationship we will essentially treat this
|
||||||
// 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
|
||||||
// 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.
|
||||||
// we will pass in the appropriate values so that it behaves as expected.
|
|
||||||
else {
|
|
||||||
$class = $classes[$typeValue];
|
$class = $classes[$typeValue];
|
||||||
$instance = new $class;
|
$instance = new $class;
|
||||||
|
|
||||||
return new MappedMorphTo(
|
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