diff --git a/framework/core/src/Api/Controller/ListPostsController.php b/framework/core/src/Api/Controller/ListPostsController.php index c50175e5f..7b0e03f61 100644 --- a/framework/core/src/Api/Controller/ListPostsController.php +++ b/framework/core/src/Api/Controller/ListPostsController.php @@ -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); diff --git a/framework/core/src/Api/Serializer/AbstractSerializer.php b/framework/core/src/Api/Serializer/AbstractSerializer.php index 6d72455bc..9358f8dde 100644 --- a/framework/core/src/Api/Serializer/AbstractSerializer.php +++ b/framework/core/src/Api/Serializer/AbstractSerializer.php @@ -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; diff --git a/framework/core/src/Api/Serializer/DiscussionBasicSerializer.php b/framework/core/src/Api/Serializer/DiscussionBasicSerializer.php index b56044c4c..2285a1b20 100644 --- a/framework/core/src/Api/Serializer/DiscussionBasicSerializer.php +++ b/framework/core/src/Api/Serializer/DiscussionBasicSerializer.php @@ -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 [ diff --git a/framework/core/src/Api/Serializer/GroupSerializer.php b/framework/core/src/Api/Serializer/GroupSerializer.php index 81b514fb3..7c2bb5e33 100644 --- a/framework/core/src/Api/Serializer/GroupSerializer.php +++ b/framework/core/src/Api/Serializer/GroupSerializer.php @@ -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 [ diff --git a/framework/core/src/Api/Serializer/NotificationSerializer.php b/framework/core/src/Api/Serializer/NotificationSerializer.php index 45912300d..9ed67cd90 100644 --- a/framework/core/src/Api/Serializer/NotificationSerializer.php +++ b/framework/core/src/Api/Serializer/NotificationSerializer.php @@ -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 [ diff --git a/framework/core/src/Api/Serializer/PostBasicSerializer.php b/framework/core/src/Api/Serializer/PostBasicSerializer.php index 54b9475f5..ce2fdf706 100644 --- a/framework/core/src/Api/Serializer/PostBasicSerializer.php +++ b/framework/core/src/Api/Serializer/PostBasicSerializer.php @@ -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 = [ diff --git a/framework/core/src/Api/Serializer/UserBasicSerializer.php b/framework/core/src/Api/Serializer/UserBasicSerializer.php index 88d66f6a2..25e04ae40 100644 --- a/framework/core/src/Api/Serializer/UserBasicSerializer.php +++ b/framework/core/src/Api/Serializer/UserBasicSerializer.php @@ -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 [ diff --git a/framework/core/src/Core/Search/GambitManager.php b/framework/core/src/Core/Search/GambitManager.php index 5ee89841a..964bd210c 100644 --- a/framework/core/src/Core/Search/GambitManager.php +++ b/framework/core/src/Core/Search/GambitManager.php @@ -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)) { diff --git a/framework/core/src/Database/AbstractModel.php b/framework/core/src/Database/AbstractModel.php index 1dc702500..daa964532 100755 --- a/framework/core/src/Database/AbstractModel.php +++ b/framework/core/src/Database/AbstractModel.php @@ -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(); diff --git a/framework/core/src/Event/ConfigureNotificationTypes.php b/framework/core/src/Event/ConfigureNotificationTypes.php index d186721ac..9d3543114 100644 --- a/framework/core/src/Event/ConfigureNotificationTypes.php +++ b/framework/core/src/Event/ConfigureNotificationTypes.php @@ -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; diff --git a/framework/core/src/Http/GenerateRouteHandlerTrait.php b/framework/core/src/Http/GenerateRouteHandlerTrait.php index b8b901ee5..184805738 100644 --- a/framework/core/src/Http/GenerateRouteHandlerTrait.php +++ b/framework/core/src/Http/GenerateRouteHandlerTrait.php @@ -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));