WebAppManifestResource::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Elgg\Http;
3
4
use ElggSite;
5
6
/**
7
 * Overview: http://html5doctor.com/web-manifest-specification/
8
 * Spec: https://w3c.github.io/manifest/
9
 *
10
 * Support was added to Chrome 39 and is expected to come to Firefox soon.
11
 *
12
 * @package    Elgg.Core
13
 * @subpackage Http
14
 * @since      1.10
15
 *
16
 * @access private
17
 */
18
class WebAppManifestResource {
19
	/** @var ElggSite */
20
	private $site;
21
	
22
	/**
23
	 * Constructor
24
	 * 
25
	 * @param ElggSite $site The site serving this manifest.
26
	 */
27
	public function __construct(ElggSite $site) {
28
		$this->site = $site;
29
	}
30
	
31
	/**
32
	 * Behavior for HTTP GET method
33
	 * 
34
	 * @return array
35
	 */
36
	public function get() {
37
		return [
38
			'display' => 'standalone',
39
			'name' => $this->site->getDisplayName(),
40
			'start_url' => $this->site->getUrl(),
41
		];
42
	}
43
}