GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

BladeDirectiveHelpers   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A parseExpression() 0 9 3
1
<?php
2
3
namespace ProtoneMedia\LaravelMixins\Blade;
4
5
use Illuminate\Support\Facades\Blade;
6
7
trait BladeDirectiveHelpers
8
{
9
    /**
10
     * Strips the parentheses from the expression and splits the arguments into parts.
11
     * It returns an array containing the parts or the given defaults for each part.
12
     *
13
     * @param string $expression
14
     * @param array $defaults
15
     * @return array
16
     */
17
    public static function parseExpression(string $expression, array $defaults = []): array
18
    {
19
        $parts = explode(',', Blade::stripParentheses($expression));
20
21
        foreach ($defaults as $key => $default) {
22
            $parts[$key] = isset($parts[$key]) ? trim($parts[$key]) : $default;
23
        }
24
25
        return $parts;
26
    }
27
}
28