AutoInitTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A autoInit() 0 9 3
1
<?php
2
3
namespace ByTIC\GoogleRecaptcha\Config\Traits;
4
5
/**
6
 * Trait AutoInitTrait
7
 * @package ByTIC\GoogleRecaptcha\Config\Traits
8
 */
9
trait AutoInitTrait
10
{
11
    /**
12
     * @return static
13
     */
14
    public static function autoInit()
15
    {
16
        if (static::canInitFromConfig()) {
17
            return static::fromConfig();
18
        }
19
        if (static::canInitFromEnv()) {
20
            return static::fromEnv();
21
        }
22
        return new static();
23
    }
24
}