FakeCMSPage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A get() 0 4 1
1
<?php
2
require_once 'Intraface/Kernel.php';
3
require_once 'Intraface/DBQuery.php';
4
require_once 'Intraface/modules/cms/Page.php';
5
6
class FakeCMSPage extends CMS_Page
7
{
8
    public $kernel;
9
    public $cmssite;
10
    public $dbquery;
11
    function __construct($site)
12
    {
13
        $this->cmssite = $site;
14
        $this->kernel = $site->kernel;
15
        $this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = ' . $this->cmssite->get('id'));
16
    }
17
    function get()
18
    {
19
        return 1;
20
    }
21
}
22
23
class FakeCMSSite
24
{
25
    public $kernel;
26
    function __construct($kernel)
27
    {
28
        $this->kernel = $kernel;
29
    }
30
    function get()
31
    {
32
        return 1;
33
    }
34
}
35
36
class FakeCMSSection
37
{
38
    public $kernel;
39
    public $cmssite;
40
    function __construct($page)
41
    {
42
        $this->cmspage = $page;
0 ignored issues
show
Bug introduced by
The property cmspage does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
43
        $this->kernel = $this->cmspage->kernel;
44
    }
45
    function get()
46
    {
47
        return 1;
48
    }
49
}
50
51
class FakeCMSTemplate
52
{
53
    public $kernel;
54
55
    function __construct()
56
    {
57
        $this->kernel = new Stub_Kernel;
58
        $this->cmssite = new FakeCMSSite($this->kernel);
0 ignored issues
show
Bug introduced by
The property cmssite does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
59
    }
60
61
    function get()
62
    {
63
        return 1;
64
    }
65
}
66
67
class FakeCMSTemplateSection
68
{
69
    public $cmssite;
70
71
    function __construct($site)
72
    {
73
        $this->site = $site;
0 ignored issues
show
Bug introduced by
The property site does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
74
    }
75
76
    function get()
77
    {
78
        return '';
79
    }
80
}
81