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

Test Setup Failed
Pull Request — master (#3490)
by
unknown
16:50
created

CanChangeRouteKey   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 17
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 3 2
A getRouteKeyName() 0 3 1
1
<?php
2
3
namespace Backpack\CRUD\app\Models\Traits;
4
/**
5
 * Allows the ability to change the exposed route key simply by setting the public $routeKey parameter.
6
 * public $routeKey = 'uuid';
7
 */
8
9
trait CanChangeRouteKey{
10
	
11
12
		    /**
13
	 * Get the route key for the model.
14
	 *
15
	 * @return string
16
	 */
17
	public function getRouteKeyName()
18
	{
19
	  return $this->routeKey ?? parent::getRouteKeyName();
20
	}
21
22
23
	public function getKey()
24
	{	
25
		return $this->routeKey ? $this->{$this->getRouteKeyName()} : parent::getKey();	
26
	}
27
}