PageFactory::newPage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 4
crap 1
1
<?php
2
namespace Bookdown\Bookdown\Content;
3
4
use Bookdown\Bookdown\Config\IndexConfig;
5
use Bookdown\Bookdown\Config\RootConfig;
6
7
class PageFactory
8
{
9 22
    public function newPage($origin, $name, $parent, $count)
10
    {
11 22
        return new Page($origin, $name, $parent, $count);
12
    }
13
14 22
    public function newIndexPage(IndexConfig $config, $name, $parent, $count)
15
    {
16 22
        return new IndexPage($config, $name, $parent, $count);
17
    }
18
19 22
    public function newRootPage(RootConfig $config)
20
    {
21 22
        return new RootPage($config);
22
    }
23
}
24