NoopGrant::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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