HttpGetInterruptions::doRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 13
rs 9.4285
1
<?php
2
/**
3
 * User: ms
4
 * Date: 17.09.15
5
 * Time: 00:22
6
 */
7
namespace Mvg\RequestHandler\Json;
8
9
use Zend\Http\Client;
10
use Zend\Json\Json as ZendJson;
11
12
class HttpGetInterruptions {
13
14
	/**
15
	 * @todo whats wrong with SSL?
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
16
	 * @return array
17
	 */
18
	public function doRequest() {
19
		$url = 'https://www.mvg.de/.rest/betriebsaenderungen/api/interruptions';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
20
		$client = new Client($url, array(
21
				'adapter' => 'Zend\Http\Client\Adapter\Curl',
22
				'curloptions' => array(
23
					CURLOPT_FOLLOWLOCATION => TRUE,
24
					CURLOPT_SSL_VERIFYPEER => FALSE
25
				)
26
			)
27
		);
28
		$client->setMethod(\Zend\Http\Request::METHOD_GET);
29
		return ZendJson::decode($client->send()->getBody());
30
	}
31
}
32
33
34
35
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
36