clean_after_scan(); $wpephpc->test_version = $test_version; // Set scan type if 'scan' was passed in. if ( isset( $assoc_args['scan'] ) && 'active' === $assoc_args['scan'] ) { $wpephpc->only_active = 'yes'; } $results = $wpephpc->start_test(); WP_CLI::log( $results ); $wpephpc->clean_after_scan(); delete_option( 'wpephpcompat.scan_results' ); if ( preg_match( '/(\d*) ERRORS?/i', $results ) ) { WP_CLI::error( 'Your WordPress install is not compatible.' ); } else { WP_CLI::success( 'Your WordPress install is compatible.' ); } } } /** * Using this for now since there are issues with the PHPDoc syntax. * TODO: Use PHPDoc syntax. */ WP_CLI::add_command( 'phpcompat', 'PHPCompat_Command', array( 'shortdesc' => 'Test compatibility with different PHP versions.', 'synopsis' => array( array( 'type' => 'positional', 'name' => 'version', 'optional' => false, 'multiple' => false, ), array( 'type' => 'assoc', 'name' => 'scan', 'optional' => true, 'default' => 'active', 'options' => array( 'active', 'all' ), ), ), ) );