Completed
Push — master ( fff4cb...1e58f6 )
by frank
02:05
created

autoptimizeCLI::clear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
// Exit if accessed directly
3
if ( ! defined( 'ABSPATH' ) ) {
4
	exit;
5
}
6
7
class autoptimizeCLI extends WP_CLI_Command {
8
9
	/**
10
	 * Clears the cache.
11
	 *
12
	 * @subcommand clear
13
	 */
14
	public function clear( $args, $args_assoc ) {
15
		WP_CLI::line( esc_html__( 'Flushing the cache...', 'autoptimize' ) );
16
		autoptimizeCache::clearall();
17
		WP_CLI::success( esc_html__( 'Cache flushed.', 'autoptimize' ) );
18
	}
19
20
}
21
22
WP_CLI::add_command( 'autoptimize', 'autoptimizeCLI' );
23