More indentation cleanup

This commit is contained in:
Franz Liedke 2016-02-26 12:31:59 +09:00
parent b461f157ca
commit 730a46d885
11 changed files with 34 additions and 22 deletions

View File

@ -86,8 +86,9 @@ class ListPostsController extends AbstractCollectionController
if (($near = array_get($queryParams, 'page.near')) > 1) {
if (count($filter) > 1 || ! isset($filter['discussion']) || $sort) {
throw new InvalidParameterException('You can only use page[near] with '
.'filter[discussion] and the default sort order');
throw new InvalidParameterException(
'You can only use page[near] with filter[discussion] and the default sort order'
);
}
$offset = $this->posts->getIndexForNumber($filter['discussion'], $near, $actor);

View File

@ -121,8 +121,9 @@ abstract class AbstractSerializer extends BaseAbstractSerializer
);
if ($relationship && ! ($relationship instanceof Relationship)) {
throw new LogicException('GetApiRelationship handler must return an instance of '
.Relationship::class);
throw new LogicException(
'GetApiRelationship handler must return an instance of '.Relationship::class
);
}
return $relationship;

View File

@ -29,8 +29,9 @@ class DiscussionBasicSerializer extends AbstractSerializer
protected function getDefaultAttributes($discussion)
{
if (! ($discussion instanceof Discussion)) {
throw new InvalidArgumentException(get_class($this)
.' can only serialize instances of '.Discussion::class);
throw new InvalidArgumentException(
get_class($this).' can only serialize instances of '.Discussion::class
);
}
return [

View File

@ -43,8 +43,9 @@ class GroupSerializer extends AbstractSerializer
protected function getDefaultAttributes($group)
{
if (! ($group instanceof Group)) {
throw new InvalidArgumentException(get_class($this)
.' can only serialize instances of '.Group::class);
throw new InvalidArgumentException(
get_class($this).' can only serialize instances of '.Group::class
);
}
return [

View File

@ -37,8 +37,9 @@ class NotificationSerializer extends AbstractSerializer
protected function getDefaultAttributes($notification)
{
if (! ($notification instanceof Notification)) {
throw new InvalidArgumentException(get_class($this)
.' can only serialize instances of '.Notification::class);
throw new InvalidArgumentException(
get_class($this).' can only serialize instances of '.Notification::class
);
}
return [

View File

@ -30,8 +30,9 @@ class PostBasicSerializer extends AbstractSerializer
protected function getDefaultAttributes($post)
{
if (! ($post instanceof Post)) {
throw new InvalidArgumentException(get_class($this)
.' can only serialize instances of '.Post::class);
throw new InvalidArgumentException(
get_class($this).' can only serialize instances of '.Post::class
);
}
$attributes = [

View File

@ -29,8 +29,9 @@ class UserBasicSerializer extends AbstractSerializer
protected function getDefaultAttributes($user)
{
if (! ($user instanceof User)) {
throw new InvalidArgumentException(get_class($this)
.' can only serialize instances of '.User::class);
throw new InvalidArgumentException(
get_class($this).' can only serialize instances of '.User::class
);
}
return [

View File

@ -105,8 +105,9 @@ class GambitManager
foreach ($bits as $k => $bit) {
foreach ($gambits as $gambit) {
if (! $gambit instanceof GambitInterface) {
throw new LogicException('GambitInterface '.get_class($gambit)
.' does not implement '.GambitInterface::class);
throw new LogicException(
'Gambit '.get_class($gambit).' does not implement '.GambitInterface::class
);
}
if ($gambit->apply($search, $bit)) {

View File

@ -106,8 +106,9 @@ abstract class AbstractModel extends Eloquent
// value on the "relationships" array.
if (! $this->relationLoaded($key) && ($relation = $this->getCustomRelation($key))) {
if (! $relation instanceof Relation) {
throw new LogicException('Relationship method must return an object of type '
.'Illuminate\Database\Eloquent\Relations\Relation');
throw new LogicException(
'Relationship method must return an object of type '.Relation::class
);
}
return $this->relations[$key] = $relation->getResults();

View File

@ -44,8 +44,9 @@ class ConfigureNotificationTypes
public function add($blueprint, $serializer, $enabledByDefault = [])
{
if (! (new ReflectionClass($blueprint))->implementsInterface(BlueprintInterface::class)) {
throw new InvalidArgumentException('Notification blueprint '.$blueprint
.' must implement '.BlueprintInterface::class);
throw new InvalidArgumentException(
'Notification blueprint '.$blueprint.' must implement '.BlueprintInterface::class
);
}
$this->blueprints[$blueprint] = $enabledByDefault;

View File

@ -12,6 +12,7 @@ namespace Flarum\Http;
use Flarum\Http\Controller\ControllerInterface;
use Illuminate\Contracts\Container\Container;
use InvalidArgumentException;
use Psr\Http\Message\ServerRequestInterface;
trait GenerateRouteHandlerTrait
@ -26,8 +27,9 @@ trait GenerateRouteHandlerTrait
$controller = $container->make($class);
if (! ($controller instanceof ControllerInterface)) {
throw new \InvalidArgumentException('Route handler must be an instance of '
.ControllerInterface::class);
throw new InvalidArgumentException(
'Route handler must be an instance of '.ControllerInterface::class
);
}
$request = $request->withQueryParams(array_merge($request->getQueryParams(), $routeParams));