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
Push — master ( 7a24d5...09959f )
by Cristian
02:56
created

ShowDetailsRow   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 23
rs 10
c 1
b 1
f 0
wmc 1
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A showDetailsRow() 0 10 1
1
<?php
2
3
namespace Backpack\CRUD\app\Http\Controllers\CrudFeatures;
4
5
trait ShowDetailsRow {
6
7
	/**
8
     * Used with AJAX in the list view (datatables) to show extra information about that row that didn't fit in the table.
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 122 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
9
     * It defaults to showing some dummy text.
10
     *
11
     * It's enabled by:
12
     * - setting: $crud->details_row = true;
13
     * - adding the details route for the entity; ex: Route::get('page/{id}/details', 'PageCrudController@showDetailsRow');
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 123 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
14
     * - adding a view with the following name to change what the row actually contains: app/resources/views/vendor/backpack/crud/details_row.blade.php
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 151 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
15
     */
16
    public function showDetailsRow($id)
17
    {
18
        $this->crud->hasAccessOrFail('details_row');
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...
19
20
        $this->data['entry'] = $this->crud->getEntry($id);
0 ignored issues
show
Bug introduced by
The property data 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...
21
        $this->data['crud'] = $this->crud;
22
23
        // load the view from /resources/views/vendor/backpack/crud/ if it exists, otherwise load the one in the package
24
        return view('crud::details_row', $this->data);
25
    }
26
27
}