Completed
Push — dev ( 4f11ce...5d65d1 )
by Alies
06:00 queued 01:47
created

WidgetController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 28
c 0
b 0
f 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setTranslatable() 0 4 1
A setLocalesAttributes() 0 4 1
A index() 0 3 1
1
<?php
2
3
namespace Diglabby\Doika\Http\Controllers\Widget;
4
5
use App\Http\Controllers\Controller;
6
use App\Repositories\Contracts\TagRepository;
0 ignored issues
show
Bug introduced by
The type App\Repositories\Contracts\TagRepository was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use App\Repositories\Contracts\UserRepository;
0 ignored issues
show
Bug introduced by
The type App\Repositories\Contracts\UserRepository was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Illuminate\Contracts\Support\Renderable;
9
use Illuminate\Support\Facades\View;
10
11
class WidgetController extends Controller
12
{
13
    public function index(): Renderable
14
    {
15
        return view('widget.campaign');
16
    }
17
18
    /**
19
     * Push attributes in order to correctly localize slugs.
20
     *
21
     * @param $attributes
22
     */
23
    protected function setLocalesAttributes($attributes)
24
    {
25
        View::composer(['partials.alternates', 'partials.locales'], function (\Illuminate\View\View $view) use ($attributes) {
26
            $view->withAttributes($attributes);
27
        });
28
    }
29
30
    /**
31
     * Push translatable object in order to correctly localize slugs.
32
     *
33
     * @param $translatable
34
     */
35
    protected function setTranslatable($translatable)
36
    {
37
        View::composer(['partials.alternates', 'partials.locales'], function (\Illuminate\View\View $view) use ($translatable) {
38
            $view->withTranslatable($translatable);
39
        });
40
    }
41
}
42