SlackAdmin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getEditForm() 0 15 2
1
<?php
2
3
4
/**
5
 * Class SlackAdmin
6
 *
7
 */
8
class SlackAdmin extends ModelAdmin
0 ignored issues
show
Bug introduced by
The type ModelAdmin was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
{
10
    private static $managed_models = [
11
        'SlackInvite'
12
    ];
13
14
    private static $url_segment = 'SlackInvite';
15
16
    private static $menu_title = 'Slack Invites';
17
18
    private static $menu_icon = '/stripeslack/img/slack_logo.png';
19
20
21
    public function getEditForm($id = null, $fields = null)
22
    {
23
        /** @var $this |Form $form */
24
        $form = parent::getEditForm($id, $fields);
25
        // Slightly pointless because it only manages 1 model, but ¯\_(ツ)_/¯
26
        if ($this->modelClass === 'SlackInvite') {
27
            $form->Fields()
28
                ->fieldByName('SlackInvite')
29
                ->getConfig()
30
                ->addComponent(
31
                    new GridfieldInviteResendAction()
32
                );
33
        }
34
35
        return $form;
36
    }
37
}
38