generateRegularExpressionsOptionsArray()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 10
cc 2
nc 2
nop 1
crap 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