Instance   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
eloc 5
c 5
b 0
f 0
dl 0
loc 20
ccs 4
cts 4
cp 1
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 9 3
1
<?php
2
3
namespace Rougin\SparkPlug;
4
5
/**
6
 * @package SparkPlug
7
 *
8
 * @author Rougin Gutib <[email protected]>
9
 */
10
class Instance
11
{
12
    /**
13
     * Creates a Codeigniter instance based on the application path.
14
     *
15
     * @param string                $path
16
     * @param array<string, string> $server
17
     * @param array<string, string> $globals
18
     *
19
     * @return \Rougin\SparkPlug\Controller
20
     */
21
    public static function create($path = '', array $server = array(), array $globals = array())
22
    {
23 12
        $globals = empty($globals) ? $GLOBALS : $globals;
24
25 12
        $server = empty($server) ? $_SERVER : $server;
26
27 12
        $sparkplug = new SparkPlug($globals, $server, $path);
28
29 12
        return $sparkplug->getCodeIgniter();
0 ignored issues
show
Deprecated Code introduced by
The function Rougin\SparkPlug\SparkPlug::getCodeIgniter() has been deprecated: since ~0.6, use "instance" instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

29
        return /** @scrutinizer ignore-deprecated */ $sparkplug->getCodeIgniter();

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
30
    }
31
}
32