Completed
Push — add/export ( a51c2a )
by
unknown
09:12
created

Jetpack_JSON_API_Export_Endpoint::validate_call()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
// POST /sites/%s/export
4
class Jetpack_JSON_API_Export_Endpoint extends Jetpack_JSON_API_Endpoint {
5
	protected $needed_capabilities = 'export';
6
7
	protected function validate_call( $_blog_id, $capability, $check_manage_active = true ) {
8
		parent::validate_call( $_blog_id, $capability, false );
9
	}
10
11
	protected function result() {
12
13
		$args = $this->input();
0 ignored issues
show
Unused Code introduced by
$args is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
14
15
		// TODO: Add logic for exporting site content.
0 ignored issues
show
Coding Style Best Practice introduced by
Comments for TODO tasks are often forgotten in the code; it might be better to use a dedicated issue tracker.
Loading history...
16
17
		return array(
18
			'status'        => 'success',
19
			'download_url'  => 'uploads/2016/11/21/export.zip'
20
		);
21
	}
22
}
23