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

LimitAdminAccessExtension::onBeforeInit()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 5
Bugs 1 Features 0
Metric Value
c 5
b 1
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
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