GridFieldEditOriginalPageConfig   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
4
/**
5
 *
6
 *
7
 *
8
 *
9
 *
10
 *
11
 * @author nicolaas <[email protected]>
12
 */
13
14
15
16
class GridFieldEditOriginalPageConfig extends GridFieldConfig_RelationEditor
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
17
{
18
19
    /**
20
     * @param int $itemsPerPage - How many items per page should show up
0 ignored issues
show
Documentation introduced by
Should the type for parameter $itemsPerPage not be integer|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
21
     */
22
    public function __construct($itemsPerPage=null)
23
    {
24
        parent::__construct($itemsPerPage);
25
        $this
26
            ->removeComponentsByType("GridFieldEditButton")
27
            ->removeComponentsByType("GridFieldAddNewButton")
28
            ->addComponent(new GridFieldEditButtonOriginalPage());
29
    }
30
}
31
32
class GridFieldEditOriginalPageConfig_WithAddButton extends GridFieldEditOriginalPageConfig
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
33
{
34
35
    /**
36
     * @param int $itemsPerPage - How many items per page should show up
0 ignored issues
show
Documentation introduced by
Should the type for parameter $itemsPerPage not be integer|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
37
     */
38
    public function __construct($itemsPerPage=null)
39
    {
40
        parent::__construct($itemsPerPage);
41
        $this
42
            ->addComponent(new GridFieldAddNewButtonOriginalPage());
43
    }
44
}
45
46
class GridFieldEditOriginalPageConfig_WithoutDelete extends GridFieldEditOriginalPageConfig
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
47
{
48
49
    /**
50
     * @param int $itemsPerPage - How many items per page should show up
0 ignored issues
show
Documentation introduced by
Should the type for parameter $itemsPerPage not be integer|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
51
     */
52
    public function __construct($itemsPerPage=null)
53
    {
54
        parent::__construct($itemsPerPage);
55
        $this
56
            ->removeComponentsByType("GridFieldDeleteAction");
57
    }
58
}
59