GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Renderable   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 11
c 2
b 1
f 0
dl 0
loc 47
ccs 13
cts 13
cp 1
rs 10
wmc 6

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A render() 0 5 1
A getView() 0 7 3
A setView() 0 5 1
1
<?php
2
3
namespace SleepingOwl\Admin\Traits;
4
5
use Illuminate\View\View;
6
7
trait Renderable
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $viewPath;
13
14
    /**
15
     * @param string|View $view
16
     *
17
     * @return $this
18
     */
19 4
    public function setView($view)
20
    {
21 4
        $this->viewPath = $view;
22
23 4
        return $this;
24
    }
25
26
    /**
27
     * @return View|string
28
     */
29 12
    public function getView()
30
    {
31 12
        if (empty($this->viewPath) && property_exists($this, 'view')) {
32 7
            return $this->view;
33
        }
34
35 7
        return $this->viewPath;
36
    }
37
38
    /**
39
     * @return string
40
     */
41 1
    public function __toString()
42
    {
43 1
        return (string) $this->render();
44
    }
45
46
    /**
47
     * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
48
     */
49 5
    public function render()
50
    {
51 5
        return app('sleeping_owl.template')->view(
0 ignored issues
show
Bug introduced by
The method view() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

51
        return app('sleeping_owl.template')->/** @scrutinizer ignore-call */ view(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
52 5
            $this->getView(),
53 5
            $this->toArray()
0 ignored issues
show
Bug introduced by
It seems like toArray() 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

53
            $this->/** @scrutinizer ignore-call */ 
54
                   toArray()
Loading history...
54 5
        );
55
    }
56
}
57