Passed
Push — master ( c0a3a7...3b84a4 )
by Jeroen
58:51
created

SuccessResult   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 3 1
A __construct() 0 3 1
1
<?php
2
/**
3
 * SuccessResult
4
 * Generic success result class, extend if you want to do something special.
5
 *
6
 * @package    Elgg.Core
7
 * @subpackage WebServicesAPI
8
 */
9
class SuccessResult extends GenericResult {
10
	// Do not change this from 0
11
	public static $RESULT_SUCCESS = 0;
12
13
	/**
14
	 * A new success result
15
	 *
16
	 * @param string $result The result
17
	 */
18 2
	public function __construct($result) {
19 2
		$this->setResult($result);
20 2
		$this->setStatusCode(SuccessResult::$RESULT_SUCCESS);
21 2
	}
22
23
	/**
24
	 * Returns a new instance of this class
25
	 *
26
	 * @param unknown $result A result of some kind?
0 ignored issues
show
Bug introduced by Brett Profitt
The type unknown was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
	 *
28
	 * @return SuccessResult
29
	 */
30 2
	public static function getInstance($result) {
31
		// Return a new error object.
32 2
		return new SuccessResult($result);
33
	}
34
}
35