HomeComposer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 12 3
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use Illuminate\View\View;
6
use Illuminate\Mail\Markdown;
7
8
class HomeComposer
9
{
10
    /**
11
     * Bind data to the view.
12
     *
13
     * @param View $view
14
     * @return void
15
     */
16
    public function compose(View $view)
17
    {
18
        $announce = false;
19
        if (config('kleis.announce')) {
20
            $mdfile = public_path('markdown/'.config('kleis.announce'));
21
            if (file_exists($mdfile)) {
22
                $text = file_get_contents($mdfile);
23
                $announce = Markdown::parse($text)->toHtml();
24
            }
25
        }
26
        $view->with('announce', $announce);
27
    }
28
}
29