Scope::generate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 9.4286
cc 2
eloc 5
nc 2
nop 1
crap 6
1
<?php
2
namespace Redbox\Twitch;
3
4
/*
5
 * @depecated
6
 */
7
class Scope
8
{
9
    const SCOPE_USER_READ            = 'user_read';
10
    const SCOPE_USER_BLOCKS_EDIT     = 'user_blocks_edit';
11
    const SCOPE_USER_BLOCKS_READ     = 'user_blocks_read';
12
    const SCOPE_USER_FOLLOWERS_EDIT  = 'user_follows_edit';
13
    const CHANNEL_READ               = 'channel_read';
14
    const CHANNEL_EDITOR             = 'channel_editor';
15
    const CHANNEL_COMMERCIAL         = 'channel_commercial';
16
    const CHANNEL_STREAM             = 'channel_stream';
17
    const CHANNEL_SUBSCRIPTIONS      = 'channel_subscriptions';
18
    const USER_SUBSCRIPTIONS         = 'user_subscriptions';
19
    const CHANNEL_CHECK_SUBSCRIPTION = 'channel_check_subscription';
20
    const CHAT_LOGIN                 = 'chat_login';
21
22
    public static function generate($scopes = [])
23
    {
24
        $scps = [];
25
        foreach ($scopes as $scope) {
26
            $scps[] = $scope;
27
        }
28
        return trim(implode(' ', $scps));
29
    }
30
}