Passed
Push — master ( d46c59...5ccd99 )
by Martin
05:38
created

SeatMapLayout::passes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace App\Rules;
4
5
use Illuminate\Contracts\Validation\Rule;
6
7
class SeatMapLayout implements Rule
8
{
9
    /**
10
     * Create a new rule instance.
11
     *
12
     * @return void
13
     */
14
    public function __construct()
15
    {
16
        $name = 'my_layout-validation';
17
        $this->name = $name;
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
18
    }
19
20
    /**
21
     * Determine if the validation rule passes.
22
     * Only allow structures like...
23
     * 
24
     * 'aaaaaaa______aaaaaaa',
25
     * 'aaaaaaaaa____aaaaaaa',
26
     * 'aaaaaaaaa____aaaaaaa',
27
     * 'aaaaaaaaa____aaaaaaa',
28
     * 'aaaaaaaaa____aaaaaa',
29
     * 'aaaaaaaaaa__aaaaaa',
30
     * 'aaaaaaaaaaaaaaaaaa',
31
     *
32
     * @param  string  $attribute name of the validated field
33
     * @param  mixed  $value of the validated field
34
     * @return bool
35
     */
36
    public function passes($attribute, $value)
37
    {
38
        // Only 
39
        return true;
40
    }
41
42
    /**
43
     * Get the validation error message.
44
     *
45
     * @return string
46
     */
47
    public function message()
48
    {
49
        return 'The layout does not comply to the required format.';
50
    }
51
}
52