Completed
Push — master ( 2a80b0...92a56e )
by Chris
02:42
created

Application   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A basePath() 0 9 2
1
<?php
2
namespace Darya\Foundation;
3
4
use Darya\Service\Application as BaseApplication;
5
6
class Application extends BaseApplication
7
{
8
	/**
9
	 * @var string
10
	 */
11
	protected $basePath;
12
	
13
	/**
14
	 * Instantiate a new Darya application.
15
	 * 
16
	 * @param string $basePath [optional]
17
	 * @param array  $services [optional]
18
	 */
19
	public function __construct($basePath = null, array $services = array())
20
	{
21
		$this->setBasePath($basePath);
0 ignored issues
show
Bug introduced by
The method setBasePath() does not exist on Darya\Foundation\Application. Did you maybe mean basePath()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
22
		
23
		parent::__construct($services);
24
	}
25
	
26
	/**
27
	 * Retrieve and optionally set the base path of the application.
28
	 * 
29
	 * @param string $basePath [optional]
30
	 * @return string
31
	 */
32
	public function basePath($basePath = null)
33
	{
34
		if ($basePath) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $basePath of type string|null is loosely compared to true; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
35
			$this->basePath = $basePath;
36
			$this->set('path', $this->basePath);
37
		}
38
		
39
		return $this->basePath;
40
	}
41
}
42