}
foreach ( $info['callbacks'] as $name => $cb ) {
+ if ( !is_callable( $cb ) ) {
+ if ( is_array( $cb ) ) {
+ $cb = '[ ' . implode( ', ', $cb ) . ' ]';
+ }
+ throw new UnexpectedValueException( "callback '$cb' is not callable" );
+ }
call_user_func( $cb, $info['credits'][$name] );
}
}
protected function processAutoLoader( $dir, array $info ) {
if ( isset( $info['AutoloadClasses'] ) ) {
// Make paths absolute, relative to the JSON file
- return array_map( function( $file ) use ( $dir ) {
+ return array_map( function ( $file ) use ( $dir ) {
return "$dir/$file";
}, $info['AutoloadClasses'] );
} else {