Provider::findOwn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: dsmrt
5
 * Date: 1/12/18
6
 * Time: 10:44 PM
7
 */
8
9
namespace flipbox\saml\sp\services;
10
11
use flipbox\saml\core\EnsureSAMLPlugin;
12
use flipbox\saml\core\services\AbstractProviderService;
13
use flipbox\saml\sp\Saml;
14
use flipbox\saml\sp\traits\SamlPluginEnsured;
15
16
/**
17
 * Class Provider
18
 *
19
 * @package flipbox\saml\sp\services
20
 */
21
class Provider extends AbstractProviderService
22
{
23
    use SamlPluginEnsured;
24
25
    /**
26
     * @inheritdoc
27
     */
28 3
    public function findOwn()
29
    {
30 3
        return $this->findByEntityId(Saml::getInstance()->getSettings()->getEntityId())->andWhere([
31
            /** By Definition this needs to be a provider that is enabled. */
32 3
            'enabled' => 1,
33 3
        ])->one();
34
    }
35
}
36