Passed
Push — master ( e4e152...8fde47 )
by Georgi
02:55
created

HasOptions   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 2 1
A defaultOptions() 0 3 1
A elements() 0 1 1
1
<?php 
2
3
namespace Epesi\Core\System\Integration\Modules\Concerns;
4
5
trait HasOptions
6
{
7
	/**
8
	 * Define the option elements and return as array
9
	 * Options are class specific and can be modified by the user
10
	 */
11
	public function elements() {}
12
		
13
	/**
14
	 * Define the server side form validation rules
15
	 */
16
	public function rules() {
17
		return [];
18
	}
19
	
20
	public function defaultOptions()
21
	{
22
		return collect($this->elements())->pluck('default', 'name');
1 ignored issue
show
Bug introduced by
Are you sure the usage of $this->elements() targeting Epesi\Core\System\Integr...\HasOptions::elements() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
23
	}
24
}