if it's enabled then will throws exceptions
when extra params will not be parsed correctly
will be handy in development.
public static setStrictExtra ( boolean | true $set = true ) | ||
$set | boolean | true |
/** @test */ public function it_will_throw_exception_when_strict_extra_is_enabled() { $extra = null; $notification = ['body' => ['text' => 'Hi {to.username} hello {extra.hello}'], 'to' => ['username' => 'jhon'], 'extra' => json_encode($extra)]; NotifynderParser::setStrictExtra(true); $this->shouldThrow(ExtraParamsException::class)->during('parse', [$notification]); }
/** * Publish config files */ protected function config() { $this->publishes([__DIR__ . '/../config/notifynder.php' => config_path('notifynder.php'), __DIR__ . '/../migrations/' => base_path('/database/migrations')]); // Set use strict_extra config option, // you can toggle it in the configuraiton file $strictParam = $this->app['config']->get('notifynder.strict_extra', false); NotifynderParser::setStrictExtra($strictParam); }
/** * Publish config files. */ protected function config() { $this->publishes([__DIR__ . '/../config/notifynder.php' => config_path('notifynder.php')]); $this->mergeConfigFrom(__DIR__ . '/../config/notifynder.php', 'notifynder'); // Set use strict_extra config option, // you can toggle it in the configuration file $strictParam = $this->app['config']->get('notifynder.strict_extra', false); NotifynderParser::setStrictExtra($strictParam); }