HttpPostNewsTicker   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 30
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B doPostRequest() 0 27 1
1
<?php
2
/**
3
 * User: ms
4
 * Date: 14.09.15
5
 * Time: 21:55
6
 */
7
8
namespace Mvg\RequestHandler\Html;
9
10
use Zend\Http\Client;
11
12
class HttpPostNewsTicker {
13
14
	public function doPostRequest() {
15
		$url = 'http://www.mvg-live.de/MvgLive/mvglive/rpc/newstickerService';
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...
16
		$client = new Client();
17
		$client->setUri($url);
18
		$client->setMethod(\Zend\Http\Request::METHOD_POST);
19
20
		$headers = array(
21
			'Origin' => 'http://www.mvg-live.de'
22
		, 'Accept-Encoding' => 'gzip, deflate'
23
		, 'Accept-Language' => 'de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4,da;q=0.2'
24
		, 'X-GWT-Module-Base' => 'http://www.mvg-live.de/MvgLive/mvglive/'
25
		, 'Connection' => 'keep-alive'
26
		, 'Cache-Control' => 'no-cache'
27
		, 'Pragma' => 'no-cache'
28
		, 'User-Agent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36'
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 127 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
29
		, 'Content-Type' => 'text/x-gwt-rpc; charset=UTF-8'
30
		, 'Accept' => '*/*'
31
		, 'X-GWT-Permutation' => '1DD521F1FA9966B50432692AB421CD55'
32
		, 'Referer' => 'http://www.mvg-live.de/MvgLive/MvgLive.jsp'
33
		, 'DNT' => '1'
34
35
		);
36
		$client->setHeaders($headers);
37
		$client->setRawBody('7|0|4|http://www.mvg-live.de/MvgLive/mvglive/|7690A2A77A0295D3EC713772A06B8898|de.swm.mvglive.gwt.client.newsticker.GuiNewstickerService|getNewsticker|1|2|3|4|0|');
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 187 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
38
		$response = $client->send();
39
		return $response->getBody();
40
	}
41
}