NoopGrant   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A auth() 0 4 1
1
<?php
2
3
namespace Baguette\Mastodon\Grant;
4
5
use Baguette\Mastodon\Service\AuthFactory;
6
use Baguette\Mastodon\Service\Scope;
7
use GuzzleHttp\ClientInterface as Client;
8
9
/**
10
 * Mastodon noop grant class
11
 *
12
 * @author    USAMI Kenta <[email protected]>
13
 * @copyright 2017 Baguette HQ
14
 * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL-3.0
15
 */
16
class NoopGrant extends Grant
17
{
18 1
    public function __construct()
19
    {
20
        // noop
21 1
    }
22
23
    /**
24
     * @param Client      $http
25
     * @param AuthFactory $factory
26
     * @param Scope       $scope
27
     */
28 1
    public function auth(Client $http, AuthFactory $factory, Scope $scope)
29
    {
30 1
        throw new \RuntimeException(sprintf('%s cannot authorize.', __CLASS__));
31
    }
32
}
33