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

Request::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.008

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 5
cp 0.8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1.008
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