Swear   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPatterns() 0 14 3
1
<?php
2
3
namespace Spinzar\Firewall\Middleware;
4
5
use Spinzar\Firewall\Abstracts\Middleware;
6
7
class Swear extends Middleware
8
{
9
    public function getPatterns()
10
    {
11
        $patterns = [];
12
13
        if (!$words = config('firewall.middleware.' . $this->middleware . '.words')) {
14
            return $patterns;
15
        }
16
17
        foreach ((array) $words as $word) {
18
            $patterns[] = '#\b' . $word . '\b#i';
19
        }
20
21
        return $patterns;
22
    }
23
}
24