Passed
Push — master ( ca838e...76d3e9 )
by Radu
01:16
created

RequestUrlTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A guessAppUrl() 0 10 2
1
<?php
2
namespace WebServCo\Framework\Traits;
3
4
trait RequestUrlTrait
5
{
6
    public function guessAppUrl()
7
    {
8
        if (\WebServCo\Framework\Framework::isCLI()) {
9
            return false;
10
        }
11
        return $this->getSchema() .
0 ignored issues
show
Bug introduced by
It seems like getSchema() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

11
        return $this->/** @scrutinizer ignore-call */ getSchema() .
Loading history...
12
        '://' .
13
        $this->getHost() .
0 ignored issues
show
Bug introduced by
It seems like getHost() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        $this->/** @scrutinizer ignore-call */ 
14
               getHost() .
Loading history...
14
        $this->path .
0 ignored issues
show
Bug Best Practice introduced by
The property path does not exist on WebServCo\Framework\Traits\RequestUrlTrait. Did you maybe forget to declare it?
Loading history...
15
        DIRECTORY_SEPARATOR;
16
    }
17
}
18