RegularExpresionTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A generateRegularExpressionsOptionsArray() 0 10 2
1
<?php
2
3
namespace Mediadevs\Validator\Traits;
4
5
trait RegularExpresionTrait
6
{
7
    /**
8
     * Parsing through the expressions and generating a fitting output for the RegularExpression filter.
9
     *
10
     * @param array $regularExpressions
11
     *
12
     * @return array
13
     */
14 2
    protected function generateRegularExpressionsOptionsArray(array $regularExpressions): array
15
    {
16 2
        $output = ['options'];
17
18
        // Parsing through the expressions
19 2
        foreach ($regularExpressions as $regularExpression) {
20 2
            $output['options'] = ['regexp' => $regularExpression];
21
        }
22
23 2
        return $output;
24
    }
25
}
26