Completed
Push — master ( d63594...458586 )
by Manuel
04:00 queued 01:36
created

Request   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 72.72%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
ccs 8
cts 11
cp 0.7272
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A validateMac() 0 6 1
1
<?php
2
3
namespace PiFinder\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
7
abstract class Request extends FormRequest
8
{
9 6
    public function __construct()
10
    {
11 6
        parent::__construct();
12
13 6
        $this->validateMac();
14 6
    }
15
16
    public function validateMac()
17
    {
18 6
        app('validator')->extend('mac', function ($attribute, $value, $parameters) {
0 ignored issues
show
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19 6
            return preg_match('/^(([0-9a-fA-F]{2}-){5}|([0-9a-fA-F]{2}:){5})[0-9a-fA-F]{2}$/', $value);
20 6
        });
21 6
    }
22
}
23