ScriptViewCreator::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace WebLAgence\LaravelFacebookPixel;
4
5
use Illuminate\View\View;
0 ignored issues
show
Bug introduced by
The type Illuminate\View\View 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...
6
7
/**
8
 * Class ScriptViewCreator
9
 * @package WebLAgence\LaravelFacebookPixel
10
 */
11
class ScriptViewCreator
12
{
13
    /**
14
     * @var LaravelFacebookPixel
15
     */
16
    protected $laravelFacebookPixel;
17
    
18
    /**
19
     * ScriptViewCreator constructor.
20
     * @param LaravelFacebookPixel $laravelFacebookPixel
21
     */
22
    public function __construct(LaravelFacebookPixel $laravelFacebookPixel)
23
    {
24
        $this->laravelFacebookPixel = $laravelFacebookPixel;
25
    }
26
    
27
    /**
28
     * @param View $view
29
     */
30
    public function create(View $view)
31
    {
32
        $view->with('enabled', $this->laravelFacebookPixel->isEnabled())
33
            ->with('nonce', $this->laravelFacebookPixel->getCspNonceCallback())
34
            ->with('id', $this->laravelFacebookPixel->id());
35
    }
36
}