GlobalComposer::compose()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
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