private function do_route( $class_name, $method_name, $named_arguments, $on_error ) {
		if ( \is_object( $class_name ) ) {
			return $this->call(
				array(
					$class_name,
					$method_name,
				),
				$named_arguments
			);
		}

		$injector_factory = new Dependency_Injection_Factory(
			$class_name,
			$method_name,
			$named_arguments
		);

		list(
			$obj,
			$dependencies,
			$validators
		) = $injector_factory->build();

		// Check all validators
		foreach ( $validators as $validator ) {
			$message = $validator->validate( $on_error );

			if ( $message ) {
				return $message;
			}
		}

		return $this->call(
			array(
				$obj,
				$method_name,
			),
			$dependencies
		);
	}
private function do_route( $class_name, $method_name, $named_arguments, $on_error ) {
		if ( \is_object( $class_name ) ) {
			return $this->call(
				array(
					$class_name,
					$method_name,
				),
				$named_arguments
			);
		}

		$injector_factory = new Dependency_Injection_Factory(
			$class_name,
			$method_name,
			$named_arguments
		);

		list(
			$obj,
			$dependencies,
			$validators
		) = $injector_factory->build();

		// Check all validators
		foreach ( $validators as $validator ) {
			$message = $validator->validate( $on_error );

			if ( $message ) {
				return $message;
			}
		}

		return $this->call(
			array(
				$obj,
				$method_name,
			),
			$dependencies
		);
	}
private function do_route ( $ class_name , $ method_name , $ named_arguments , $ on_error ) { if ( \ is_object ( $ class_name ) ) { return $ this -> call ( array ( $ class_name , $ method_name , ) , $ named_arguments ) ; } $ injector_factory = new Dependency_Injection_Factory ( $ class_name , $ method_name , $ named_arguments ) ; list ( $ obj , $ dependencies , $ validators ) = $ injector_factory -> build ( ) ; // Check all validators foreach ( $ validators as $ validator ) { $ message = $ validator -> validate ( $ on_error ) ; if ( $ message ) { return $ message ; } } return $ this -> call ( array ( $ obj , $ method_name , ) , $ dependencies ) ; }
Resolve dependencies for dependency injection
and call the given route

@param string   $class_name      The class to route to
@param string   $method_name     The method name to call in the give class
@param array    $named_arguments Associative array of suggested arguments
@param callback $on_error        Callback if a validator fails
@return mixed
@throws \ReflectionException
Resolve dependencies for dependency injection and call the given route