Passed
Push — ft/pagefield ( 5094ff )
by
unknown
10:45
created

HasPageSelect   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 4
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A pageLink() 0 2 1
1
<?php
2
3
namespace Thinktomorrow\Chief\Concerns;
4
5
use Thinktomorrow\Chief\FlatReferences\FlatReferenceFactory;
6
7
trait HasPageSelect
8
{
9
    public function pageLink($column, $locale = null){
10
        return FlatReferenceFactory::fromString($this->$column)->instance()->url($locale ?? app()->getLocale());
0 ignored issues
show
introduced by
The method getLocale() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

10
        return FlatReferenceFactory::fromString($this->$column)->instance()->url($locale ?? app()->/** @scrutinizer ignore-call */ getLocale());
Loading history...
11
    }
12
}
13