WebAppManifestResource   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 7 1
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
}