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

SuccessResult::getInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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