Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#61)
by Oliver
01:31
created

PageTemplates::about_us()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
trait PageTemplates
6
{
7
    /*
8
    |--------------------------------------------------------------------------
9
    | Page Templates for Backpack\PageManager
10
    |--------------------------------------------------------------------------
11
    |
12
    | Each page template has its own method, that define what fields should show up using the Backpack\CRUD API.
13
    | Use snake_case for naming and PageManager will make sure it looks pretty in the create/update form
14
    | template dropdown.
15
    |
16
    | Any fields defined here will show up after the standard page fields:
17
    | - select template
18
    | - page name (only seen by admins)
19
    | - page title
20
    | - page slug
21
    */
22
23
    private function services()
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
24
    {
25
        $this->crud->addField([   // CustomHTML
0 ignored issues
show
Bug introduced by
The property crud does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
26
                        'name' => 'metas_separator',
27
                        'type' => 'custom_html',
28
                        'value' => '<br><h2>'.trans('backpack::pagemanager.metas').'</h2><hr>',
29
                    ]);
30
        $this->crud->addField([
31
                        'name' => 'meta_title',
32
                        'label' => trans('backpack::pagemanager.meta_title'),
33
                        'fake' => true,
34
                        'store_in' => 'extras',
35
                    ]);
36
        $this->crud->addField([
37
                        'name' => 'meta_description',
38
                        'label' => trans('backpack::pagemanager.meta_description'),
39
                        'fake' => true,
40
                        'store_in' => 'extras',
41
                    ]);
42
        $this->crud->addField([
43
                        'name' => 'meta_keywords',
44
                        'type' => 'textarea',
45
                        'label' => trans('backpack::pagemanager.meta_keywords'),
46
                        'fake' => true,
47
                        'store_in' => 'extras',
48
                    ]);
49
        $this->crud->addField([   // CustomHTML
50
                        'name' => 'content_separator',
51
                        'type' => 'custom_html',
52
                        'value' => '<br><h2>'.trans('backpack::pagemanager.content').'</h2><hr>',
53
                    ]);
54
        $this->crud->addField([
55
                        'name' => 'content',
56
                        'label' => trans('backpack::pagemanager.content'),
57
                        'type' => 'wysiwyg',
58
                        'placeholder' => trans('backpack::pagemanager.content_placeholder'),
59
                    ]);
60
    }
61
}
62