private static function get_name_location_from_callback( $callback ) {
		$name       = $location = '';
		$reflection = false;
		if ( is_array( $callback ) && is_object( $callback[0] ) ) {
			$reflection = new \ReflectionMethod( $callback[0], $callback[1] );
			$name       = get_class( $callback[0] ) . '->' . $callback[1] . '()';
		} elseif ( is_array( $callback ) && method_exists( $callback[0], $callback[1] ) ) {
			$reflection = new \ReflectionMethod( $callback[0], $callback[1] );
			$name       = $callback[0] . '::' . $callback[1] . '()';
		} elseif ( is_object( $callback ) && is_a( $callback, 'Closure' ) ) {
			$reflection = new \ReflectionFunction( $callback );
			$name       = 'function(){}';
		} elseif ( is_string( $callback ) && function_exists( $callback ) ) {
			$reflection = new \ReflectionFunction( $callback );
			$name       = $callback . '()';
		}
		if ( $reflection ) {
			$location = $reflection->getFileName() . ':' . $reflection->getStartLine();
		}
		return array( $name, $location );
	}
private static function get_name_location_from_callback( $callback ) {
		$name       = $location = '';
		$reflection = false;
		if ( is_array( $callback ) && is_object( $callback[0] ) ) {
			$reflection = new \ReflectionMethod( $callback[0], $callback[1] );
			$name       = get_class( $callback[0] ) . '->' . $callback[1] . '()';
		} elseif ( is_array( $callback ) && method_exists( $callback[0], $callback[1] ) ) {
			$reflection = new \ReflectionMethod( $callback[0], $callback[1] );
			$name       = $callback[0] . '::' . $callback[1] . '()';
		} elseif ( is_object( $callback ) && is_a( $callback, 'Closure' ) ) {
			$reflection = new \ReflectionFunction( $callback );
			$name       = 'function(){}';
		} elseif ( is_string( $callback ) && function_exists( $callback ) ) {
			$reflection = new \ReflectionFunction( $callback );
			$name       = $callback . '()';
		}
		if ( $reflection ) {
			$location = $reflection->getFileName() . ':' . $reflection->getStartLine();
		}
		return array( $name, $location );
	}
private static function get_name_location_from_callback ( $ callback ) { $ name = $ location = '' ; $ reflection = false ; if ( is_array ( $ callback ) && is_object ( $ callback [ 0 ] ) ) { $ reflection = new \ ReflectionMethod ( $ callback [ 0 ] , $ callback [ 1 ] ) ; $ name = get_class ( $ callback [ 0 ] ) . '->' . $ callback [ 1 ] . '()' ; } elseif ( is_array ( $ callback ) && method_exists ( $ callback [ 0 ] , $ callback [ 1 ] ) ) { $ reflection = new \ ReflectionMethod ( $ callback [ 0 ] , $ callback [ 1 ] ) ; $ name = $ callback [ 0 ] . '::' . $ callback [ 1 ] . '()' ; } elseif ( is_object ( $ callback ) && is_a ( $ callback , 'Closure' ) ) { $ reflection = new \ ReflectionFunction ( $ callback ) ; $ name = 'function(){}' ; } elseif ( is_string ( $ callback ) && function_exists ( $ callback ) ) { $ reflection = new \ ReflectionFunction ( $ callback ) ; $ name = $ callback . '()' ; } if ( $ reflection ) { $ location = $ reflection -> getFileName ( ) . ':' . $ reflection -> getStartLine ( ) ; } return array ( $ name , $ location ) ; }
Get a human-readable name from a callback
Get a human - readable name from a callback