addDescription( 'Benchmarks JSMinPlus.' ); $this->addOption( 'file', 'Path to JS file', true, true ); } public function execute() { Wikimedia\suppressWarnings(); $content = file_get_contents( $this->getOption( 'file' ) ); Wikimedia\restoreWarnings(); if ( $content === false ) { $this->fatalError( 'Unable to open input file' ); } $filename = basename( $this->getOption( 'file' ) ); $parser = new JSParser(); $this->bench( [ "JSParser::parse ($filename)" => [ 'function' => function ( $parser, $content, $filename ) { $parser->parse( $content, $filename, 1 ); }, 'args' => [ $parser, $content, $filename ] ] ] ); } } $maintClass = BenchmarkJSMinPlus::class; require_once RUN_MAINTENANCE_IF_MAIN;