Skip to content

Commit

Permalink
Merge pull request ampproject#7594 from ampproject/fix/docs-generate-…
Browse files Browse the repository at this point in the history
…command

Update docs generate command to run if PHP <= 7.4
  • Loading branch information
westonruter authored Jul 28, 2023
2 parents 58c87f4 + 0b72284 commit cebab46
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 cebab46

Please sign in to comment.