IndexController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 6 1
A indexAction() 0 5 1
1
<?php
2
3
namespace FileManager\Controller;
4
5
use Application\Mvc\Controller;
6
7
class IndexController extends Controller
8
{
9
10
    public function initialize()
11
    {
12
        $this->setAdminEnvironment();
13
        $this->helper->activeMenu()->setActive('admin-fm');
14
        $this->view->languages_disabled = true;
0 ignored issues
show
Bug introduced by
Accessing languages_disabled on the interface Phalcon\Mvc\ViewInterface suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
15
    }
16
17
    public function indexAction()
18
    {
19
        $this->helper->title()->append('File Manager');
20
21
    }
22
23
}
24