public function validate(): void
    {
        $paths = $this->getConfigPaths();

        foreach ($paths as $path) {
            WP_CLI::line(
                WP_CLI::colorize("%B====> Validating $path%n")
            );

            try {
                Toml::parseFile($path);
                WP_CLI::success("File '$path' is valid.");
            } catch (ParseException $parseException) {
                WP_CLI::error_multi_line([
                    $parseException->getMessage(),
                ]);

                WP_CLI::warning("File '$path' will be ignored.");
            }

            // Print a empty line for better UX.
            WP_CLI::line('');
        }
    }
public function validate(): void
    {
        $paths = $this->getConfigPaths();

        foreach ($paths as $path) {
            WP_CLI::line(
                WP_CLI::colorize("%B====> Validating $path%n")
            );

            try {
                Toml::parseFile($path);
                WP_CLI::success("File '$path' is valid.");
            } catch (ParseException $parseException) {
                WP_CLI::error_multi_line([
                    $parseException->getMessage(),
                ]);

                WP_CLI::warning("File '$path' will be ignored.");
            }

            // Print a empty line for better UX.
            WP_CLI::line('');
        }
    }
public function validate ( ) : void { $ paths = $ this -> getConfigPaths ( ) ; foreach ( $ paths as $ path ) { WP_CLI :: line ( WP_CLI :: colorize ( "%B====> Validating $path%n" ) ) ; try { Toml :: parseFile ( $ path ) ; WP_CLI :: success ( "File '$path' is valid." ) ; } catch ( ParseException $ parseException ) { WP_CLI :: error_multi_line ( [ $ parseException -> getMessage ( ) , ] ) ; WP_CLI :: warning ( "File '$path' will be ignored." ) ; } // Print a empty line for better UX. WP_CLI :: line ( '' ) ; } }
Validates the TOML syntax of all config files.

## EXAMPLES

# Validate the TOML syntax of the config files
$ wp preflight config validate
Validates the TOML syntax of all config files .