Completed
Push — master ( 32ad89...fdc0c0 )
by Jean-Christophe
03:20
created

CDNCoreCss::getCss()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Ajax\lib;
4
5
use Ajax\service\PhalconUtils;
6
7
class CDNCoreCss extends CDNBase {
8
	protected $cssUrl;
9
	protected $localCss;
10
	protected $framework;
11
12
	public function __construct($framework,$version, $provider="MaxCDN") {
13
		parent::__construct($version, $provider);
14
		$this->framework=$framework;
15
		$this->data=$this->data [$framework];
16
	}
17
18
	public function getUrl() {
19
		return $this->getUrlOrCss($this->jsUrl, "core");
20
	}
21
22
	public function getCss() {
23
		return $this->getUrlOrCss($this->cssUrl, "css");
24
	}
25
26
	public function __toString() {
27
		$url=$this->getUrl();
28
		$css=$this->getCss();
29
		return PhalconUtils::javascriptInclude($url, $this->local)."\n".PhalconUtils::stylesheetLink($css, $this->localCss);
30
		;
31
	}
32
33 View Code Duplication
	public function setCssUrl($cssUrl, $local=null) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
		$this->cssUrl=$cssUrl;
35
		if (isset($local)===false) {
36
			$local=PhalconUtils::startsWith($cssUrl, "http")===false;
37
		}
38
		$this->setLocalCss($local);
39
		return $this;
40
	}
41
42
	public function getLocalCss() {
43
		return $this->localCss;
44
	}
45
46
	public function setLocalCss($localCss) {
47
		$this->localCss=$localCss;
48
		return $this;
49
	}
50
51
	public function getFramework() {
52
		return $this->framework;
53
	}
54
55
}