From 1f5e5af18a48e5d31a4de57beee3937607b61f2b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 11 Oct 2015 13:08:57 +1030 Subject: [PATCH] Fix ConfigureNotificationTypes API --- .../core/src/Event/ConfigureNotificationTypes.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/framework/core/src/Event/ConfigureNotificationTypes.php b/framework/core/src/Event/ConfigureNotificationTypes.php index 48df837b7..c33a354ad 100644 --- a/framework/core/src/Event/ConfigureNotificationTypes.php +++ b/framework/core/src/Event/ConfigureNotificationTypes.php @@ -10,6 +10,7 @@ namespace Flarum\Event; +use Flarum\Core\Notification\BlueprintInterface; use InvalidArgumentException; use ReflectionClass; @@ -25,17 +26,26 @@ class ConfigureNotificationTypes */ private $serializers; + /** + * @param array $blueprints + * @param array $serializers + */ public function __construct(array &$blueprints, array &$serializers = []) { $this->blueprints = &$blueprints; $this->serializers = &$serializers; } + /** + * @param string $blueprint + * @param string $serializer + * @param array $enabledByDefault + */ public function add($blueprint, $serializer, $enabledByDefault = []) { - if (! (new ReflectionClass($blueprint))->implementsInterface('Flarum\Core\Notification\Blueprint')) { + if (! (new ReflectionClass($blueprint))->implementsInterface(BlueprintInterface::class)) { throw new InvalidArgumentException('Notification blueprint ' . $blueprint - . ' must implement Flarum\Core\Notification\Blueprint'); + . ' must implement '.BlueprintInterface::class); } $this->blueprints[$blueprint] = $enabledByDefault;