GlobalComposer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 8 2
1
<?php
2
3
namespace Larafolio\Http\ViewComposers;
4
5
use Auth;
6
use Illuminate\View\View;
7
use Larafolio\Models\Project;
8
9
class GlobalComposer
10
{
11
    /**
12
     * Bind data to the view.
13
     *
14
     * @param /Illuminate\View\View $view
0 ignored issues
show
Documentation introduced by
The doc-type /Illuminate\View\View could not be parsed: Unknown type name "/Illuminate\View\View" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
15
     */
16
    public function compose(View $view)
17
    {
18
        $user = Auth::user();
19
20
        $projects = $user ? Project::all() : collect([]);
21
22
        $view->with('navProjects', $projects);
23
    }
24
}
25