Completed
Push — master ( 3a6bc2...bdf328 )
by Conrad
01:56
created

GroupExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 16
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 9 1
1
<?php
2
3
namespace AdvancedLearning\Oauth2Server\Extensions;
4
5
use AdvancedLearning\Oauth2Server\Models\Scope;
6
use SilverStripe\Forms\FieldList;
7
use SilverStripe\Forms\GridField\GridField;
8
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
9
use SilverStripe\ORM\DataExtension;
10
11
/**
12
 * Optionally adds scopes to groups, allows checking permissions for a Member based on scopes.
13
 *
14
 * @package AdvancedLearning\Oauth2Server\Extensions
15
 */
16
class GroupExtension extends DataExtension
17
{
18
    private static $many_many = [
0 ignored issues
show
Unused Code introduced by
The property $many_many is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
19
        'Scopes' => Scope::class
20
    ];
21
22
    public function updateCMSFields(FieldList $fields)
23
    {
24
        $fields->addFieldToTab('Root.Oauth', GridField::create(
25
            'Scopes',
26
            'Scopes',
27
            $this->Scopes(),
0 ignored issues
show
Bug introduced by
The method Scopes() does not seem to exist on object<AdvancedLearning\...ensions\GroupExtension>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
            GridFieldConfig_RelationEditor::create()
29
        ));
30
    }
31
}