src/Hametuha/HametWoo/Pattern/Validator.php
public static function validate() {
		$instance = static::get_instance();
		$error = new \WP_Error();
		foreach ( get_class_methods( $instance ) as $method ) {
			$repl = new \ReflectionMethod( get_called_class(), $method );
			// Check if method is public.
			if ( ! $repl->isPublic() ) {
				continue;
			}
			// Check if method start with 'test_'.
			if ( 0 !== strpos( $method, 'test_' ) ) {
				continue;
			}
			$result = call_user_func( [ $instance, $method ] );
			if ( is_wp_error( $result ) ) {
				$error->add( $result->get_error_code(), $result->get_error_message() );
			}
		}
		return $error->get_error_messages()? $error : true;
	}
public static function validate() {
		$instance = static::get_instance();
		$error = new \WP_Error();
		foreach ( get_class_methods( $instance ) as $method ) {
			$repl = new \ReflectionMethod( get_called_class(), $method );
			// Check if method is public.
			if ( ! $repl->isPublic() ) {
				continue;
			}
			// Check if method start with 'test_'.
			if ( 0 !== strpos( $method, 'test_' ) ) {
				continue;
			}
			$result = call_user_func( [ $instance, $method ] );
			if ( is_wp_error( $result ) ) {
				$error->add( $result->get_error_code(), $result->get_error_message() );
			}
		}
		return $error->get_error_messages()? $error : true;
	}
public static function validate ( ) { $ instance = static :: get_instance ( ) ; $ error = new \ WP_Error ( ) ; foreach ( get_class_methods ( $ instance ) as $ method ) { $ repl = new \ ReflectionMethod ( get_called_class ( ) , $ method ) ; // Check if method is public. if ( ! $ repl -> isPublic ( ) ) { continue ; } // Check if method start with 'test_'. if ( 0 !== strpos ( $ method , 'test_' ) ) { continue ; } $ result = call_user_func ( [ $ instance , $ method ] ) ; if ( is_wp_error ( $ result ) ) { $ error -> add ( $ result -> get_error_code ( ) , $ result -> get_error_message ( ) ) ; } } return $ error -> get_error_messages ( ) ? $ error : true ; }
Validate all method

@return bool|\WP_Error
Validate all method