Completed
Push — master ( 736eaa...f4bae8 )
by Martijn van
02:32
created

LimitAdminAccessExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A onBeforeInit() 0 7 2
1
<?php
2
3
/**
4
 * Class LimitAdminAccessExtension
5
 *
6
 * @property LeftAndMain $owner
7
 */
8
class LimitAdminAccessExtension extends Extension
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...
9
{
10
    /**
11
     * @return mixed
12
     */
13
    public function onBeforeInit()
14
    {
15
        $access = new IpAccess($this->owner->getRequest()->getIP());
16
        if (!$access->hasAccess()) {
17
            $access->respondNoAccess($this->owner);
18
        }
19
    }
20
}
21