Completed
Push — master ( 59fb2e...bf9165 )
by Manuel
03:41
created

Request   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

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 7
    public function __construct()
10
    {
11 7
        parent::__construct();
12
13 7
        $this->validateMac();
14 7
    }
15
16
    public function validateMac()
17
    {
18 7
        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 7
            return preg_match('/^(([0-9a-fA-F]{2}-){5}|([0-9a-fA-F]{2}:){5})[0-9a-fA-F]{2}$/', $value);
20 7
        });
21 7
    }
22
}
23