Completed
Push — master ( 0988fd...b6ba79 )
by Josh
21:26 queued 14:22
created

autoloader.php ➔ autoload()   B

Complexity

Conditions 6
Paths 4

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 42

Importance

Changes 0
Metric Value
cc 6
eloc 9
nc 4
nop 1
dl 0
loc 18
ccs 0
cts 16
cp 0
crap 42
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
/**
4
* @package   s9e\TextFormatter
5
* @copyright Copyright (c) 2010-2017 The s9e Authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\TextFormatter;
9
10
function autoload($className)
11
{
12
	if (strpos($className, 's9e\\TextFormatter\\') === 0
13
	 && strpos($className, '.') === false)
14
	{
15
		$path = __DIR__ . strtr(substr($className, 17), '\\', '/') . '.php';
16
17
		if (file_exists($path))
18
		{
19
			include $path;
20
		}
21
		elseif (!class_exists('s9e\\TextFormatter\\Configurator', false)
22
			 && strpos($className, 's9e\\TextFormatter\\Configurator\\') === 0)
23
		{
24
			include __DIR__ . '/Configurator.php';
25
		}
26
	}
27
}
28
29
spl_autoload_register('s9e\\TextFormatter\\autoload');