Skip to content

Commit

Permalink
Use typehint instead of throwing ourselves
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jul 26, 2019
1 parent e42b8ed commit 108973f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/midcom/helper/imagefilter.php
Expand Up @@ -315,12 +315,8 @@ private function _process_tempfile($tmpname)
* @param string $command The name of the callback to execute
* @param array $args The arguments passed to the callback
*/
private function execute_user_callback($command, $args)
private function execute_user_callback(callable $command, $args)
{
if (!is_callable($command)) {
throw new midcom_error("The function {$command} could not be found");
}

$tmpfile = $this->_get_tempfile();

if (!call_user_func($command, $this->_filename, $tmpfile, $args)) {
Expand Down

0 comments on commit 108973f

Please sign in to comment.