Redirect::createRedirect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php namespace Arcanesoft\Seo\Models;
2
3
use Arcanedev\LaravelSeo\Models\Redirect as BaseRedirect;
4
5
/**
6
 * Class     Redirect
7
 *
8
 * @package  Arcanesoft\Seo\Models
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class Redirect extends BaseRedirect
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Create a redirection.
20
     *
21
     * @param  array  $attributes
22
     *
23
     * @return self
24
     */
25
    public static function createRedirect(array $attributes)
26
    {
27
        return tap(new static($attributes), function (self $redirect) {
28
            $redirect->save();
29
        });
30
    }
31
}
32