Skip to content

Commit

Permalink
Update docs generate command to run only if PHP <= 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Jul 28, 2023
1 parent 58c87f4 commit 0b72284
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/Cli/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ final class GenerateCommand {
* @param array $assoc_args Flags.
*/
public function __invoke( $args, $assoc_args ) {
// Bail if current PHP version is not supported.
// Current combination of phpDocumentor and nikic/php-parser supports 7.4 or less.
if ( ! version_compare( phpversion(), '7.4', '<=' ) ) {
WP_CLI::error( 'This command requires PHP 7.4 or less.' );
}

if ( empty( $args[0] ) ) {
$args[0] = AMP__DIR__;
}
Expand Down

0 comments on commit 0b72284

Please sign in to comment.