Instead of constructing the class name and then trying to instantiate it, use class_exist to see if it exists. This should also simplify debugging when writing new rolls to keep from having to add logging in the catch blocks.
|
$roll = new $class($this->text, $channel->username, $channel); |
Instead of constructing the class name and then trying to instantiate it, use class_exist to see if it exists. This should also simplify debugging when writing new rolls to keep from having to add logging in the catch blocks.
commlink/app/Http/Controllers/SlackController.php
Line 84 in 89034e2